<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Stephen Beaton on Medium]]></title>
        <description><![CDATA[Stories by Stephen Beaton on Medium]]></description>
        <link>https://medium.com/@this_sbtn?source=rss-28b853abfdf8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0G7haAUBH9Us041uc1a2Gw.png</url>
            <title>Stories by Stephen Beaton on Medium</title>
            <link>https://medium.com/@this_sbtn?source=rss-28b853abfdf8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 10:01:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@this_sbtn/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Value of a $]]></title>
            <link>https://medium.com/@this_sbtn/value-of-a-7fc9d05db30?source=rss-28b853abfdf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fc9d05db30</guid>
            <category><![CDATA[wearables]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[sdk]]></category>
            <category><![CDATA[svg]]></category>
            <category><![CDATA[fitbit]]></category>
            <dc:creator><![CDATA[Stephen Beaton]]></dc:creator>
            <pubDate>Tue, 03 Jul 2018 08:35:22 GMT</pubDate>
            <atom:updated>2019-01-12T20:20:48.843Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>UPDATE Jan 12, 2019:</strong> The current Fitbit SDK documentation has been updated to provide more clarity for the $ value. This article is no longer needed to understand some of the previous confusion around the value but still may be an interesting read if you are looking for some more examples and further explanation of this feature!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*ZoIrws5s9aPAC-0LyniOQQ.png" /></figure><p>The <a href="https://dev.fitbit.com/build/">Fitbit SDK</a> has a particular value used for positioning SVG elements known as the <a href="https://dev.fitbit.com/build/guides/user-interface/css/#dimensions-and-positioning">Parent ($)</a>. This is described in the documentation as being always equal to the current values of the parent element.</p><pre>&lt;svg width=&quot;300&quot; height=&quot;300&quot; viewport-fill=&quot;antiquewhite&quot;&gt;<br>  &lt;svg id=&quot;container&quot; width=&quot;150&quot; height=&quot;150&quot; x=&quot;20&quot; y=&quot;20&quot;&gt;<br>    &lt;rect id=&quot;inner&quot; width=&quot;140&quot; height=&quot;140&quot; x=&quot;<strong>$</strong>&quot; y=&quot;<strong>$</strong>&quot; fill=&quot;tomato&quot;/&gt;<br>  &lt;/svg&gt;<br>&lt;/svg&gt;</pre><p>The rect element here should be placed with top left <strong>x </strong>and <strong>y </strong>coordinates equal to those of the coordinates of the parent element <strong>#container</strong>. And this is exactly what we see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8cEHjqnOK_4CXN5QAmRvqA.png" /></figure><p>However as positioning coordinates are always relative to the parent element the results would be the same if we declared these values as 0:</p><pre>&lt;rect id=”inner” width=”140&quot; height=”140&quot; x=”<strong>0</strong>&quot; y=”<strong>0</strong>&quot; fill=”tomato”/&gt;</pre><p>So, as the first child of a parent element $ is always equal to 0. So why use this special value at all?</p><h4>The real value of $</h4><p>In fact the $ value is of more use when specifying position <em>between siblings</em>. But first let’s see what happens if we position 3 sibling elements with relative values of 0 to the parent #container:</p><pre>&lt;svg width=&quot;300&quot; height=&quot;300&quot; viewport-fill=&quot;antiquewhite&quot;&gt;<br>  &lt;svg id=&quot;container&quot; width=&quot;150&quot; height=&quot;150&quot; x=&quot;20&quot; y=&quot;20&quot;&gt;<br>    &lt;rect id=&quot;inner&quot; width=&quot;140&quot; height=&quot;140&quot; x=&quot;0&quot; y=&quot;0&quot; fill=&quot;tomato&quot;/&gt;<br>    &lt;rect id=&quot;anotherInner&quot; width=&quot;80&quot; height=&quot;80&quot; x=&quot;0&quot; y=&quot;0&quot; fill=&quot;indigo&quot;/&gt;<br>    &lt;rect id=&quot;yetAnotherInner&quot; width=&quot;40&quot; height=&quot;40&quot; x=&quot;0&quot; y=&quot;0&quot; fill=&quot;darkseagreen&quot;/&gt;<br>  &lt;/svg&gt;<br>&lt;/svg&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qzi93hRmYYJR2H3IJpS3HA.png" /><figcaption>Elements positioned 0 relative to parent.</figcaption></figure><p>They are all drawn with the same start coordinates, each one with the same relative position to the parent. So lets try again with the $ value:</p><pre>&lt;svg width=&quot;300&quot; height=&quot;300&quot; viewport-fill=&quot;antiquewhite&quot;&gt;<br>  &lt;svg id=&quot;container&quot; width=&quot;150&quot; height=&quot;150&quot; x=&quot;20&quot; y=&quot;20&quot;&gt;<br>    &lt;rect id=&quot;inner&quot; width=&quot;140&quot; height=&quot;140&quot; x=&quot;$&quot; y=&quot;$&quot; fill=&quot;tomato&quot;/&gt;<br>    &lt;rect id=&quot;anotherInner&quot; width=&quot;80&quot; height=&quot;80&quot; x=&quot;$&quot; y=&quot;$&quot; fill=&quot;indigo&quot;/&gt;<br>    &lt;rect id=&quot;yetAnotherInner&quot; width=&quot;40&quot; height=&quot;40&quot; x=&quot;$&quot; y=&quot;$&quot; fill=&quot;darkseagreen&quot;/&gt;<br>  &lt;/svg&gt;<br>&lt;/svg&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O6VwPcnC-FklGhT1Q69FXg.png" /><figcaption>Elements positioned $ relative to siblings.</figcaption></figure><p>Aha! Now things are beginning to happen. The first rect element positions itself relative to the x and y values of the parent #container. Then each of the following siblings is positioned relative to the previous sibling. The following siblings x and y values are defined by the x and y of the previous element <em>plus</em> it’s dimensions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*M5HhBiz1pYcD-QkZMDyAgA.png" /><figcaption>Parent and sibling inheritance for $ value</figcaption></figure><p>This means that the order in which the sibling elements are declared affects not only the drawing order, which ones are drawn on top of the other, but even the positioning as each sibling positions themselves relative to the last.</p><h4>Except sometimes</h4><p>The behavior can be a little unexpected when applying transforms or animation to elements. It didn&#39;t seem to apply while using symbols either. But as far as I could gather through own experimentation this is the general rule. Corrections and additional information are welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fc9d05db30" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>