<?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 Chris Nager on Medium]]></title>
        <description><![CDATA[Stories by Chris Nager on Medium]]></description>
        <link>https://medium.com/@chrisnager?source=rss-665fff1011ee------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*L3VUoTwCKm51399OAhj2wg.jpeg</url>
            <title>Stories by Chris Nager on Medium</title>
            <link>https://medium.com/@chrisnager?source=rss-665fff1011ee------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 24 Apr 2026 16:13:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chrisnager/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[Takeaways from F8 2018]]></title>
            <link>https://medium.com/@chrisnager/takeaways-from-f8-2018-3dde54919490?source=rss-665fff1011ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dde54919490</guid>
            <category><![CDATA[videos]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[f8]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Chris Nager]]></dc:creator>
            <pubDate>Sat, 12 May 2018 00:43:43 GMT</pubDate>
            <atom:updated>2018-05-12T01:30:08.659Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XOK461Q3UaKDNQwJ-9ihNg.png" /><figcaption>Farewell shot at Facebook’s F8 2018</figcaption></figure><p>Facebook hosts an annual developer conference, <a href="https://www.f8.com/">F8</a>, where their employees speak about Facebook’s latest product launches and hold workshops to teach developers about their technologies.</p><p>I got the opportunity to attend my first F8 this past week. Though much of the conference was focused on privacy and augmented/virtual reality (AR/VR), the most interesting and relatable takeaways for me were 1) what Facebook is doing with <strong>video</strong>, 2) their use of <a href="https://reactjs.org/"><strong>React</strong></a> in many different products, and 3) the insights I gained through <strong>conversations with developers</strong> from around the world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OacbEd-TlwkxeGbrrgezWA.png" /><figcaption>Mark Zuckerberg presenting Facebook’s 3, 5, and 10-year plans</figcaption></figure><h4>Facebook × video</h4><p>Video-tech is an exciting space to work in and it’s inspiring to see Facebook prioritize video and release a number of video products.</p><p>In the initial keynote this year, Mark Zuckerberg said Facebook plans to finish/improve video over the next three to five years.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vzK2Wi-KODPSh7t06HuR0w.png" /><figcaption>A presentation on Facebook Live and its companion video platform, Watch Party</figcaption></figure><p>Facebook released Watch Party which lets users watch real-time videos with friends. They announced photo/video reels for birthdays which hasn’t launched yet, but sounds exciting.</p><blockquote>“Instead of all of us writing on your wall to wish you a ‘happy birthday,’ how about we pull together, over the course of the day, a photo and video reel, which you then receive as a package at the end, saying, ‘happy birthday.’”<br> — Chris Cox, Chief Product Officer, Facebook</blockquote><p>As far as camera updates go, Facebook debuted new AR Camera Effects for Instagram and Messenger. Messenger now also allows users to share 4K photos and HD videos. It’s great to see larger platforms like Facebook prioritizing high quality video.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5kuZio2XCh9k8JI_SKk4KA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CExOoNRknwMlA9_1QWDb8Q.png" /><figcaption>Photos from the “How React Native Helps Companies Build Better Mobile Apps” panel discussion</figcaption></figure><h4>React everywhere</h4><p>I attended an excellent panel discussion that included speakers from Facebook, Skype, TaskRabbit, Vogue, and Postlight. These brands all have one thing in common: they’re using <a href="https://facebook.github.io/react-native/">React Native</a>. They all spoke about how React Native allowed their developer teams to move faster and share most their code between platforms. At <a href="https://www.aircamera.com/">Air</a>, React Native has allowed us to share code between platforms, including our web app.</p><blockquote>“For all of our apps we see around 93% code reuse between platforms. That’s not a typo.”<br> — Sophie Alpert, Engineering Manager, React, Facebook [<a href="https://developers.facebook.com/videos/f8-2018/how-react-native-helps-companies-build-better-mobile-apps/">source</a>]</blockquote><p>Wow! As one who cares deeply about <a href="https://medium.com/air-camera/case-for-a-monorepo-28cebf26e1aa">portable code</a>, I’m inspired to hear a large company like Facebook has such a high percentage of reusable code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RJCt_e-Yr1j4uXy53bOlWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ylVOiZvZ_Q_bev1qKECvzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zbWLiMsqiUSxsxJHvDJDiA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OCdUmW5mOFr9iTymQZ5LQ.png" /><figcaption>Photos from the talk “Building With React Native &amp; React VR”</figcaption></figure><p>What do Instagram and Oculus have in common? They both use React to build their apps. Instagram builds on top of React Native, while Oculus uses <a href="https://facebook.github.io/react-360/">React 360</a> (formerly <a href="https://facebook.github.io/react-360/blog/2018/05/02/blog-post.html">React VR</a>), a new React library for building 360 degree VR interfaces. As the React ecosystem grows, it opens up more opportunities for developers to build on exciting new platforms.</p><h4>Conversations and resources available</h4><p>One of my favorite aspects of F8 was meeting with Facebook employees and getting their thoughts on our development process. I got to schedule a 1-on-1 meeting with a Facebook product designer to chat about design systems and spoke with a Facebook developer that worked on the React team about how they use React internally. I also enjoyed meeting many of the speakers after their presentations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lMpgwfe7JkbC0DrLmTLtWQ.png" /><figcaption>Photo from the “Jest Automated Testing” workshop</figcaption></figure><p>The workshops I attended at F8 were informative, including the <a href="https://facebook.github.io/jest/">Jest</a> workshop that covered automated JavaScript testing. I also got to meet incredible entrepreneurs from around the globe and hear about their tech stacks and business strategies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OO-iofgoSGzZPwD-iAAtGw.png" /><figcaption>Entrance to F8 2018 at the San Jose McEnery Convention Center</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-LRYGpmcDrmyJKgzN3riw.png" /><figcaption>See videos from the conference in my “F8 2018” reel on Air: <a href="https://airc.am/BybjKC-Cf">airc.am/BybjKC-Cf</a></figcaption></figure><p>To sum up my post-F8 experience: I’m excited to work in <strong>video</strong>, build apps in the <strong>React</strong> ecosystem, and have a lively and <strong>helpful developer community</strong> around me.</p><p>Thanks for your time! <a href="https://www.producthunt.com/upcoming/air-2-0">Subscribe</a> for product updates from Air.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dde54919490" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Case for a monorepo]]></title>
            <link>https://medium.com/@chrisnager/case-for-a-monorepo-28cebf26e1aa?source=rss-665fff1011ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/28cebf26e1aa</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[monorepo]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Chris Nager]]></dc:creator>
            <pubDate>Tue, 20 Mar 2018 17:04:13 GMT</pubDate>
            <atom:updated>2018-04-20T15:18:34.232Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3HrHDOTiYa5-I6Mh8vhqbg.png" /><figcaption>Code + design + file structure</figcaption></figure><h3>🎈 Air</h3><p>At <a href="https://www.aircamera.com/">Air</a>, we’re building apps for capturing, storing, and managing videos. We currently offer an <a href="https://itunes.apple.com/us/app/air-a-camera-for-home-movies/id1244558410?mt=8">iOS app</a> and a web app that share a good amount of code. This article walks through the steps we took to build a universal codebase and synced design system in a single <a href="https://git-scm.com/">Git</a> repository.</p><h3>Goal</h3><p>My goal was to build a <strong>cross-platform codebase</strong> that synced with our <strong>design system </strong>and allowed for <strong>rapid code changes</strong> to increase our team’s output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IBrNEawRULatFOhOeprP0A.png" /></figure><h3>Universal code</h3><p>I looked at our projects and found plenty of reusable code and shared folders. Our apps share utilities, constants, config settings, <a href="https://en.wikipedia.org/wiki/Internationalization_and_localization">i18n</a> strings, linting rules, and <a href="https://facebook.github.io/react-native/">React Native</a> components (thanks to <a href="https://github.com/necolas/react-native-web">react-native-web</a>). With this information, I was able to split our code into reusable packages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sSRczHNJIRVd7nX60zju5A.png" /><figcaption>Initial plans to create Air’s universal system</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SFmL6TKLEhKs0NOdERvKtQ.png" /></figure><h3>Synced design system</h3><p>We use <a href="https://storybook.js.org/">Storybook</a> to generate our design documentation. Our docs use Air’s shared components which keeps our design system and code in perfect sync. When a change is made to our components, our apps and docs are updated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RRlI-9jJPuoOzlA78xzNPA.png" /><figcaption>Air’s design system docs</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gy00t5O0PJi38SQi8Fj77w.png" /></figure><h3>Finding our optimal file structure</h3><h4><strong>First implementation: Practice repos</strong></h4><p>Our initial code organization strategy was to keep our app repositories separate. We then built functional practice projects that contained essentially reusable code for us to copy-paste into our apps. As we moved quickly, this was an easy way to stay in sync for a small team, but was ultimately not a sustainable solution.</p><ul><li>✔ Simple</li><li>✘ Hard to stay in sync</li><li>✘ Duplicated code</li><li>✘ Not sustainable</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*DJXdkxwMHW85H9ftLKAXNw.gif" /><figcaption>Oh, bother.</figcaption></figure><h4><em>Second implementation</em>: <strong>Polyrepo structure</strong></h4><p>I then built a polyrepo structure, abstracting all shared packages into their own repositories (constants, utilities, config, components, etc.).</p><p>Our apps consumed these packages as defined in their package.json file. This was clean, but led to dependency management chaos. Every time a change needed to be made to a dependency, we were forced to jump into a separate repo, update it, bump the package version (if need be), hop back into our original project, and reinstall the dependency. Another issue we ran into was, because we serve our web app and site on <a href="https://www.netlify.com/">Netlify</a>, we had to create workarounds for reusing our Git credentials to install our private repositories.</p><ul><li>✔ Clean</li><li>✔ Reusable code</li><li>✘ Slowed down development time</li><li>✘ Dependency management is difficult</li><li>✘ Issues with Netlify builds</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FmRh4cLIYhrs9G%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fweek-finals-summed-mRh4cLIYhrs9G&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FmRh4cLIYhrs9G%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="234" frameborder="0" scrolling="no"><a href="https://medium.com/media/62d0b9e2223f918a9610ada5c8ad7834/href">https://medium.com/media/62d0b9e2223f918a9610ada5c8ad7834/href</a></iframe><h4><em>Third implementation</em>: <strong>Monorepo</strong></h4><p>Finally, I used <a href="https://yarnpkg.com/lang/en/docs/workspaces/">Yarn Workspaces</a> to build a single repo that hosts all our projects and handles our dependencies in a more maintainable way.</p><ul><li>✔ Clean; all dependencies are in a single packages folder</li><li>✔ Reusable code</li><li>✔ Consistent linting and project configuration files across all packages (.eslintrc, .babelrc, .gitignore, prettierrc.json, etc.)</li><li>✔ Cross-platform testing is easy to set up</li><li>✔ Simple releases with <a href="https://lernajs.io/">Lerna</a></li><li>✔ Allows for rapid development across dependencies</li><li>✔ Simple dependency management</li><li>✔ Contains our synced design system</li><li>✔ Works perfectly with Netlify builds</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F2VHJPf2s2ym8E%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fdisney-bear-love-2VHJPf2s2ym8E&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F2VHJPf2s2ym8E%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="245" frameborder="0" scrolling="no"><a href="https://medium.com/media/26d22a0253a499afd26ba961a9570e21/href">https://medium.com/media/26d22a0253a499afd26ba961a9570e21/href</a></iframe><h3>🏆 Goal achieved</h3><p>Thanks to our new code organization, we now have:</p><ul><li><strong>A universal codebase</strong> with <a href="https://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRY</a>, shared code between projects</li><li><strong>Synced design docs</strong> that use our shared components</li><li><strong>Rapid, cross-project code changes and releases</strong> in our new monorepo</li></ul><p><em>Though a monorepo worked for our purposes (and for others [Facebook, Google, Twitter, Babel, React Native Web, React Router, Meteor]), be sure to review the </em><a href="https://github.com/babel/babel/blob/master/doc/design/monorepo.md"><em>pros and cons</em></a><em> before implementing one.</em></p><h3>Takeaways</h3><ul><li>Consistency is underrated. Tools like <a href="https://prettier.io/">Prettier</a> and <a href="https://eslint.org/">ESLint</a> are spectacular for working with a team across multiple projects.</li><li>Using lerna import or git subtree carries over a repo’s Git history and combines its commits chronologically with the monorepo’s commit history. We’re still finding the best way to compose our commit messages for the monorepo as commits can span multiple packages. We may try namespacing our commits. (e.g. [web, components] Refactor gallery)</li><li>An exciting aspect of building a business from the ground up is the speed at which we’re able to adopt or reject new technologies. I’m proud of our team for their ability to move quickly and willingness to try new things.</li></ul><h3>$ &gt;whoami</h3><p>I’m Chris, a designer-developer that has worked in advertising, in big tech, on Wall Street, and am now building a startup in a Brooklyn warehouse. I care deeply about accessibility and performance in my apps.</p><p>Mash the clap (👏) button if you found this article helpful or want to show your support for our startup. Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28cebf26e1aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stack your classes within template literals]]></title>
            <link>https://medium.com/@chrisnager/stack-your-classes-within-template-literals-d537bf463d4a?source=rss-665fff1011ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/d537bf463d4a</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Chris Nager]]></dc:creator>
            <pubDate>Wed, 09 Mar 2016 14:01:00 GMT</pubDate>
            <atom:updated>2016-03-09T14:01:00.845Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O8G8fBQQ-pkW9dNcKlE6lA.jpeg" /></figure><p>The purpose of this article is to share a simple technique I use that involves <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals">template literals</a>, a useful feature of ES2015+. Template literals allow you to write multi line strings enclosed in back ticks, eliminating the need to escape each line with a backslash or having to concatenate each line with <strong>+</strong>.</p><pre>`All<br> day<br> breakfast`</pre><p>instead of:</p><pre>&#39;All\<br> day\<br> breakfast&#39;</pre><pre>// or</pre><pre>&#39;All&#39; +<br>&#39;day&#39; +<br>&#39;breakfast&#39;</pre><p>Template literal multi line strings are much cleaner!</p><p>It gets better. You can use <strong>${}</strong> to denote a placeholder for a JavaScript expression, such as a variable or function. You can use placeholders inside your template literals like this:</p><pre>const friend = &#39;Chris Nager&#39;</pre><pre>console.log(`Hello, <strong>${friend}</strong>.`)</pre><pre><em>// Hello, Chris Nager.</em></pre><p>Two extremely useful UI libraries I use in many projects are <a href="https://facebook.github.io/react/">React</a> and <a href="http://www.basscss.com/">Basscss</a>. They play nicely together because Basscss’s single purpose classes make style declarations predictable and are especially useful when working with reusable components in React. The following technique doesn’t require React or Basscss as dependencies, but I’ll use them to illustrate my point.</p><p>Within my React components, I stack my CSS classes in a template literal. This gives me the added benefit of clearly defining my props- and logic-based styles with placeholders.</p><pre>import React, {<br>  Component,<br>} from &#39;react&#39;</pre><pre>class Box extends Component {<br>  render() {<br>    const {<br>      color,<br>      isActive,<br>    } = this.props</pre><pre>    return (<br>      &lt;div <strong>className={`<br>        h1<br>        p2<br>        border<br>        italic<br>        ${color}<br>        ${isActive &amp;&amp; &#39;bold&#39;}<br>      `}</strong>&gt;<br>        {color}<br>      &lt;/div&gt;<br>    )<br>  }<br>}</pre><pre>React.render(<br>  &lt;Box<br>    color=&quot;teal&quot;<br>    isActive<br>  /&gt;,<br>  document.body<br>)</pre><p><em>See </em><a href="http://codepen.io/chrisnager/pen/vGNNXa/?editors=0010"><em>this demo on CodePen</em></a><em>.</em></p><p>Writing your classes in a multi line stack has a few advantages. It’s better organized and more readable than a long single line of many classes.</p><p>When working with <a href="https://git-scm.com/">git</a>, the main advantage of multi line stacked classes is that you can see your changes by line and know exactly what classes have been added or removed.</p><pre><em>$ git diff</em></pre><pre>   return (<br>     &lt;div className={`<br>       h1<br><strong>-      p2<br>+      p3</strong><br>      border<br>      italic<br>      ${color}</pre><p>If you find this technique useful, ❤ this article. If you have any thoughts on the subject, let me know in the comments or reach out to me on Twitter <a href="http://twitter.com/chrisnager">@chrisnager</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d537bf463d4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Center and crop images with a single line of CSS]]></title>
            <link>https://medium.com/@chrisnager/center-and-crop-images-with-a-single-line-of-css-ad140d5b4a87?source=rss-665fff1011ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad140d5b4a87</guid>
            <dc:creator><![CDATA[Chris Nager]]></dc:creator>
            <pubDate>Tue, 20 Jan 2015 04:25:53 GMT</pubDate>
            <atom:updated>2015-01-20T04:29:36.343Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using <strong>object-fit: cover</strong></h4><p>It’s simple. Set your image crop dimensions and use this line in your CSS:</p><pre>img {<br>    object-fit: cover;<br>}</pre><p>That’s it. No need for unsemantic, wrapping <strong>div</strong>s or any other nonsense.</p><p>This technique works great for cropping awkwardly-sized avatar pictures down to squares or circles. Take this wide photo of a bear below for example. Once <strong>object-fit: cover</strong> is applied to the image and a <strong>width</strong> and <strong>height</strong> are set, the photo crops and centers itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wJufAGfVpujMhO3fl37B9g.png" /><figcaption><a href="http://codepen.io/chrisnager/pen/azWWgr/?editors=110">See it in action</a>.</figcaption></figure><p><strong>object-fit: cover </strong>crops the exact same way <strong>background-size: cover </strong>does, but is used for styling <strong>img</strong>s, <strong>video</strong>s<strong> </strong>and other media tags rather than background images.</p><p><strong>object-fit </strong>has <a href="http://caniuse.com/#feat=object-fit">fairly decent support in the latest browsers</a> and there’s a <a href="https://github.com/anselmh/object-fit">polyfill</a> for older browsers (IE8+).</p><p>Interested in the other <strong>object-fit</strong> values? <a href="http://codepen.io/chrisnager/pen/XJRRwo?editors=110">Try them out</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad140d5b4a87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bespoke SVG Reference]]></title>
            <link>https://medium.com/@chrisnager/bespoke-svg-reference-e22eb733272?source=rss-665fff1011ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/e22eb733272</guid>
            <dc:creator><![CDATA[Chris Nager]]></dc:creator>
            <pubDate>Fri, 23 May 2014 05:04:27 GMT</pubDate>
            <atom:updated>2014-05-23T18:08:44.367Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn to draw your own SVG shapes in the browser</h4><p>The following commands can be used in the <strong>d</strong> attribute within a <strong>path</strong> to help you draw your own SVG shapes.</p><p>Like so:</p><pre>&lt;svg viewBox=&quot;0 0 5 5&quot; xmlns=&quot;<a href="http://www.w3.org/2000/svg">http://www.w3.org/2000/svg</a>&quot;&gt;<br>  &lt;path d=&quot;<strong>M2 1 h1 v1 h1 v1 h-1 v1 h-1 v-1 h-1 v-1 h1 z</strong>&quot; /&gt;<br>&lt;/svg&gt;</pre><p><a href="http://codepen.io/chrisnager/pen/armzk"><em>This code draws an SVG plus sign (+)</em></a><em>.</em></p><p><em>A quick note:</em></p><ul><li><strong>Capital letter </strong>commands, like <em>M</em>, refer to <strong>absolutely positioned </strong>points.</li><li><strong>Lowercase letter </strong>commands, like <em>m</em>, refer to <strong>relatively positioned </strong>points.</li></ul><h3>M</h3><p>moveto</p><p><em>X,Y</em></p><p>Begins the string at an absolute, designated position. If more than one pair of coordinates are provided, it’s as if the other pairs are preceded by an L.</p><h3>m</h3><p>moveto</p><p><em>x,y</em></p><p>Same as M, except that if more than one pair of coordinates are provided, extra pairs are processed as if preceded by an l.</p><h3>L</h3><p>lineto</p><p><em>X,Y</em></p><p>Draws a line from the last position to the specified position.</p><h3>l</h3><p>lineto</p><p><em>x,y</em></p><p>Draws a line from the last position to a relative position: x pixels to the right and y to the bottom.</p><h3>H</h3><p>horizontal lineto</p><p><em>x</em></p><p>Draws a horizontal line to the specified, absolute x position.</p><h3>h</h3><p>horizontal lineto</p><p><em>x</em></p><p>Draws a horizontal line x pixels to the right (if x is negative, the line is drawn to the left).</p><h3>V</h3><p>vertical lineto</p><p><em>y</em></p><p>Draws a vertical line to the specified, absolute y position.</p><h3>v</h3><p>vertical lineto</p><p><em>y</em></p><p>Draws a vertical line x pixels to the bottom (if y is negative, the line is drawn to the top).</p><h3>A</h3><p>elliptical arc</p><p><em>rx,ry,alpha,large,sweep,x,y</em></p><p>Draws an elliptical arc: rx and ry are the radius of the ellipse; alpha is the x-axis rotation of the ellipse; large is 0 if the arc should be the shorter arc (less than 180°), 1 if it should be the longer arc; sweep is 0 is the arc is to be drawn clockwise, 1 if counter-clockwise; x,y are the coordinate of the end point of the arc.</p><h3>Q</h3><p>quadratic Bézier curve</p><p><em>cX cY eX eY</em></p><p>Draws a Bézier quadratic curve. cX,cY are the coordinates of the control point, eX,eY that of the endpoint. More pairs can be provided (extra control points and endpoints).</p><h3>q</h3><p>quadratic Bézier curve</p><p><em>cX cY eX eY</em></p><p>Draws a Bézier quadratic curve, with the coordinates of the points relative to the current point.</p><h3>T</h3><p>smooth quadratic Bézier curveto</p><p><em>eX eY</em></p><p>Draws a Bézier quadratic curve, using the last provided control point (or failing that the current point).</p><h3>t</h3><p>smooth quadratic Bézier curveto</p><p><em>eX eY</em></p><p>Same as T, with the coordinates of the end point relative to the current point.</p><h3>C</h3><p>curveto</p><p><em>cX1 cY1 cX2 cY2 eX eY</em></p><p>Draws a Bézier cubic curve, with cX1,cY1,cX2,cY2 being the coordinates of the control points.</p><h3>c</h3><p>curveto</p><p><em>cX1 cY1 cX2 cY2 eX eY</em></p><p>Same as C, with the coordinates of the points relative to the current point.</p><h3>S</h3><p>smooth curveto</p><p><em>cX2 cY2 eX eY</em></p><p>Draws a Bézier cubic curve, using the previously provided control point (cX1,xY1) or failing that the current point, cX2,cY2 as the next control point, and eX,eY as the end point</p><h3>s</h3><p>smooth curveto</p><p><em>cX2 cY2 eX eY</em></p><p>Same as S, with the coordinates of the points relative to the current point.</p><h3>Z, z</h3><p>closepath</p><p>Close the path by joining the ending point with the beginning point.</p><p><em>Resources:</em></p><p><a href="http://www.jeromecukier.net/wp-content/uploads/2012/10/d3-cheat-sheet.pdf">http://www.jeromecukier.net/wp-content/uploads/2012/10/d3-cheat-sheet.pdf</a></p><p><a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths">https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths</a></p><p><em>Examples:</em></p><p><a href="http://codepen.io/chrisnager/pen/armzk">http://codepen.io/chrisnager/pen/armzk</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e22eb733272" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>