<?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 James Nash on Medium]]></title>
        <description><![CDATA[Stories by James Nash on Medium]]></description>
        <link>https://medium.com/@cirrus?source=rss-955b936dab83------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0DCYqOcv3wYeI7ekyvq0sQ.png</url>
            <title>Stories by James Nash on Medium</title>
            <link>https://medium.com/@cirrus?source=rss-955b936dab83------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 05:36:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cirrus/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[Gravity 3: Colour system]]></title>
            <link>https://medium.com/@cirrus/gravity-3-colour-system-a41cf3fbf443?source=rss-955b936dab83------2</link>
            <guid isPermaLink="false">https://medium.com/p/a41cf3fbf443</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[colors]]></category>
            <category><![CDATA[design-systems]]></category>
            <dc:creator><![CDATA[James Nash]]></dc:creator>
            <pubDate>Fri, 19 Jun 2020 09:32:44 GMT</pubDate>
            <atom:updated>2020-07-22T15:00:24.364Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mbbqzYYtgG2-OzCoBH508w.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@sharonmccutcheon?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Sharon McCutcheon</a> on <a href="https://medium.com/s/photos/color-powder?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Gravity 3, the latest version of <a href="https://buildit.wiprodigital.com/">buildit</a>’s design system, has completely revamped how we apply colours when styling UI elements. Our new system makes all UI components chameleons that can automatically blend in with the colour scheme of their surroundings on a page, and it does so purely with CSS. This article covers the motivations for making this and how we did it.</p><h3>Ye olden days</h3><p>Like many UI frameworks and design systems, older versions of Gravity defined a number of color <em>purposes</em> — for example default page foreground and background colours, colours for different kinds of interactive controls, and so on. We then assigned specific colour <em>values</em> to each of those purposes. In our case this was all expressed as SASS variables.</p><figure><img alt="Screenshot of SASS code, showing a number of colour purpose variables being assigned colour values." src="https://cdn-images-1.medium.com/max/1024/1*t_xhw1vVDGYZCSC-kLu8Dw.png" /><figcaption>Some of <a href="https://github.com/buildit/gravity-ui-web/blob/v1.0.0/src/ui-lib/sass/00-settings/_colors.scss">Gravity v1’s colour purpose SASS variables</a></figcaption></figure><p>Elsewhere in our code, we would then reference those purpose variables when styling UI components. Here’s an example of <a href="https://github.com/buildit/gravity-ui-web/blob/v1.0.0/src/ui-lib/sass/03-elements/_inline-text.scss">how we did it for basic links</a>:</p><pre>a[href] {<br>  &amp;:link {<br>   color: <strong>$grav-co-interactive-secondary</strong>;<br>  }<br><br>  &amp;:visited {<br>    color: <strong>$grav-co-interactive-secondary-visited</strong>;<br>  }<br><br>  &amp;:hover {<br>    color: <strong>$grav-co-interactive-secondary-hover</strong>;<br>  }<br><br>  &amp;:active {<br>    color: <strong>$grav-co-accent-primary-light</strong>;<br>  }<br>}</pre><p>The motivations for this approach were:</p><ul><li>Using variable names that express intended purpose (or “semantic names”, if you prefer) encourages developers to use them for the same kinds of things. In the UI that ultimately manifests itself as more visual consistency. UI elements that have a similar purpose tend to also be styled with similar colours.</li><li>It adds a layer of abstraction between our “raw” colour values, which came from our brand colour palette, and how and where they get used in the UI. If our brand changes, we simply map new brand colour values to our colour purpose variables and downstream in the code nothing else needs to change.</li></ul><p>To aid accessibility, we also chose our colour assignments such that certain purposes could be paired with the default page background or foreground colours and the resulting combination would have an acceptable colour contrast. As long as developers styling components used the colour purpose variables as intended, they could just trust the system to ensure accessible text and background colour pairings.</p><p>While this all worked pretty well, we did hit some limitations. The design of the buildit website, which is our design system’s flagship consumer, evolved and introduced footers and other page regions with different background colours from the default:</p><figure><img alt="A partial screenshot of a webpage, showing 3 regions each containing text, but also each with differing background colours" src="https://cdn-images-1.medium.com/max/1024/1*8yP57Zz8m7SvDorwDIWLcA.png" /></figure><p>This meant we had to override the usual colours for UI components when they were within a region with a non-default background. Broadly speaking, there’s two ways people tend to go about this in CSS. Either they add variants of UI components, for example by means of BEM-style modifier classes like button--inverted, and page authors then need to add those in the HTML for anything within such a region. Or, you can use CSS descendent selectors to select certain components within a region. That takes the onus off whoever’s writing the HTML to do anything special, but doesn’t work well if you plan to nest coloured sections within other coloured sections. We chose this approach though because we didn’t have a need for such nesting and wanted to keep our HTML simple. Here’s an excerpt from our page footer component’s code to illustrate this:</p><pre>body &gt; footer {<br>  background-color: $grav-co-neutral-charcoal;<br>  color: $grav-co-neutral-dirty-snow-white;</pre><pre>  // Override links&#39; colours within the footer<br><strong>  a[href]:link,<br>  a[href]:visited {<br>    color: $grav-co-neutral-dirty-snow-white;<br>  }<br><br>  a[href]:hover {<br>    color: $grav-co-neutral-ashtray;<br>  }</strong><br>}</pre><p>If an &lt;a href=&quot;...&quot;&gt; element appears on the page, it has the standard colours. If it happens to reside somewhere within a page footer, its colours automatically change to suit.</p><p>However, as you can see from the above SASS excerpt, we were now ignoring our colour purpose variables and just using (named) brand colour values directly. This was because our purpose variables didn’t account for different background colour contexts. We could have added more purpose variables for different contexts, but that wouldn’t scale very well. What would have happened if we needed even more colour schemes? It would have rapidly gotten unwieldy and defeated the original purpose of having a concise set of descriptive, well-understood and widely used colour purposes.</p><p>If you look closely, there’s <em>another</em> issue with this. You can’t safely put <em>any</em> UI component into a page footer (or any other region with a non-default colour scheme) until we’ve added some suitable colour overrides for it. We’ve covered basic text and links, but what if we needed to put a button in there? The same would have been true if we had been using modifier classes instead.</p><p>This is a pattern I’ve seen in other design systems: <em>Some</em> components will have a handful of variants for situations where they are used on a non-default background. But other components don’t. Want to nest a card within a pink sidebar? Tough luck!</p><p>It also means every new component needs to have multiple variants designed and built, if it is to work in all contexts. Likewise, adding support for new background colour means revisiting all your components and adapting their colours as necessary.</p><p>This got us wondering — could there be a more elegant solution?</p><h3>The C in CSS stands for cascade</h3><p>A while ago I wrote a post titled “<a href="https://medium.com/buildit/a-tale-of-two-buttons-e63185aefd5f">A Tale of Two Buttons</a>”, where I showed how CSS’s cascade and custom properties could be used to cut down the amount of styling code that needs to be written and create “chameleon” buttons that automatically adapt their colour scheme based on where they are in the DOM.</p><p>The basic approach is that you don’t assign explicit colour values in your CSS, but instead either inherit or use the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#currentColor">currentColor</a> where you can, and use CSS custom properties for anything else. The <em>valu</em>es that currentColor and custom properties resolve to, can be set by parent elements. If you do this comprehensively, then all of your UI component’s colours are not set in the component itself but instead inherited from their parents.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fembed%2Fpreview%2FbjZxGR%3Fheight%3D600%26slug-hash%3DbjZxGR%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;display_name=CodePen&amp;url=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fpen%2FbjZxGR&amp;image=https%3A%2F%2Fscreenshot.codepen.io%2F548984.bjZxGR.small.5ba4c3c9-8220-4ac3-af28-10b0fcb2aff8.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/9711789d0b6c37b9beb252bb3d804bf5/href">https://medium.com/media/9711789d0b6c37b9beb252bb3d804bf5/href</a></iframe><p>That means you decouple individual UI components from colour schemes that can be applied to them. In doing so, you eliminate the need to have per-colour scheme variants of each UI component. Furthermore, you can add or change colour schemes without needing to modify any UI components.</p><p>Great. But, how many different colours do we need to style <em>any</em> UI component? Text and anything that should share the same colour as text is already covered by currentColor, so we’ve got 1 for free. But links should visually stand out, so that’s another colour. They also have a few states — visited, hover and active — so that’s potentially an additional 3 colours. What about buttons, checkboxes, etc… do we need to define custom properties for each part and state of all of those? And then assign colours to each for every colour scheme we make?</p><p>While there’s a huge number of things you theoretically <em>could</em> colour differently in a UI, designers often choose to restrict themselves to a finite palette and apply the same colours to multiple things. That can then be reflected in the code by a set of CSS custom properties. Enough to achieve your desired UI look, but not so many as to become difficult to understand and use.</p><p>This is where every design system team needs to make its own, opinionated decisions. One team might decide the links share the same colour as buttons and the check mark on a checkbox. A different team might instead decide that links and buttons should use different colours, but perhaps their headings use the same colour as links.</p><p>Ultimately, each design system team needs to clearly understand the design’s <em>intent</em> and then express that in the code. This will require collaboration and dialogue between designers and developers. Insights from developers can lead to changes in the designs, just as much as updates to designs can lead to changes in the code!</p><h3>Defining Gravity’s colour purposes</h3><p>In parallel to exploring Gravity’s refreshed aesthetic in design tools via mock-ups, we began taking a closer look at the sets of colours used elsewhere for inspiration. We examined UI frameworks like <a href="https://github.com/twbs/bootstrap/blob/master/scss/_variables.scss">Bootstrap</a>, editor colour schemes like <a href="https://ethanschoonover.com/solarized/#usage-development">Solarized</a>, and even <a href="https://support.office.com/en-gb/article/create-your-own-theme-in-powerpoint-83e68627-2c17-454a-9fd8-62deb81951a6">MS PowerPoint themes</a>. How many different colours did they permit and what were they being used for?</p><figure><img alt="Screenshot of a spreadsheet comparing colour purposes from Solarized, Bootstrap, MS PowerPoint and Slack themes." src="https://cdn-images-1.medium.com/max/1024/1*2ZMbRRxivJvm9nJKw1B1SQ.png" /><figcaption>We started collating some of our findings in a Google Sheet</figcaption></figure><p>We also wanted to encourage accessible colour contrast ratios. Someone creating a new UI component only has a set of colour <em>purposes</em> to work with, each of which may have arbitrary colours assigned to it. However, they need to have some means of knowing which pairings would yield accessible contrast ratios. Our aim was therefore to incorporate some kind of clue into our naming scheme.</p><p>Initially we leant towards dividing colours purposes into “foreground” and “background” groups. There would be a default for each and then a set of additional foregrounds or backgrounds. Any foreground could be safely paired with the <em>default</em> background and vice-versa. We explored the concept in a series of CodePen prototypes, such as this one:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fembed%2Fpreview%2FRBmyQW%3Fheight%3D600%26slug-hash%3DRBmyQW%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;display_name=CodePen&amp;url=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fpen%2FRBmyQW&amp;image=https%3A%2F%2Fscreenshot.codepen.io%2F548984.RBmyQW.small.f216742f-6b18-4bd0-98c4-94f894aa49c8.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/f53bdf2126fbb3380c0b45e61ea23c42/href">https://medium.com/media/f53bdf2126fbb3380c0b45e61ea23c42/href</a></iframe><p>That naming scheme didn’t stand up to closer scrutiny though. Imagine a button with a solid background. This needs to visibly stand out compared to its surroundings, so you want good contrast between the page background and the button background. Now the text label within the button also needs to visibly contrast with the button’s background, so we might re-use the page <em>background</em> as the button’s <em>foreground</em>. It’s easy to see how it would quickly get confusing when using such names.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*cdHIYEqpZMRsEfd9RVN0mg.jpeg" /></figure><p>We did however like the idea of having <em>groups</em> of colour purposes with the constraint that colours from one group would always create accessible contrast ratios with colours from another group. UI components could be styled based on that rule, and colour schemes would need to follow that rule. In the end, we settled on the super generic names of: “Group A” and “Group B”.</p><p>After much prototyping and discussion, we ended up with a total of 18 colour purposes — 6 in group A and 12 in group B. You can read about them in the <a href="http://style.buildit.digital/docs/gravity-for-the-web/color-system.html">“colour system” section of our pattern library</a>. In other words, Gravity UI components can be styled with up to 18 different colours, no more. So far this is meeting our needs. Of course, we may end up extending the set in the future if a <em>strong</em> need arises. However, our hope is this intentional constraint will also influence future UI component design. Adding a new colour purpose to our design system will increase its complexity and should only be done with caution — much like deciding whether to reuse an existing UI component or making a new one.</p><p>Any group A colour can be paired with any group B colour and yield at least a 3:1 contrast ratio, which is the WCAG AA requirement for large text. A subset of combos (those involving at least one of the “neutral” colour purposes) need to achieve a 4.5:1 ratio, which is AA standard for normal sized text. This is something we have <a href="https://github.com/buildit/gravity-particles/blob/develop/tests/color-schemes.test.js">automated tests</a> for. When editing or adding colour schemes, the assignments of colour values to our 18 colour purposes are checked and any that don’t meet the required criteria will fail the tests. Therefore, we can guarantee that our UI will always have accessible contrast ratios, regardless of which colour scheme is being applied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c0LthEHlAQ-tkq1SVE4KmQ.png" /><figcaption>Some output from our automated colour scheme tests</figcaption></figure><p>Two of the colour purposes are also special:</p><ul><li>Group A “neutral” is always set as the background-color of the page or container</li><li>Group B “neutral” is always set as the color of the page or container</li></ul><p>The reasoning for this is as follows:</p><ul><li>Group B “neutral” is intended to be the default text colour, so in many cases this can simply be inherited and does not need to be explicitly set on individual HTML elements or UI components.</li><li>When styling an element or component, you need to know which group the surrounding background is (which is now guaranteed to be group A). Therefore if your component needs to visually contrast with that, you know you must pick a group B colour for whichever part of it needs to be visible against the surrounding background, such as its border.</li></ul><p>In the final CSS, we apply a default colour scheme to the whole page using the :root selector like so:</p><pre>:root {<br>  --grav-co-grp-a-neutral: #fff;<br>  --grav-co-grp-a-neutral-alt: #f1f1f1;<br>  --grav-co-grp-a-accent: #fff;<br>  --grav-co-grp-a-accent-success: #eaf3d8;<br>  --grav-co-grp-a-accent-attention: #ffdfa4;<br>  --grav-co-grp-a-accent-danger: #fdd4c2;</pre><pre>  --grav-co-grp-b-neutral: #404040;<br>  --grav-co-grp-b-neutral-subtle: #4d4848;<br>  --grav-co-grp-b-neutral-emphasis: #404040;<br>  --grav-co-grp-b-control: #4d4848;<br>  --grav-co-grp-b-control-alt: #6f2c91;<br>  --grav-co-grp-b-control-emphasis: #007c6c;<br>  --grav-co-grp-b-control-active: #005c50;<br>  --grav-co-grp-b-control-disabled: #666;<br>  --grav-co-grp-b-accent: #007c6c;<br>  --grav-co-grp-b-accent-success: #4d4848;<br>  --grav-co-grp-b-accent-attention: #4d4848;<br>  --grav-co-grp-b-accent-danger: #4d4848;</pre><pre>  <strong>background: var(--grav-co-grp-a-neutral);<br>  color: var(--grav-co-grp-b-neutral);</strong><br>}</pre><p>We also define a number of utility classes that use the exact same structure. These can be applied to any container and will set the colour scheme for that container and any UI components within:</p><pre><strong>.grav-u-color-scheme-teal-black</strong> {<br>  --grav-co-grp-a-neutral: #000;<br>  --grav-co-grp-a-neutral-alt: #262626;<br>  --grav-co-grp-a-accent: #000;<br>  /* ... */</pre><pre>  --grav-co-grp-b-neutral: #ccc;<br>  --grav-co-grp-b-neutral-subtle: #999;<br>  --grav-co-grp-b-neutral-emphasis: #e6e6e6;<br>  /* ... */</pre><pre>  <strong>background: var(--grav-co-grp-a-neutral);</strong><br>  /* Setting color here is redundant, since<br>     it is inherited from :root */<br>}</pre><p>However, we still use SASS to author our CSS, so we create some functions and mixins to simplify repetitive tasks. One example is applying a colour to a CSS property. Although CSS custom properties are very widely supported nowadays, some older browsers — notably all Internet Explorers, up to and including IE11, do not support them. We therefore took the view that using multiple colour schemes on the same page was a progressive enhancement. In IE (or anything else lacking support for custom properties) the fallback would be to use a single colour scheme across the whole page. In CSS we can achieve this with the following pattern:</p><pre>.something {<br>  /* Set fallback colour value from<br>     page&#39;s default color scheme: */<br>  color: <strong>#000</strong>;</pre><pre>  /* Then override using custom prop */<br>  color: <strong>var(--grav-co-grp-b-neutral)</strong>;<br>}</pre><p>You can see how typing that out over and over would be tedious, so we made a mixin that takes the desired colour purpose and CSS property to apply it to, and then generates those 2 declarations:</p><pre>.something {<br>  @include <strong>grav-color-apply(&#39;color&#39;, &#39;b&#39;, &#39;neutral&#39;);</strong><br>}</pre><p>This mixin will also make it easier for us to remove the fallback code in the future, if we ever feel there’s no more value in continuing to support very old browsers.</p><h3>The end result</h3><p>Putting all the pieces together, Gravity now has a robust and extensible colour system that:</p><ul><li>Is implemented in pure CSS</li><li>Decouples colour schemes from the application of colours to UI components (allowing new UI components and new colour schemes to be developed independently)</li><li>Is progressive enhancement from a simpler version of the UI</li><li>Ensures accessible colour contrast ratios throughout the UI, regardless of which colour scheme is in use</li><li>Allows different parts of a page to be coloured using different colour schemes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rDyJ4XG-Fwc3SKcciXlGuw.gif" /><figcaption>Animated diagram showing how UI components are colored using the group A &amp; B purposes and the effect of different color schemes setting the values of those color purposes.</figcaption></figure><p>The video below demonstrates this in action. Recoloring parts of a page (or even the entire page) is as simple as adding a single class to the parent element!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FIKySoCKG-7M%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIKySoCKG-7M&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FIKySoCKG-7M%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b940b5edcb0385db46957329a0bb970/href">https://medium.com/media/2b940b5edcb0385db46957329a0bb970/href</a></iframe><p>While there’s plenty of prior art of using CSS custom properties for colouring a UI, we do believe the grouping and associated accessibility constraints are unique to Gravity. If others have made similar things, we’d love to hear about it and compare notes. For everyone else, we hope this write-up provides some useful ideas and inspiration that you can use in your own work!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a41cf3fbf443" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn to walk before you run]]></title>
            <link>https://medium.com/@cirrus/learn-to-walk-before-you-run-824bd0387c1c?source=rss-955b936dab83------2</link>
            <guid isPermaLink="false">https://medium.com/p/824bd0387c1c</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[overengineering]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[James Nash]]></dc:creator>
            <pubDate>Thu, 11 Jul 2019 12:56:30 GMT</pubDate>
            <atom:updated>2019-07-11T17:31:07.533Z</atom:updated>
            <content:encoded><![CDATA[<p>Front-end web developers have a vast, amazing and constantly changing set of tools, approaches and frameworks available to them. Many therefore feel pressured to keep up with the latest and greatest. Are we all condemned to participate in this never-ending rat race though?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fDsmN4AIJIPNqdz636PZbw.jpeg" /><figcaption>Crowds rushing across Shibuya crossing in Tokyo. <a href="https://unsplash.com/photos/XjElJwfg_r4">Photo</a> by <a href="http://www.emranyousof.com/">Emran Yousof</a>.</figcaption></figure><p>The world of web design and development often makes me think of time-lapse scenes from TV documentaries: Plants sprouting from the ground, growing up, flowering, wilting and crumbling back to the ground. Swarms of insects scurrying across the forest floor. Hundreds of people rushing across Tokyo’s Shibuya crossing when the lights turn green.</p><p>Everything is moving. Things coming and going constantly and always in a rush.</p><p>JS frameworks, CSS frameworks and build tools all feel like they’re in a constant state of flux. New techniques challenge the status quo. Factions form. Passionate debates rage.</p><p>Are we using React or Vue? Flow or TypeScript? SASS or LESS? Is it still Ok to use Bootstrap? Should we put our CSS in JS? Are we doing functional class names, semantic ones or no classes at all?</p><p>And yet. If you just stop, take a step back and look around, what do you see? The fundamentals haven’t changed nearly as much. Browsers still receive and process HTML, CSS and JavaScript, as they have always done. Our user interfaces are still made up of text, images and a handful of interactive controls such as links, buttons and input fields. Modern browsers still have back buttons, bookmarks and address bars — <a href="https://kottke.org/12/07/web-browsers-i-have-known-1994-2012">just as their ancestors did back in the 90’s</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*CiEIpUVswl0ivDIKiQLoFg.jpeg" /><figcaption>The Mosaic web browser, ca. 1994. <a href="https://kottke.org/12/07/web-browsers-i-have-known-1994-2012">Screenshot</a> by <a href="https://kottke.org/">Jason Kottke</a>.</figcaption></figure><p>If I were a betting man, I’d put money on those things still being true 10 or even 20 years from now. They will of course be more feature-rich and capable than they are today. We’ll probably be delivering HTML8, CSS6 and ES2039 code to our browsers — but I suspect the roles of each and the interplay between them will be very similar to how it is today and how it always has been.</p><p>Likewise, I would bet that React, Angular and Vue will have been superseded by newer frameworks many times over in that timespan. So too will Material UI, Bootstrap, Foundation, Tailwinds and their friends. The browsers themselves aren’t immune either. Chrome, Safari and Firefox could easily be relics of the past, just as Netscape and IE are today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*93hTIeb6iXIYeuxHCxwxWQ.jpeg" /><figcaption>Browsing the web in VR using <a href="https://developer.samsung.com/internet#gearvr-overview">Samsung Internet</a>. It’s still got buttons, menus and icons!</figcaption></figure><p>However, I believe the fundamental UI building blocks and principles we have today (and have had for decades) will still be widely used. Our buttons may be rendered as floating, 3D objects in a mixed reality view — but they’ll still be a thing we prod in order to trigger an action. No doubt some new controls, gestures and conventions will join the fold but they’ll arrive and establish themselves very gradually.</p><p>It’s wonderful that we have teams out there pushing the boundaries, exploring new ideas and ways of doing things is essential for progress. We all learn and benefit from their successes and from their failures. The ideas and techniques that survive eventually get commoditised and standardised.</p><p>Before the DOM APIs had document.querySelector(), we had<a href="https://jquery.com/"> jQuery</a>. Before CSS Grid came along, we had to (mis)use CSS float or flexbox to approximate the desired layouts. Until &lt;dialog&gt; is broadly supported, we‘ll need to make do with the <a href="https://micromodal.now.sh/">countless</a> <a href="https://material-ui.com/components/modal/">custom</a> <a href="https://foundation.zurb.com/sites/docs/reveal.html">modal</a> <a href="https://getbootstrap.com/docs/4.0/components/modal/">dialog</a> libraries that are out there.</p><p><em>But</em>, the bleeding edge can be riddled with trade-offs. It might be exciting, but <a href="https://caniuse.com/">is it widely supported</a>? <a href="https://webaim.org/projects/million/">Is it accessible</a>? <a href="https://royal.pingdom.com/webpages-are-getting-larger-every-year-and-heres-why-it-matters/">Is it performant</a>? Does it still work in <a href="https://kryogenix.org/code/browser/everyonehasjs.html">less than ideal conditions</a>?</p><p>Often times new ideas need time to prove themselves, have their kinks ironed out, get all the edge cases covered and finally mature into something reliable enough for the rest of us to depend on.</p><p>Let the early adopters duke it out. Let things mature and the dust settle.</p><p>I’m not saying this to knock the advanced frameworks, tools and techniques we have today. I regularly use and am quite fond of many of them myself. Used appropriately, they solve real problems and offer tremendous benefits — especially for complex projects.</p><p>I say this to offer some perspective and, perhaps, a little hope to those feeling a bit overwhelmed by it all.</p><p><strong>Just because something new exists, it doesn’t mean we have to all use it immediately</strong>. Just because your existing tech stack is no longer the most popular or trendy, doesn’t mean you need to rewrite it all right now. If your current design and technology choices are meeting your needs and those of your users, you can afford to bide your time. There is absolutely no shame in that.</p><p>Likewise, if you currently use a “simple” solution and it’s working for you, then try to resist the tempatation of adding tools or migrating to sophisticated frameworks unless they solve a real problem for you. You might believe doing so now will set you up for the future when your product grows and becomes more complex, but more often than not you’ll simply end up overengineering things. Focus on the problems you actually have, not the ones you <em>might</em> have later on.</p><p>I think this attitude is especially pertinent when you consider styling and laying out the UI itself. Let’s be honest with ourselves, <strong>most user interfaces are pretty mundane</strong>: Text, images and video to convey information to the user. Links, inputs fields and controls to gather input from them. It rarely gets any more exotic than that.</p><p>Sure, we may enhance them with beautiful layouts, delightful microinteractions, thoughtful offline features and more. But, more often than not, the core of your experience boils down to those basic building blocks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WKxrVo8k_jWMTRcqmgqXkA.jpeg" /><figcaption>PhotoShop 4 (ca. 2006) vs PhotoShop CC 2019–23 years apart, but both UIs are made up of the same basic UI elements.</figcaption></figure><p>You know what, though? I’m fine with that! Most of the time, mundane is good. Mundane doesn’t confuse people. Mundane is dependable. My parents can use mundane.</p><p>Before you reach for heavy-duty frameworks and toolchains, 3rd-party plugins or off-the-shelf components and templates to construct some run-of-the-mill UI layouts or components, ask yourself if there’s a leaner, simpler way. For every project that <em>really</em> needs sophisticated libraries and the very latest web platform features, I bet there are hundreds more that are little more than glorified forms or static content pages with simple logic.</p><p>For all the benefits that tools and libraries bring, there are also costs and risks associated with them.</p><p>If we are not careful with our technology choices we might inadvertantly steepen the learning curve for new colleagues and collaborators. At best, this lengthens the time it takes to onboard them. At worst, it will alienate them completely.</p><p>The <a href="https://www.wired.com/story/computer-science-graduates-diversity/">lack of diversity in tech jobs</a> is a serious and well documented problem. There are many causes for this and it’s a complex problem to solve. But, <strong>expecting people to have experience of a laundry list of acronyms and buzzwords before they can even work on the simplest of projects certainly doesn’t help</strong>. Especially for newcomers — be they people at the start of their careers or professionals from other industries that are trying to transition into web development.</p><p>Often times, tools and frameworks that make our lives as developers easier also come at a cost to our users. They can lead to increased amounts of data to download that can <strong>take longer to load</strong> (and thus deteriorate the overall user experience) or <a href="https://www.forbes.com/sites/niallmccarthy/2019/03/05/the-cost-of-mobile-internet-around-the-world-infographic/#611e4220226e"><strong>cost them more money</strong></a>. By doing more computations on our users’ devices we might also be <strong>draining their batteries</strong> more quickly (again, not good for the UX!) and <strong>increasing our </strong><a href="https://www.websitecarbon.com/"><strong>website’s carbon footprint</strong></a>.</p><p>I fear there is another, perhaps more insidious, problem with our industry’s lust for new, shiny things: We might be raising a generation of web developers that are overly dependent on high-level frameworks because they never learned the basics.</p><p>Imagine you’re a newcomer to web development. So many job specs seem to demand deep knowledge of frameworks. So many tutorials and bootcamps place an emphasis on frameworks without ever delving into the fundamentals of HTML, CSS and JavaScript.</p><p>Is this leading to a vicious circle where products we ship to users get ever more over-engineered and consequently increasingly deteriorate some aspects of those users’ experiences? As the old saying goes: “If all you have is a hammer, everything looks like a nail”. So, if all you know is, say, React then perhaps every problem looks like a React problem.</p><p>Using React (and Redux and Styled Components and, and, and…) for a complex web application with a highly dynamic UI is fine. That’s what it was designed to do. But, does your internet banking’s statement screen (which, let’s face it, is essentially a table of data) need all the overhead of React to render a simple &lt;table&gt; element? Does your personal homepage that is little more than a paragraph of text and some pictures need it? What about the blog or news site you’re working on? Whichever way you build it, it’s still just text and pictures. Maybe the comments section is interactive — but you know what, we were building those back in the days of Perl and cgi-bins and they had just as much functionality as they do now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdJtUBZ1YpE2AfAQDd48JA.jpeg" /><figcaption>Facebook’s new design, <a href="https://newsroom.fb.com/news/2019/04/f8-2019-day-1/#facebook">unveiled at their F8 2019 conference</a> versus the “<a href="https://www.phpbb.com/customise/db/mod/kiss_portal_engine/">Kiss Portal Engine</a>” mod for <a href="https://www.phpbb.com/">phpBB</a>. Are they <em>really all that different from the perspective of the user?</em></figcaption></figure><p>If you are currently stressing about which framework to learn, which tech stack to build your application or what aesthetic trend to follow, then I urge you to take a deep breath and pause for a moment.</p><p>My advice is: <strong>Focus on the fundamentals first.</strong></p><p>If you haven’t already, learn HTML. And I don’t mean how to create an empty index.html that loads a JS file. I mean <em>really</em> learn HTML. Explore the tags and attributes that HTML5 provides — especially the obscure ones. What does a &lt;dl&gt; do? What’s the difference between the &lt;picture&gt; element and srcset attribute? If you’re new to this, why not build yourself a little website using just HTML. Try it on different devices. Try it in reader mode. Try it in a terminal browser. Try it with a screen reader — perhaps you’ll get curious about <a href="https://developer.mozilla.org/en-US/docs/Learn/Accessibility/WAI-ARIA_basics">ARIA attributes</a> and go down that rabbit hole. Get Google to crawl it and use their <a href="https://search.google.com/search-console/about">search console</a> to see how much they could extract from it — perhaps you’ll get curious about linked data and <a href="https://www.w3.org/TR/rdfa-primer/">RDFa</a>. Share it on social media — perhaps <a href="http://ogp.me/">OGP tags</a> will pique your interest.</p><p>You might be surprised just how much functionality you get “for free” with a few humble tags and attributes! Armed with this knowledge, you will be better equipped to dive into CSS and JavaScript.</p><p>Then spend some time with plain CSS to the point where you can take a design idea in your head and bring it to life in the browser. Only then start delving into frameworks, pre and post-processors, different architectures, CSS-in-JS solutions and so on. Again, you’ll be able to assess, compare and learn them far quicker. You’ll appreciate them and make informed decisions about when and when not to use them.</p><p>Finally, learn plain (aka “vanilla”) JavaScript to the point where you can build a working app with it. Only then start delving into React, or Vue, or whatever happens to be in vogue. You’ll pick them up quicker. You’ll find it easier to learn another, which you will inevitably need to. You’ll also appreciate them much more. You’ll know when to use them and, just as importantly, when <em>not</em> to use them, because you’ll understand what problems they are designed to solve and what problems they don’t.</p><p>In other words: <strong>Learn to walk before you run!</strong></p><p>Yes, boundaries should be pushed. Yes, age old “best practices” should be scrutinised and challenged. Yes, we should commodotize and re-use good solutions to common problems.</p><p>But, there is a time and a place for all of that. And, it’s not all the time and in every place. I doubt it’s even most of the time and most of the places.</p><p>Maybe it’s time we all stepped back, took a deep breath and just relaxed<em> </em>a little!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3zD-Xdfos--SFS1yq-R1BA.jpeg" /><figcaption><a href="https://unsplash.com/photos/nnYk4ZhFiJI">Photo</a> by <a href="https://www.britozourdesign.com/">Briana Tozour</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=824bd0387c1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hardcore CSS calc( )]]></title>
            <link>https://medium.com/@cirrus/hardcore-css-calc-bdfb0162993c?source=rss-955b936dab83------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdfb0162993c</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[James Nash]]></dc:creator>
            <pubDate>Sat, 01 Sep 2018 13:01:01 GMT</pubDate>
            <atom:updated>2019-04-24T22:32:50.566Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RaPvPuIz-REyTyZo4OKzMQ.jpeg" /></figure><p>Sometimes things seem complex in a design but turn out to be easy to implement in code. Other times, elements of a design that appear simple at first glance turn out to be very tricky to implement.</p><p>This is the story of one of the latter cases…</p><h3>The challenge</h3><p>A couple of years ago I was tasked with implementing a web page featuring an arrangement of images like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*fzFY9YUGJSTFudgywhyGJw.png" /></figure><p>The designer had diligently redlined all the dimensions. Even more helpfully, as we’ll soon see, they also indicated the aspect ratio of the images — 4:3 for all three of them.</p><p>Additional relevant design details for this particular project were as follows:</p><ul><li>The 20px gutter between the images was a standard gutter size that was used in many places throughout the website’s design</li><li>The image files served up by our CMS were guaranteed to have a 4:3 aspect ratio, as they were being cropped server-side</li><li>This was a responsive website design, so <a href="http://unstoppablerobotninja.com/entry/fluid-images">images were fluid</a> — i.e. they scaled up or down to fit the horizontal space they were given</li></ul><p>Armed with that knowledge, I suspected that the <em>intended</em> responsive design behaviour was as follows:</p><p>As the <a href="https://www.quirksmode.org/mobile/viewports.html">viewport</a> width changes…</p><ul><li>the gutters between the images should remain <em>fixed</em> at 20px</li><li>the images should <em>scale up or down proportionally</em>, retaining their aspect ratio</li><li>the grid-like arrangement of the images should always be maintained</li></ul><p>Clear as mud? Fear not! Here’s an animated demo to illustrate how this block of three images should scale up or down:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*M4jPokDWoRFwUSCvrP-FJw.gif" /><figcaption>Fixed gutters, but fluid images</figcaption></figure><p>A quick conversation with the designer confirmed my assumptions. This was indeed the behaviour they had envisaged.</p><h3>The trouble with redlines</h3><p>For the purpose of writing the CSS code, the pixel image dimensions shown by the design’s redlines were useless. They would only ever work in scenarios where the user’s viewport happened to match the designer’s canvas size — for any other viewport size they were incorrect. In all likelihood, the designer had laid out the images as desired and <em>then</em> measured them for the annotations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*rdMcxL4wh-tTEK-tvEV_QA.png" /><figcaption>Aside from the fixed gutters, all other width and height measurements were variable and thus unpredictable</figcaption></figure><p>This is by no means a critique of the designer. As a developer, I’d much rather have some measurements than none. The trick is understanding which ones to take literally and which others need to be taken with a healthy dose of salt.</p><p>As a brief aside, I see a lot of tools nowadays that aim to automate or simplify the handover of visual designs to developers. A common feature is the ability to automatically extract and measurements from visual designs and expose them via redlines or some kind of inspector tool. <a href="https://zeplin.io/">Zeplin</a> and <a href="https://www.invisionapp.com/">InVision</a> are perhaps the best known examples, but there are plenty more tools that do this.</p><p>However, regardless of whether measurements were done manually or automatically, care must be taken when interpreting those values. Absolute pixel numbers are rarely and adequate description of the designer’s <em>intent</em>. At the end of the day, there’s no substitute for a regular dialogue between designers and developers.</p><h3>Applying maths</h3><p>Positioning the images wasn’t an issue —some floats here and some margins there would get the job done. Considering that the images had predictable aspect ratio, I only needed to set their widths, because the default height value of auto would ensure they scaled proportionally, preserving their aspect ratio. The only question therefore was:</p><blockquote>What, exactly, were the widths of the images?</blockquote><p>At this point, some dusty, old brain cells at the back of my brain creaked into action. This was just like a maths exercise at school. What I had here was a set of equations that I could solve for my width values!</p><p>First, I labelled the various lengths in the design:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*GMd18RqtRZ1Iih5OUu0z6Q.png" /></figure><ul><li><strong><em>a</em></strong><em>w</em> : Aspect ratio width</li><li><strong><em>a</em></strong><em>h</em> : Aspect ratio height</li><li><strong><em>w</em></strong><em>1</em> : Large image’s width</li><li><strong><em>h</em></strong><em>1</em> : Large image’s height</li><li><strong><em>w</em></strong><em>2</em> : Small images’ width (note that both small images have the exact same size)</li><li><strong><em>h</em></strong><em>2</em> : Small images’ height</li><li><strong><em>m</em></strong> : Margin between images</li></ul><p>Looking at the diagram, there were a few simple relationships I could begin to express as formulas.</p><p><strong>1)</strong> The width of the large image + the margin + the width of the small images was equal to 100% of the design’s width:</p><p><strong><em>w</em></strong><em>1</em> + <strong><em>m</em></strong> + <strong><em>w</em></strong><em>2</em> = 100%</p><p><strong>2) </strong>The height of both small images + the margin was equal to the height of the large image:</p><p>2 × <strong><em>h</em></strong><em>2</em> + <strong><em>m</em></strong> = <strong><em>h</em></strong><em>1</em></p><p><strong>3) </strong>The width of the large image divided by the aspect ratio width, multiplied by the aspect ratio height was equal to its height:</p><p><strong><em>w</em></strong><em>1</em> / <strong><em>a</em></strong><em>w</em> × <strong><em>a</em></strong><em>h</em> = <strong><em>h</em></strong><em>1</em></p><p><strong>4) </strong>The small images’ widths had the same relationship to their heights:</p><p><strong><em>w</em></strong><em>2</em> / <strong><em>a</em></strong><em>w</em> × <strong><em>a</em></strong><em>h</em> = <strong><em>h</em></strong><em>2</em></p><p>Now the hard work of solving for <strong><em>w</em></strong><em>1</em> began (and then for <strong><em>w</em></strong><em>2</em>). I began by substituting formulas 3) and 4) for <strong><em>h</em></strong><em>1</em> and <strong><em>h</em></strong><em>2</em> respectively in formula 2), and then solving it for <strong><em>w</em></strong><em>2</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CauosROXj0vrWRZw4qQlGQ.jpeg" /><figcaption>Please excuse my scruffy handwriting!</figcaption></figure><p>Then, I could substitute the result of that for <strong><em>w</em></strong><em>2</em> in formula 1), and solve it for <strong><em>w</em></strong><em>1</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQCFnzDounttnJXtmJ44Uw.jpeg" /><figcaption>I think I can see now why my teachers always used to complain about my handwriting!</figcaption></figure><p>Hurrah! I now had a formula that precisely calculated the width of the large image purely in terms of constant values —all things I’d be able to plug into a CSS calc() expression.</p><p>Note the expression at the end that I circled in red. It only contains the margin, the aspect ratio width and aspect ratio height — none of which will ever change at runtime. It is therefore a constant value that we can pre-calculate at build time. For convenience, I named this constant value <strong><em>c</em></strong>:</p><p><strong><em>c</em></strong> = (<strong><em>m</em></strong> × <strong><em>a</em></strong><em>w</em>) / (<strong><em>a</em></strong><em>h</em> × 3)</p><p>Returning to the original formula 1) and substituting <strong><em>w</em></strong><em>1</em> with the above result, provided me with the corresponding <strong><em>w</em></strong><em>2</em> value:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uf1lcB5694lKShAGHrCVJA.jpeg" /><figcaption>I dread to think what a graphologist would make of this!</figcaption></figure><p>At long last, I had my two width values:</p><p><strong><em>w</em></strong><em>1</em> = 2/3 × (100% − <strong><em>m</em></strong>) + <strong><em>c</em></strong></p><p><strong><em>w</em></strong><em>2</em> = 1/3 × (100% − <strong><em>m</em></strong>) − <strong><em>c</em></strong></p><h3>Coding time</h3><p>At long last I was ready to write some code! I always like to start with the markup. In this case, it’s pretty simple. We have three images in some kind of container. For the site I was working on, the images happened to be thumbnail previews for a photo gallery, so I chose a &lt;div&gt; with a class name thumbnails:</p><pre>&lt;div class=&quot;thumbnails&quot;&gt;<br>  &lt;img src=&quot;...&quot; alt=&quot;...&quot;&gt;<br>  &lt;img src=&quot;...&quot; alt=&quot;...&quot;&gt;<br>  &lt;img src=&quot;...&quot; alt=&quot;...&quot;&gt;<br>&lt;/div&gt;</pre><p>As mentioned before, the constant <strong><em>c</em></strong>, which appears in both image width formulas, is a good candidate to be pre-calculated. I’ll show how you can do it in SASS, but this could just as well be any other pre-processor (or you could work it out by hand and write the value into your CSS code):</p><pre>// Using values from the original design<br>$margin: 20px;<br>$aspect-width: 4;<br>$aspect-height: 3;</pre><pre>// Calculate c<br>$constant: <strong>($margin * $aspect-width) / ($aspect-height * 3)</strong>;</pre><p>Now all that’s left is to set the width on the images and arrange them. I’m going to use float to arrange them because it’s sufficient in this case and well supported in browsers dating back many years.</p><p>The width formula has to be worked out <em>at runtime</em> by the browser, because we have no way of knowing what our user’s viewport size will be and thus can’t pre-calculate what 100% of our &lt;div class=&quot;thumbnails&quot;&gt; equates to. For this reason we need to use <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/calc">CSS </a><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/calc">calc()</a>.</p><p>Since we’re using SASS, <a href="https://webdesign.tutsplus.com/tutorials/all-you-ever-need-to-know-about-sass-interpolation--cms-21375">we need to use </a><a href="https://webdesign.tutsplus.com/tutorials/all-you-ever-need-to-know-about-sass-interpolation--cms-21375">#{...} interpolation</a> when inserting our SASS variables into the formula. Otherwise SASS treats the variables as though they were strings and outputs them into the CSS rather than their values (see the difference in this <a href="https://www.sassmeister.com/gist/eed67a8f9d7a7ed733283bf6796f38a2">SassMeister example</a>).</p><p>Putting it all together, we get:</p><pre>.thumbnails {<br>  // Use a simple clearfix technique to ensure<br>  // that this element&#39;s height expands to wrap<br>  // the floated images within it.<br>  overflow: hidden;<br>  <br>  <br>  // First image becomes big one on left<br>  &gt; *:first-child {<br>    display: block;<br>    float: left;<br>    margin-right: $margin;</pre><pre>    // Magic formula!<br>    <strong>width: calc( (2 / 3 * (100% - #{$margin}) ) + #{$constant} );</strong><br>  }</pre><pre>  // 2nd &amp; 3rd images become smaller ones<br>  // on right<br>  &gt; *:nth-child(n + 2) {<br>    display: block;<br>    float: right;</pre><pre>    // Magic formula!<br>    <strong>width: calc( (1 / 3 * (100% - #{$margin}) ) - #{$constant} );</strong><br>  }</pre><pre>  // 3rd image also has top margin<br>  &gt; *:nth-child(3) {<br>    margin-top: $margin;<br>  }<br>}</pre><p>Now, for the moment of truth. Did all our hard calculations pay off? Does it work?</p><p>Of course it does! 😄</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fembed%2Fpreview%2FZBBZZO%3Fheight%3D600%26slug-hash%3DZBBZZO%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fpen%2FZBBZZO%3Feditors%3D1100&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F548984.ZBBZZO.small.84be2046-4a55-40a9-9ce7-35431e803dfc.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/9198ae2afbd48a721a7582016cf12c38/href">https://medium.com/media/9198ae2afbd48a721a7582016cf12c38/href</a></iframe><p>Resize that beauty all you want — you can’t break the layout. The images will always align themselves perfectly!</p><p>Boom! Mic drop.</p><h3>Conclusion</h3><p>Obviously this is a very specific layout. If you’re faced with exactly the same challenge, then by all means use this code! However, what I hope is a more useful takeaway is the <em>approach</em> that I used:</p><ol><li>Make sure you <strong>fully understand</strong> how<strong> the design</strong> should behave (take pixel measurements with a pinch of salt— the underlying <em>ratios</em> are often much more important!)</li><li>Figure out <strong>which values are fixed</strong> upfront (in this example that’s the common aspect ratio and the margin)</li><li>Figure out <strong>which ones are variable </strong>and thus need to be calculated at runtime (unless they are plain percentage values, this is where you’re likely to need calc())</li><li><strong>Look for relationships</strong> between sizes or values in your design that you can express mathematically</li><li><strong>Simplify</strong> things as far as you can</li><li><strong>Code</strong> it!</li></ol><p>I’d love to see what tricky layouts, arrangements or effects you’ve managed to pull off with CSS calc() and some maths! Please share them and tell us all how you pulled it off!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdfb0162993c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Tale of Two Buttons]]></title>
            <link>https://medium.com/@cirrus/a-tale-of-two-buttons-e63185aefd5f?source=rss-955b936dab83------2</link>
            <guid isPermaLink="false">https://medium.com/p/e63185aefd5f</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[ui-design]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[design-systems]]></category>
            <dc:creator><![CDATA[James Nash]]></dc:creator>
            <pubDate>Mon, 13 Aug 2018 15:09:04 GMT</pubDate>
            <atom:updated>2018-08-30T22:18:58.735Z</atom:updated>
            <content:encoded><![CDATA[<p>Much ink has been spilled about different approaches to styling UI elements on web pages and apps. The prevailing wisdom is for designers and developers to approach UI design and development in a modular way. While I wholeheartedly agree with this mindset (and have been <a href="https://wiprodigital.com/2016/03/17/implementing-atomic-design-at-wipro-digital/">advocating it for a long time</a>), I fear that it is sometimes mistakenly used as an argument for avoiding one of CSS’s most powerful features: The cascade.</p><h4>Modular UI code</h4><p>In terms of ease of development and maintainability it makes a lot of sense to group the code that a UI component is comprised of. Typically that is the code that defines what DOM elements the component is rendered as, the code that determines how those elements are visually styled and the code that deals with any interactive behaviour (such as responding to clicks or changes in content). Often there will also be some accompanying test code and documentation.</p><p>Modularising code into re-usable, easy to maintain, decoupled chunks like this is second nature to software developers. They don’t only do it for UI code — they do it for <em>everything</em>. It’s why programming languages have evolved to give us things like functions, objects, modules, libraries and so on.</p><p>Against that backdrop, it’s easy to see why CSS’s global and cascading nature may feel alien and counter-intuitive to many software developers. Unless you say otherwise, a lot of your component’s styling attributes are <em>inherited</em> from its parent elements. For instance, if you don’t explicitly say what colour your headings should appear in, they will take on whatever text colour their parent has. Those parents in turn may also be inheriting the colour and this continues all the way up, until you hit the root &lt;html&gt; element.</p><p>From the perspective of an individual component, taken out of context, that may seem scary. You don’t control or know what colour (or font, or size, or whatever) it will appear in. How do you then ensure it matches the design? How do you test it?</p><p>Consequently people have created ever more elaborate means of isolating themselves from the dreaded cascade. I frequently read people claiming that CSS’s global and cascading nature doesn’t scale or that it somehow doesn’t work for complex applications.</p><p>Respectfully, I disagree. I am therefore writing this article to make the case <em>for</em> the cascade.</p><h4>A typical scenario</h4><p>To make my case, I’m going to work through a simple but also quite common example: Our good old friend and canonical example UI component, the button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*Nwx9AQwQFKDT-wr09Kfo2A.png" /><figcaption>The target button designs</figcaption></figure><p>To make things a little more interesting, lets imagine there are 2 variants of our button:</p><ul><li>A normal one, for when it sits on the page’s default, light background colour</li><li>An inverted one, for when it sits on sections with a dark background (perhaps in the page headers and footers)</li></ul><p>Other things to note about our design:</p><ul><li>The font size and family of the buttons is the same as for body copy</li><li>The light yellow (cornsilk) colour is the body’s default background colour</li><li>The dark red (darkred) colour is the default text colour for body copy</li></ul><p>In case you were wondering, <a href="http://contrast-grid.eightshapes.com/?background-colors=&amp;foreground-colors=%238B0000%2C%20darkred%0D%0A%23FFF8DC%2C%20cornsilk%0D%0A&amp;es-color-form__tile-size=compact">this colour combination passes WCAG 2.0 AAA guidelines</a>, so we can rest assured that these colour choices are not impeding accessibility.</p><h4>BEM-style classes</h4><p>Let’s have a go at styling this with CSS class following the popular <a href="http://getbem.com/">BEM convention</a>. We might then organise our button CSS as follows:</p><ul><li>A <strong>block</strong> class button for the default (dark) button style.</li><li>A <strong>modifier</strong> class button--inverted for the alternate (light) style when the button sits on a dark background.</li><li>For each, we also need to add some styles for the pressed (aka “active”) state of the button using the :active pseudo-class selector</li></ul><p>You can see an implementation of this in the <a href="https://codepen.io/cirrus/pen/zLMmXM">following Codepen</a>. In order to show the buttons in their intended context, they each been placed in &lt;div&gt; containers with container and container--inverted classes for the default and inverted backgrounds respectively.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fembed%2Fpreview%2FzLMmXM%3Fheight%3D600%26slug-hash%3DzLMmXM%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fpen%2FzLMmXM&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F548984.zLMmXM.small.78f76746-c667-4e54-a144-f7cc036591aa.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/8f560042fe4319e7eab11ea2c5989736/href">https://medium.com/media/8f560042fe4319e7eab11ea2c5989736/href</a></iframe><p>Everything looks as intended. All good, right?</p><p>There are however some improvements we can make. As it stands, we are relying on developers remembering to correctly apply the button--inverted modifier class whenever they place a button into a container with the darker background. Or, if the page design changes and we need to change the background of an area containing buttons, then we have the additional burden of changing all their class names.</p><p>If, instead of writing static HTML, you were using a JS framework like React to construct your DOM, then you’d most likely have a prop on your button component for switching to the inverted style. Something like:</p><pre>&lt;MyButton&gt;</pre><pre>&lt;MyButton <strong>inverted=&quot;true&quot;</strong>&gt;</pre><p>However, the same core issue remains: You are depending on developers who use your component (and/or CSS) code to know when to apply the inverted style.</p><h4>Contextual class</h4><p>What would be nice, is if our button simply adopted the desired styling automatically, based on where it is located on the page. We’d then no longer need the button--inverted modifier class (or React component prop, or other equivalent) and our button component would become foolproof.</p><p>Luckily, that’s easily done with a simple CSS descendent selector:</p><pre><strong>.button</strong> {<br>    /* Apply default button styles here */<br>}</pre><pre><strong>.container--inverted .button</strong> {<br>    /* Apply inverted button styles here */<br>}</pre><p>We are literally saying to the browser “when the button is inside a container that has the inverted styles, apply these styles to it”. You can see it in action, along with the full code, in the following Codepen. Note how only the selector has changed in the CSS, and the class button--inverted has been removed from the HTML.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fembed%2Fpreview%2FQBJzjo%3Fheight%3D600%26slug-hash%3DQBJzjo%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fpen%2FQBJzjo&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F548984.QBJzjo.small.086c628c-c531-4160-91cd-dbd6fcd34a71.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/c5061bb9c36d2f86ef5226b18ade525b/href">https://medium.com/media/c5061bb9c36d2f86ef5226b18ade525b/href</a></iframe><p>Another benefit of this approach is that, often, it will align better with designer’s mental model. It’s unlikely they’d have been thinking “I want to make X colour variants of my buttons”. Far more likely they would have been thinking “Sometimes buttons need to be placed onto the darker background. As it stand’s they’ll blend in with their surroundings and just look like plain text. I’d better make an alternate design for that scenario”.</p><p>Understanding the <em>intent</em> behind a UI design is always helpful for UI development. If, as a developer you can appreciate <em>why</em> things have been styled or laid out in a particular way, then you can often express the same intent in code and produce a better implementation as a result.</p><p>As I have written before, <a href="https://medium.com/buildit/wysiwyg-must-die-4c34055ea7d7">a good UI implementation must incorporate far more than simply how things <em>look</em></a> in the designer’s mock-ups. Achieving that requires close collaboration between designers and developers. Trying to understand each others’ train of thought goes a long way towards that end.</p><p>All that being said, I’m not advocating excessively long chains of descendent selectors in your CSS. Left unchecked, that sort of thing can quickly make your CSS code bloated and convoluted. However, intentionally encoding design intent as we are in this example, I believe is a perfectly acceptable use of descendent selectors. Like everything else in life: Use them in moderation!</p><h4>Exploiting inheritance</h4><p>Great! We now have a chameleon button that will change its colours based on where it is on the page. That’s good for ease of use (for other developers) and maintenance.</p><p>However, if we take a closer look at our CSS, there seems to be a fair bit of redundancy. The two colours get mentioned many times. We’ve also had to explicitly set our button’s font-size to match that of the page.</p><p>Let’s use CSS’s cascading powers to reduce our code! For starters, rather than setting an explicit font size for our button, we can simply inherit the font size from the parent element, using the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/inherit">inherit keyword</a>:</p><pre>.button {<br>  font-size: <strong>inherit</strong>;<br>}</pre><p>(Note that most HTML elements inherit their font-size by default, so you don’t need to write <em>any</em> CSS to get this behaviour. Buttons and inputs are amongst the exceptions, so that is why we need to explicitly tell them to inherit this property)</p><p>Now we have less redundancy in our code. The font size is only set on the body, so if we need to change it we only change it there and the button automatically follows suit. An added bonus is that our button’s font size will now always match its parent’s. Let’s imagine we place our button into an area of the page with with smaller font size, that button’s text will shrink to match!</p><p>We can use the same technique with the colours. While we can’t get around setting explicit colour value for the button’s default state, since border, background and text all differ from the parent, we <em>can</em> avoid it for the :active state. Let’s take a closer look at their current CSS code:</p><pre>/* The existing active state styles */</pre><pre>.button:active {<br>  color: <strong>darkred</strong>; /* This is the same as the body text color! */<br>  background-color: <strong>cornsilk</strong>; /* Same as the body bg! */<br>}</pre><pre>.container--inverted .button:active {<br>  color: <strong>cornsilk</strong>; /* Same as inverted container&#39;s text color! */<br>  background-color: <strong>darkred</strong>; /* Same as inverted bg! */<br>}</pre><p>Since all those colours match the values of their parent elements, we can replace the explicit values with inherit:</p><pre>/* Use the cascade, Luke! */</pre><pre>.button:active {<br>  color: <strong>inherit</strong>;<br>  background-color: <strong>inherit</strong>;<br>}</pre><pre>.container--inverted .button:active {<br>  color: <strong>inherit</strong>;<br>  background-color: <strong>inherit</strong>;<br>}</pre><p>Hmm… now our :active styles are exactly the same, regardless of whether this button sits in an inverted container or not. Let’s use that to our advantage and remove the now redundant .container--inverted .button:active block:</p><pre>/* Yipee! Less code */</pre><pre>.button:active {<br>  color: <strong>inherit</strong>;<br>  background-color: <strong>inherit</strong>;<br>}</pre><p>That’s the CSS taken care of. Let’s now take another look at our HTML. Using the button class on a button element in our HTML looks a bit silly, especially if we’re also using type=&quot;button&quot; for any non-submit buttons:</p><pre>&lt;!-- Yo dawg, I heard you like buttons... --&gt;</pre><pre>&lt;button <strong>class=&quot;button&quot;</strong> type=&quot;button&quot;&gt;</pre><p>If we replace our .button class selectors in the CSS with button element selectors, we can avoid having to use this redundant class in our HTML. Don’t be afraid of using element selectors in your CSS! It can be a <a href="https://alistapart.com/article/meaningful-css-style-like-you-mean-it">great way of encouraging the correct, semantic elements being used in the corresponding markup</a>.</p><p>You can see the result of putting it all together in <a href="https://codepen.io/cirrus/pen/WKYLoW">this Codepen</a>:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fembed%2Fpreview%2FWKYLoW%3Fheight%3D600%26slug-hash%3DWKYLoW%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fpen%2FWKYLoW&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F548984.WKYLoW.small.547dfcb4-1561-490a-ac08-28213b2b9653.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/83b8b7d5e3d4749c87a31e596d6b8856/href">https://medium.com/media/83b8b7d5e3d4749c87a31e596d6b8856/href</a></iframe><h4>Enhancing with custom properties</h4><p>At this point, we’ve got some succinct CSS code that will style &lt;button&gt; elements anywhere on the page in an intelligent, context-aware way. To do so, we’ve only used basic CSS features that have enjoyed broad browser support for a <em>long</em> time. Wonderful!</p><p>But, can we do better? Well, if we’re happy for only <a href="https://caniuse.com/#feat=css-variables">browsers that support CSS custom properties</a> (aka “CSS variables”) — which is most current browsers except Internet Explorer — to render the target design, then yes. We should of course aim to have a simpler fall back design for older browsers that we progressively enhance with the custom properties. However, for brevity, I’ll skip that in this example.</p><p>We’re going to use a similar approach to the one <a href="http://simurai.com/">Simurai</a> wrote about in his post “<a href="http://simurai.com/blog/2018/04/01/contextual-styling">Contextual styling with custom properties</a>”. Unlike, SASS or LESS variables, CSS custom properties can have their values overridden within the CSS cascade. Looking at our design, we only use 2 colours throughout: Our standard foreground colour, darkred, and our standard background colour, cornsilk. Let’s define some custom properties for them:</p><pre>:root {<br>  <strong>--fg-color: darkred;</strong><br>  <strong>--bg-color: cornsilk;</strong><br>}</pre><p>We then update our body styles to reference them rather than the explicit colour values:</p><pre>body {<br>  color: <strong>var(--fg-color)</strong>;<br>  background-color: <strong>var(--bg-color)</strong>;<br>}</pre><p>Our inverted container class is where it starts to get interesting. Here, we override the values of our custom properties, thereby also changing them for any child elements that reference those custom properties. Additionally, we use them to set the container’s colour and background colour as needed:</p><pre>.container--inverted {<br>  <strong>--fg-color: cornsilk;</strong><br>  <strong>--bg-color: darkred;</strong><br>  <br>  color: <strong>var(--fg-color)</strong>;<br>  background-color: <strong>var(--bg-color)</strong>;<br>}</pre><p>With all that set up, let’s return our attention to the button again. As it stands, we still have to set some default button colours and then override those values for buttons that reside within an inverted container:</p><pre>button {<br>  border-color: <strong>darkred</strong>;<br>  color: <strong>cornsilk</strong>;<br>  background-color: <strong>darkred</strong>;<br>}</pre><pre>.container--inverted button {<br>  border-color: <strong>cornsilk</strong>;<br>  color: <strong>darkred</strong>;<br>  background-color: <strong>cornsilk</strong>;<br>}</pre><p>Let’s swap these explicit colour values out for the corresponding custom properties:</p><pre>button {<br>  border-color: <strong>var(--fg-color)</strong>;<br>  color: <strong>var(--bg-color)</strong>;<br>  background-color: <strong>var(--fg-color)</strong>;<br>}</pre><pre>.container--inverted button {<br>  border-color: <strong>var(--fg-color)</strong>;<br>  color: <strong>var(--bg-color)</strong>;<br>  background-color: <strong>var(--fg-color)</strong>;<br>}</pre><p>Note how, for the button within an inverted container, --fg-color will resolve to cornsilk(and--bg-color to darkred), since we overrode those values in the .container--inverted class.</p><p>Would you look at that? Now the CSS blocks for both button variants is identical! Nixing the inverted block that we no longer need leaves us with:</p><pre>button {<br>  border-color: <strong>var(--fg-color)</strong>;<br>  color: <strong>var(--bg-color)</strong>;<br>  background-color: <strong>var(--fg-color)</strong>;<br>}</pre><p>The result of putting everything together is now visible in <a href="https://codepen.io/cirrus/pen/Zjmwrv">this Codepen</a>:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fembed%2Fpreview%2FZjmwrv%3Fheight%3D600%26slug-hash%3DZjmwrv%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fpen%2FZjmwrv&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F548984.Zjmwrv.small.5fece433-98f5-4f24-b7f6-584420be99ec.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/e24207da7bb961fc0f9843ab964122de/href">https://medium.com/media/e24207da7bb961fc0f9843ab964122de/href</a></iframe><p>As you can see, it is 100% visually identical to our original BEM-style solution. However, we now have:</p><ul><li>Buttons that adapt their colours and font-size to those of their parent elements</li><li>Cleaner, simpler markup</li><li>More succinct CSS code that will be quicker for our users to download</li></ul><p>Furthermore, if we wanted to have more container styles for different themes, it’s trivially easy to add them and our button component will continue to blend in <em>without us needing to modify any of its CSS</em>. If that’s not “scalable”, I don’t know what is.</p><p>Here’s a little example of this in action:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fembed%2Fpreview%2FbjZxGR%3Fheight%3D600%26slug-hash%3DbjZxGR%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;display_name=CodePen&amp;url=https%3A%2F%2Fcodepen.io%2Fcirrus%2Fpen%2FbjZxGR&amp;image=https%3A%2F%2Fscreenshot.codepen.io%2F548984.bjZxGR.small.5ba4c3c9-8220-4ac3-af28-10b0fcb2aff8.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/9711789d0b6c37b9beb252bb3d804bf5/href">https://medium.com/media/9711789d0b6c37b9beb252bb3d804bf5/href</a></iframe><h4>Conclusion</h4><p>The designs and examples used in this article are of course simple ones. Nonetheless, they have hopefully succeeded in demonstrating how <strong>deliberate use of CSS’s cascade can simplify and reduce the code</strong> that UI developers need to produce. You absolutely can extend this style of architecting and writing your CSS code to all kinds of UI components besides buttons.</p><p>Furthermore, and perhaps more importantly, I think <strong>embracing CSS’s cascade can be a great way to encourage consistency and simplicity in UIs</strong>. Rather than every new component being a free for all, it trains both designers and developers to think in terms of aligning with and re-using what they already have.</p><p>Remember, every time you set a property in CSS you are in fact overriding something (even if it’s just the default user agent styles). In other words, CSS code is mostly expressing <em>exceptions</em> to a default design. The more you do so, the more your UI components become sealed-off blocks of UI that don’t necessarily blend into or adapt to their surroundings.</p><p>Consequently, my approach tends to be to see how little CSS code I can get away with. I’ll start with just the markup I need and see how that renders. If something doesn’t look the way I need it to, I’ll first try to understand why. What computed values are my properties inheriting and from where? Should I override them, or is there parent element further up the inheritance chain that should be amended in some way? It’s just like the old adage says: “Measure twice, cut once”.</p><p>Once in a while I want to inherit things that, by default or due to styles inherited from some other part of my CSS code, aren’t. That’s where little gems like inherit, initial and <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/unset">unset</a> can work wonders.</p><p>If you’ve not approached your CSS in this way before, I highly recommend giving it a go. Hopefully you’ll be pleasantly surprised by how much redundant code you can remove and by the increased flexibility and adaptability it can afford your individual UI components.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e63185aefd5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Buildit's Gravity design system]]></title>
            <link>https://medium.com/@cirrus/introducing-buildits-gravity-design-system-44c3fe7a1d26?source=rss-955b936dab83------2</link>
            <guid isPermaLink="false">https://medium.com/p/44c3fe7a1d26</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[wipro-digital]]></category>
            <category><![CDATA[pattern-library]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[design-systems]]></category>
            <dc:creator><![CDATA[James Nash]]></dc:creator>
            <pubDate>Fri, 15 Jun 2018 09:21:14 GMT</pubDate>
            <atom:updated>2025-04-04T22:42:28.549Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introducing Buildit’s Gravity design system</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*49raKSRVoKieGUerqKbOew.jpeg" /><figcaption>(Original image credit: <a href="https://www.jpl.nasa.gov/spaceimages/details.php?id=pia16695">NASA / JPL-Caltech</a>)</figcaption></figure><p><strong>Note:</strong> The canonical version of this blog post is now: <a href="https://cirrus.twiddles.com/blog/2018/06/15/introducing-gravity-design-system/">https://cirrus.twiddles.com/blog/2018/06/15/introducing-gravity-design-system/</a></p><p>Please update any links or bookmarks to this post. Thanks!</p><p>To support the creation of our recently redesigned <a href="https://buildit.wiprodigital.com/">Buildit @ Wipro Digital website</a>, we have also created a nascent design system and its name is <strong>Gravity</strong>.</p><p>This is the story of how Gravity came to be and where it is headed next.</p><h3>The motivation</h3><p>Buildit has had a website and a small number of internal web applications for some time. All of them had been designed and built independently and consequently looked and behaved quite differently from each other. There was, therefore, a clear case for unifying their UI code to create consistency and reduce the amount of redundant code that needed to be maintained.</p><p>Furthermore, Buildit is a consultancy and, in case you hadn’t already noticed, we have been <a href="https://medium.com/buildit/our-atomic-journey-so-far-b333c98b1d3f">working with design systems for some time now</a>. We have helped our clients create everything from living style guides to full-blown design systems. Unfortunately, much of our work is covered by NDAs so we can’t publicly share details of what we’ve done.</p><p>However, by “practicing what we preach” we can:</p><ul><li>Create a case study we <em>can</em> share widely and thereby increase our design system credibility with clients</li><li>Test new techniques and ideas on our own time, without putting client work at risk</li><li>Create an environment for new and junior colleagues to learn about and explore design systems</li></ul><h3>The beginnings</h3><p>Work on our design system began in earnest in May 2017. There were a number of us who were in between client engagements and therefore had some spare time to work on this internal project.</p><p>We conducted some research and workshops to get a handle on what shape our design system should take to best serve its consumers.</p><h4>Tech stack research</h4><p>Buildit already had three projects that could potentially benefit from a design system: The Buildit website and two internal web apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ES_yv7WLKTHJa3YQkj6rpg.png" /><figcaption>Some of the questions from our questionnaire</figcaption></figure><p>We began by sending out a developer questionnaire, inspired by <a href="http://bradfrost.com/blog/post/frontend-guidelines-questions/">Brad Frost’s Frontend Guidelines Questions</a>, to those 3 teams. The results were interesting:</p><ul><li>The website used <a href="https://pugjs.org/api/getting-started.html">Pug templates</a> to creates static HTML. Styling was done in <a href="http://lesscss.org/">LESS</a> and made use of the <a href="https://semantic-ui.com/">Semantic UI</a> framework.</li><li>One of the apps was written in <a href="https://reactjs.org/">React.js</a> and had its styling code written in <a href="http://sass-lang.com/">SASS</a>.</li><li>The other app was written in <a href="https://angular.io/">Angular</a>. It’s styling was also written in SASS but built on <a href="https://getbootstrap.com/">Bootstrap</a>.</li></ul><p>They also differed in terms of their build tools, testing and coding conventions.</p><p>Thankfully though, all 3 teams indicated that they’d be willing to migrate towards a common UI library provided by the design system.</p><p>Based on these insights and some intense debate, we eventually settled on the following approach for our UI library:</p><ul><li>We’d <strong>build our own from scratch</strong> rather than theming an off-the-shelf one like Bootstrap or <a href="https://www.primefaces.org/">Prime Faces</a>. This was because we realised that the hands-on experience we’d gain by doing so was more valuable to us than quicker time to market or a more comprehensive set of components.</li><li>We’d initially only provide <strong>CSS (with SASS source code)</strong> as this could be used by all projects, regardless of their choice of JS framework or build tools.</li><li>We’d be <strong>opinionated about the HTML elements and attributes</strong> that should be used for components because we wanted to encourage good semantics and accessibility. We’d therefore use CSS element and attribute selectors as much as possible.</li><li>We’d <strong>use </strong><a href="https://csswizardry.com/2015/08/bemit-taking-the-bem-naming-convention-a-step-further/"><strong>BEMIT</strong></a><strong> conventions</strong> to organise our SASS code and name our class names.</li></ul><h4>Choosing a name</h4><p>“Buildit design system” is a bit of a mouthful. Not to mention dull. We decided early on that we wanted to give our design system a name. To get inspiration we enlisted the help of all of Buildit by creating an online suggestion form with two questions:</p><ul><li><em>What</em> should we call the design system?</li><li><em>Why</em> should it be called that?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BTpQ6E96JEQL7eWga8XZXw.png" /></figure><p>That form was then shared on a Buildit-wide Slack channel. We received a good number of responses from fellow Buildsters around the world. Here are a few interesting and amusing suggestions that were rejected:</p><ul><li>“Amnesty”, because it’s your get out of design hell free card when you implement it correctly</li><li>“Pangu”, the creator of all things in Chinese mythology</li><li>“Designy McDesignFace”</li><li>“Designsystemit”</li></ul><p>The one we liked best and ultimately chose was, of course, “Gravity”. Curiously, it was the only name to be suggested twice — independently as far as we know. Once by Simon Copsey and again by Greg “Hap” Pearman. Simon’s reason for suggesting “Gravity” was what ultimately swayed our decision though:</p><blockquote>It’s a natural force for bringing things closer together, similar to what we want to do with design + engineering.</blockquote><p>The naming exercise turned out to be quite fun. An unexpected benefit was that many people in Buildit became aware of Gravity and also felt at least somewhat involved.</p><h4>Design principles</h4><p>Successful design systems have a set of design principles to guide their work and decision making. Naturally, we wanted a set of our own.</p><p>We began by looking at other design systems’ principles and collating them in a table to look for commonalities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GFU5xJu7SOVjLoY-VWUowQ.png" /><figcaption>Excerpt from our big design system principles comparison table</figcaption></figure><p>Of the design systems we looked at, the most common principles centered around:</p><ul><li>Re-use</li><li>UI simplicity</li><li>UI usability</li><li>UI consistency</li><li>UI aesthetics</li></ul><p>Inspired by what others were doing, we eventually came up with this <em>initial</em> set of principles for Gravity:</p><ul><li><strong>Be useful</strong></li><li><strong>Don’t Repeat Yourself</strong></li><li><strong>Be universal</strong></li><li><strong>Be robust</strong></li><li><strong>Embrace each medium</strong></li><li><strong>Keep it tidy</strong></li></ul><p>We subsequently found that, while these were all good aspirations, some of them were weak as <em>principles</em>. Eventually we changed them, but we’ll cover that later in our story…</p><h4>UI inventory</h4><p>We then conducted UI inventories of our website and apps. Unsurprisingly, each app had a very different look and feel from the others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zmGWfD4dWcfb2yTiTJCouA.jpeg" /><figcaption>The team reviewing and collating components from the various UI inventories</figcaption></figure><p>Nonetheless, when we began to collate all the components, we did find some repetition of the same <em>kinds</em> of components. However, organising and naming the components proved to be highly contentious.</p><p>The output of this exercise was a list of components that Gravity would eventually need to provide so that our website and apps could migrate to it.</p><h3>The void</h3><p>With our research done, we were raring to go. We set up a git repository for our UI library, set up a PatternLab build to generate a live pattern library and then… we stalled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UpWtn-CeT0JEdhFso-bQtg.jpeg" /><figcaption>Nothing but tumbleweed (Photo credit: <a href="https://commons.wikimedia.org/wiki/File:Tumbleweed_rolling.jpg">Jez Arnold</a>)</figcaption></figure><p>Buildit is a consultancy. We make our money by helping our clients with digital transformation projects. We don’t make and sell our own products.</p><p>While we are intentionally given some amount of “bench time” between client projects to learn or support internal activities, paid client work will always take priority.</p><p>That’s what happened. We’d been using our bench time to get Gravity started but hadn’t secured any official funding from our leadership. Eventually, everyone involved was assigned to client projects and work on Gravity ground to a halt.</p><p>No surprise there. Many people have written about <a href="https://articles.uie.com/a-design-system-isnt-a-project-its-a-product-serving-products/">the need to treat a design system as a product</a>, i.e. something that is continuously developed and maintained. That’s never going to happen without proper funding.</p><h3>The resurrection</h3><p>In early December 2017, an internal project was kicked off to refresh the <a href="https://buildit.wiprodigital.com/">Buildit website</a>. Based on our experience with Gravity and also some other internal projects that people had done “on the side”, we insisted that this had to be run <em>properly</em>, just as though it was a client project. That meant that the team would be assigned to work on the website for a certain amount of time and could not be snatched away for other things.</p><p>Even though we were building a website, part of that was designing and developing a set of UI components. We therefore picked up Gravity’s mostly empty UI library and pattern library and fleshed them out just enough to build the website. To be honest, even if we hadn’t had Gravity, we still would have built a pattern library, because <em>that’s just how you make websites</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZH5oKMRnqSyjyDO5NiKkXQ.jpeg" /><figcaption>The relationship between the code for Gravity’s pattern library, UI library and Buildit’s website</figcaption></figure><p>In terms of design, we sketched on paper and whiteboards, tested some navigation flows with a clickable wireframe prototype in <a href="https://balsamiq.com/">Balsamiq</a> and did some visual design explorations in <a href="https://www.sketchapp.com/">Sketch</a> and <a href="https://www.adobe.com/illustrator/">Illustrator</a>. However, whatever artefacts we produced in those tools were ephemeral, <em>rough</em> drafts. <strong>As soon as we felt our ideas had matured enough, we implemented them in HTML &amp; CSS within our pattern library and then iterated and refined them in there.</strong></p><p>It was a conscious decision to get into the final medium as early as possible and “design in the browser”. We firmly believe that this approach…</p><ul><li>Is <strong>lean</strong>, since it eliminates the burden of keeping design artefacts in sync with the code</li><li>Allows us to make <strong>more informed design decisions</strong>, since we inspect and evolve our UI within an actual browser and therefore can test not just visual appearance, but also accessibility, performance, progressive enhancement, interactive behaviours and more</li><li><strong>Encourages consistency</strong>. Working within our pattern library (where we had used <a href="http://bradfrost.com/blog/post/atomic-web-design/">Atomic Design</a> to organise our components) made it easy to find and re-use existing components rather than adding redundant variations.</li><li><strong>Makes our design more systematic</strong>. Applying far-reaching changes, such as altering our colour palette or playing with the typographic scale, was trivially easy to accomplish — often as simple as changing the value of a SASS variable. Likewise, being able to zoom in on an individual component to make a very localised change and then zoom out to see the wider impact of that change on the overall look and feel helped us assess and maintain consistency and coherence in our designs as we went along.</li></ul><p>A consequence of this approach is that we do <strong>not</strong> have a complete or up-to-date representation of our components to use in design tools like Sketch. As it stands, we don’t feel the need to make one (and then have the burden of keeping it up to date).</p><p>And so, as a by-product of creating our website, we were able to also create and release an initial version of Gravity’s UI library. Finally, Gravity was taking shape! We now had a set of working, coherent, documented UI components that were in active use:</p><ul><li><a href="http://style.buildit.digital/">Gravity’s pattern library</a></li><li>Gravity’s <a href="https://www.npmjs.com/package/@buildit/gravity-ui-sass">UI library on NPM</a></li><li>Gravity’s UI library <a href="https://github.com/buildit/gravity-ui-sass">source code, docs and issues</a></li></ul><h3>The present</h3><p>Gravity now has enough substance that we’re finally comfortable to tell the world about it. However, we still consider Gravity to be a <em>nascent</em> design system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XAMLxRk1WbIjUShgFzt5wQ.jpeg" /><figcaption>Viewing the page header component within Gravity’s pattern library</figcaption></figure><h4>Developing a roadmap</h4><p>There’s a lot of documentation still to write. There are bugs to fix, things to enhance and, as we support projects beyond our website, there will be more components to add. Furthermore, in <a href="http://bradfrost.com/blog/post/the-workshop-and-the-storefront/">Brad Frost’s analogy</a>, what we have so far is mostly a “workshop”, but we’re still lacking a nice style guide website to act as Gravity’s “storefront”.</p><p>To that end, we have already begun building up a <a href="https://github.com/orgs/buildit/projects/4">backlog of ideas, enhancements and issues on Github</a>. With a bit of refinement and prioritisation that should provide us with a decent road map.</p><h4>Refining our principles</h4><p>While designing and building our UI components, we found that our initial set of design principles weren’t always helpful. We had hoped they would guide us when faced with tough decisions. For example, consider having to make a trade-off between better aesthetics or reduced code complexity for a UI component. Ideally, you want both. If that’s not feasible though, you need to prioritise one over the other — a good set of principles should inform that sort of decision in a consistent way.</p><p>On closer inspection, we concluded that our initial design principles had the following issues:</p><ul><li>Some were guidelines or best practices, but not opinionated enough to be a principle. For example, “Be useful”. Well <em>duh</em>! When would you ever <em>not</em> want to be useful?</li><li>Others overlapped a bit. “Don’t Repeat Yourself” and “Keep it tidy” for instance.</li></ul><p>Jared Spool has some great advice for <a href="https://articles.uie.com/creating-design-principles/">creating design principles</a>, and one of his tests stood out to us in particular:</p><blockquote>Is it Something You Might Reverse in a Future Release?</blockquote><p>“Be useful” certainly fails that test!</p><p>We therefore set about refining our design principles and eventually ended up with the following insight: Gravity needed clearly articulated <strong>goals</strong>, <strong>principles</strong> and <strong>guidelines</strong>. Furthermore, there was a relationship between them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oL-lbGYn7bVMiJO-_0ebtg.png" /></figure><ul><li>Principles should help us achieve the goals.</li><li>Guidelines should support or embody the principles.</li><li>While goals are fairly broad and abstract, guidelines are quite specific and concrete. Principles are somewhere in the middle.</li></ul><p>The more we thought about it, the more we realised that our principles could extend well beyond <em>just</em> the design aspects. They could and should influence how we maintain Gravity, how we approach technical aspects and more. We therefore dropped the “design” bit and now simply have Gravity’s <em>principles</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uEIdRnWNZ4nAvLTKDgCsMQ.jpeg" /><figcaption>Members of the Gravity team discussing the revised principles</figcaption></figure><p>This model helped us better organise our ideas and we ended up with:</p><p><strong>Goals:</strong></p><ul><li><strong>Education</strong> — Help Buildsters gain and refine experience of design systems</li><li><strong>Living case study</strong> — Continuously showcase Buildit’s design system expertise to clients and the wider Wipro organisation</li><li><strong>Low maintenance</strong> — We are not a product company. Therefore, funding for an in-house design system will always be a tough sell, so let’s make our lives as easy as we can</li><li><strong>Consistent Buildit look and feel </strong>— A basic raison d’être of any design system</li></ul><p><strong>Principles:</strong></p><ul><li><strong>Inclusive</strong> — Everything about Gravity, from the UI designs and components it provides to the way in which it is run and maintained should strive to be inclusive. That means removing barriers to entry for using or contributing to Gravity itself. That also means enabling products to be accessible to the broadest possible audience.</li><li><strong>Lean</strong> — Less is often more. Whether it’s reducing waste while working on projects, writing terse code, designing focussed UIs or just avoiding fluffy language when communicating, leanness is something we value at Buildit. Gravity should embody and support that as much as possible.</li><li><strong>Robust</strong> — There is a lot we <em>cannot</em> control when it comes to digital products. We can’t decide what device, operating system, browser or settings people use when interacting with our products. Neither can we predict what the future might hold. And yet, the products we build need to embrace that uncertainty and handle all the diverse use-cases gracefully and reliably. Robustness is therefore an important principle for us to consider in everything we do for Gravity.</li><li><strong>Considered</strong> — Everything about Gravity — be it design, tech or process — should exist for a reason. We should always be able to explain <em>why</em> something is the way it is. Wherever possible we should use data and research to drive our decisions. Failing that we should tap the experience and know-how of relevant experts. Finally, if something does boil down to a subjective decision, then we should note that and be prepared to revise it later if new information allows us to make a more informed decision.</li><li><strong>Progressive</strong> — Gravity is an opportunity for us to constantly try new things. New design directions. New technologies. New approaches towards designing and building user interfaces. We should take full advantage of this and strive to be a leader rather than a follower on all fronts.</li></ul><p>The work we have done to date mostly adheres to those principles. Some of the principles are a bit more aspirational right now. In any case, everyone who’s worked on Gravity is bought into these principles, so they are what we will follow from now on. That being said, as Jared Spool advocates, they are not set in stone forever — if the need arises, we <em>will</em> adapt and evolve our principles.</p><h4>Securing funding</h4><p>Perhaps most importantly, with Buildit’s refreshed website now live, we need to find new ways to fund continued work on Gravity.</p><p>Some new internal web projects are being worked on and they have agreed to use and, where needed, contribute back to Gravity. However, we know that longer-term Gravity cannot be entirely dependent on the generosity of other projects. It needs its own funding.</p><p>To that end, we are beginning to raise awareness of Gravity and its benefits within our organisation (this very article is a part of that effort!). We are also exploring other approaches and means to get our work sponsored, including scaling Gravity to serve other parts of Wipro beyond just Buildit.</p><p>All going well, we will have plenty more stories to tell about Gravity in the future. Watch this space!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44c3fe7a1d26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design System Architecture (TL;DR version)]]></title>
            <link>https://medium.com/@cirrus/design-system-architecture-tl-dr-version-1c9d84f35df4?source=rss-955b936dab83------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c9d84f35df4</guid>
            <category><![CDATA[style-guides]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[system-architecture]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[James Nash]]></dc:creator>
            <pubDate>Fri, 28 Apr 2017 22:45:30 GMT</pubDate>
            <atom:updated>2025-03-12T00:12:46.314Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Note:</strong> The canonical version of this blog post is now: <a href="https://cirrus.twiddles.com/blog/2017/04/28/design-system-architecture-tl-dr/">https://cirrus.twiddles.com/blog/2017/04/28/design-system-architecture-tl-dr/</a></p><p>Please update any links or bookmarks to this post. Thanks!</p><p><em>If my </em><a href="https://medium.com/@cirrus/design-system-architecture-a10e7b3aa30f"><em>full-fat post about Design System Architecture</em></a><em> is too long for your taste (Medium estimates it’s a 12 minute read), then you might prefer this summarised version…</em></p><p>At <a href="http://buildit.wiprodigital.com/">Buildit</a> we’ve done a fair amount of work on design systems. We’ve noticed certain types of tools and integrations between them recur and figured it would be useful to call them out.</p><p>This is the overall architecture for a design system’s infrastructure that we’ve observed and used. Not every design system will contain all of these parts. However, the ones they do have will likely be connected in the same way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T2-icI1wI1am-B6Y6lmRBg.jpeg" /><figcaption>Generic architecture of a design system’s infrastructure</figcaption></figure><h3>UI Library</h3><p>The <strong>UI library</strong> should be the “single source of truth” since it contains the actual implementations of the UI components. Note that in complex design systems you may have several of these (e.g. one for native iOS, one for native Android and one for Web). Likewise, you may (also) have hierarchies of them (e.g. a common CSS library for <em>all</em> web things, and then more specialised ones that extend it with components for a particular framework or CMS).</p><h3>Style Guide Generator</h3><p>Tools like <a href="http://patternlab.io/">Pattern Lab</a>, <a href="http://fractal.build/">Fractal</a> and <a href="https://storybooks.js.org/">StoryBook</a> that generate a living style guide from the code in your UI library.</p><h3>Package Managers &amp; Repos</h3><p>Tools like <a href="https://www.npmjs.com/">npm</a>, <a href="https://yarnpkg.com/">yarn</a> and <a href="https://www.sonatype.com/nexus-repository-sonatype">Nexus</a> that take care of packaging and distributing your UI library.</p><h3>Design Token Repository</h3><p>Tools to store, manage and export design tokens. Token data in JSON files being exported via <a href="https://github.com/salesforce-ux/theo">SalesForce Theo</a> is an example. Some larger tools like <a href="https://brand.ai/">Brand.ai</a> and <a href="https://frontify.com/">Frontify</a> incorporate design token repositories within them.</p><h3>Visual Design Repository</h3><p>Tools like <a href="https://www.invisionapp.com/craft">Craft</a>, <a href="http://folioformac.com/">Folio</a>, <a href="https://zeroheight.com/">ZeroHeight</a> etc., through which designers can sync and share their assets (e.g. Sketch symbols).</p><h3>Visual Design Generator</h3><p>Tools like <a href="http://airbnb.io/react-sketchapp/">React Sketch.app</a> that generate visual design files (e.g. Sketch UI kits) from the code in your UI library.</p><h3>Visual Design Tools</h3><p>Tools like <a href="https://www.sketchapp.com/">Sketch</a> or <a href="http://www.adobe.com/products/photoshop">PhotoShop</a> that are used to produce visual designs of UI components.</p><h3>Conclusion</h3><p>We’ve found identifying these categories of tools and the connections between them useful when discussing or comparing them. Hopefully you will too.</p><p>We’d love to hear your thoughts!</p><p><em>If this has whet your appetite, please check out the </em><a href="https://medium.com/@cirrus/design-system-architecture-a10e7b3aa30f"><em>full-fat version of this post</em></a><em> when you’ve got some more time. It contains a lot more detail.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c9d84f35df4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design System Architecture]]></title>
            <link>https://medium.com/@cirrus/design-system-architecture-a10e7b3aa30f?source=rss-955b936dab83------2</link>
            <guid isPermaLink="false">https://medium.com/p/a10e7b3aa30f</guid>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[system-architecture]]></category>
            <category><![CDATA[style-guides]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[James Nash]]></dc:creator>
            <pubDate>Fri, 28 Apr 2017 22:11:31 GMT</pubDate>
            <atom:updated>2025-03-12T00:13:45.248Z</atom:updated>
            <content:encoded><![CDATA[<h3>Design System Architecture (full-fat version)</h3><p><strong>Note:</strong> The canonical version of this blog post is now: <a href="https://cirrus.twiddles.com/blog/2017/04/28/design-system-architecture/">https://cirrus.twiddles.com/blog/2017/04/28/design-system-architecture/</a></p><p>Please update any links or bookmarks to this post. Thanks!</p><p><em>This ended up being a lengthy post. If you’re in a hurry you can check out the </em><a href="https://medium.com/@cirrus/design-system-architecture-tl-dr-version-1c9d84f35df4"><em>TL;DR version</em></a><em> to get the gist of it and come back to this one later.</em></p><p>I recently attended <a href="https://twitter.com/webdeldn">WEBdeLDN</a>’s “<a href="https://www.eventbrite.co.uk/e/webdeldn-6-the-evolution-of-design-systems-tickets-32662314863#">The Evolution of Design Systems</a>” meet-up (great event, btw!), where I was fascinated by <a href="https://medium.com/u/75a10c6797f4">Alla Kholmatova</a>’s talk. Having worked on and researched numerous design systems, she’s identified three dimensions, against which design systems can be analysed and compared: Strictness, modularity and centralisation.</p><p>I won’t delve into that particular topic today (but, if you’re curious, she’s working on a book about design systems, so keep your eyes peeled for that one). However, what stuck with me was how <em>observing design systems from a particular angle</em> allowed her to glean useful insights that might have otherwise gone unnoticed.</p><p>It reminded me that it is often useful to identify underlying patterns or characteristics of things. Especially, with complex, technical systems where the individual parts often change over time. For instance, front-end JavaScript frameworks are notorious for frequently going in and out of fashion (last season is was jQuery, now it’s React and who knows what will strut down the catwalk next). However, the <em>concept</em> of a front-end framework persists. It is a pattern that has emerged and stood the test of time.</p><h3>Tooling patterns</h3><p>In our recent design system work at <a href="http://buildit.wiprodigital.com/">Buildit</a>, we’ve been focussing a lot on the tools and automation pipelines that can underpin a design system. My colleague <a href="https://medium.com/u/6ff53cf81da3">Panos Voudouris</a> already wrote about <a href="https://medium.com/buildit/first-attempt-at-desops-8a9660c37634">our first forays into DesOps</a>. As we’ve continued to explore and tinker in this area, we noticed recurring <strong>categories of tools</strong> and <strong>integrations</strong> between them emerge.</p><p>It turns out, there’s value in calling them out:</p><ul><li>The categories provide us with a <strong>shared vocabulary</strong>, enabling us to discuss, evaluate and compare the various tools more easily.</li><li>The integrations give us an <strong>architectural map</strong> that helps identify where we might have gaps and/or improvement opportunities in our system.</li></ul><p>Similar to Alla, observing design systems through a particular lens — a DesOps-tinted one in our case — has enabled us to learn something useful. The culmination of what we’ve learned so far is this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WXfRt7TkMsIifor5M4aA7A.jpeg" /><figcaption>Generic architecture of a design system’s infrastructure</figcaption></figure><p>Before I go on to explain the various blocks of this diagram, I’d like to stress the following:</p><ul><li><strong>This only depicts the architecture of the infrastructure</strong> — i.e. what kinds of tools and repositories can exist in a design system and how they are connected. Just having these tools will not give you a complete design system!</li><li><strong>It’s probably incomplete.</strong> More likely than not, other categories of tools exist or will appear which can be plugged in. Perhaps I’ll revisit this topic in a few months and produce an updated diagram. 😉</li><li><strong>You don’t always need all the parts.</strong> This setup is somewhat idealised. Depending on your needs and your budget, you might not have one of everything. However, we believe this map can help you identify what things you don’t currently have so that you can consider whether or not you’d want to add them.</li></ul><p>With that out of the way, let me explain the blocks which each represent a category of tool…</p><h3>UI Library</h3><p>I’m starting here because we’ve come to consider the UI library, by which we mean <strong>the software implementation of your UI components</strong>, as one of the core pieces of a design system. As far as the look, behaviour and semantics of your UI components are concerned, the software should be the source of truth.</p><p>Think about it. A <em>design</em> of a component in PhotoShop or Sketch is just that: A design. A picture of the thing to be built. Likewise, annotations, red-lines, etc. are additional information <em>about</em> the component. Only the software implementation is the component itself — the functional, interactive, responsive… <em>real</em> component that embodies the design and documentation that went before.</p><p>What form your UI library takes, will depend heavily on your needs. It might be native iOS Swift code and PNG assets wrapped up as a CocoaPod library. Alternatively, it might be CSS code, web font files and SVG assets in an <a href="https://www.npmjs.com/">NPM package</a>. In some organisations, you may have both of those and more — if you support multiple platforms you may have multiple UI libraries. In that case, each one is the “source of truth” for its respective platform.</p><p>Similarly, you may have a hierarchy of UI libraries. This can make sense in the world of web development. For instance, you might have a common CSS library used across all web products, but then complement that with more specialised libraries that add implementations of the interactive components for a specific client-side framework (e.g. React) or perhaps server-side CMS (e.g. <a href="https://docs.adobe.com/docs/en/aem/6-0/develop/components.html">AEM components</a>). <a href="https://medium.com/u/52f676b44c62">Brad Frost</a> recently outlined this approach in <a href="http://bradfrost.com/blog/post/managing-technology-agnostic-design-systems/">Managing Technology-Agnostic Design Systems</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jwiQZU6AZg4ruaGpwOtwTA.jpeg" /><figcaption>A deliberately complex example showing both multi-platform and hierarchical UI libraries</figcaption></figure><p>It is worth noting that, just as you would with any other software library, a UI library can also contain automated test code, build scripts, API documentation and more. Consequently, you’d typically have some kind of <a href="https://en.wikipedia.org/wiki/Continuous_integration">CI</a>/<a href="https://en.wikipedia.org/wiki/Continuous_delivery">CD</a> setup that takes care of automatically building, testing and deploying the library. It is after all <em>software</em>, so software engineering best practices should be applied.</p><h4>Package managers &amp; repositories</h4><p>A UI library is ultimately just a software library like any other. Downstream projects should be able to add it as a dependency in order to use the UI components. Likewise, the UI library itself may have dependencies on other software libraries.</p><p>That implies you need tools to manage versioning and dependencies of your library’s code, to make releases and to publish them somewhere for others to find and consume.</p><p>Examples of established tools that do these jobs are:</p><ul><li><a href="https://docs.npmjs.com/getting-started/what-is-npm"><strong>NPM</strong></a> along with the <a href="https://www.npmjs.com/">npmjs.com repository</a> is the de-facto choice of JavaScript and web-related libraries. If your organisation requires an internally hosted repository, things like <a href="https://www.sonatype.com/nexus-repository-sonatype">Nexus</a> can be a valid alternative to NPM’s public repo.</li><li><a href="https://cocoapods.org/"><strong>CocoaPods</strong></a> is an equivalent package manager + repo for native iOS libraries.</li><li>Android, Linux, Windows and other platforms will each have their own equivalents as well.</li></ul><h3>Living Style Guide</h3><p>In the context of a design system, we of course want to be able <em>see</em> and interact with the UI components that exist in the UI library. This is the job of the living style guide. It presents a browsable catalogue of every component, often accompanied by relevant documentation such as:</p><ul><li>A description of its purpose (to tell designers and developers when to use that component and when <em>not</em> to)</li><li>Code snippets or API documentation for developers,</li><li>Meta data such as the component’s status (in review, signed-off, deprecated, etc.), links to other components it embeds or is embedded by, etc.</li></ul><h4>Style guide generator</h4><p>What makes a style guide <em>living</em> is that it is always kept in sync with the corresponding UI library. Trying to do so manually is almost guaranteed to fail, so this is achieved by <em>automatically generating</em> the style guide <em>from</em> the code in the UI library.</p><p>A number of tools that do this exist and they all work in a similar way. For each UI component in the UI library, developers need to provide:</p><ul><li>A code snippet or template that defines the necessary HTML (or DOM structure) for the component</li><li>Additional meta-data like a description or status</li></ul><p>This code can sit directly alongside the corresponding component code inside the UI library, or in a separate code repository. That’s up to you.</p><p>The style guide generator tool then grabs all those bits and outputs a complete style guide website. That website can then be hosted somewhere so that stakeholders can view it in a web browser just by visiting a URL.</p><p>The style guide generation can also be automated, so that whenever a new version of the UI library is released the corresponding style guide is automatically re-generated and published.</p><p>Examples of tools that do this for web UI libraries include:</p><ul><li><a href="http://patternlab.io/"><strong>Pattern Lab</strong></a></li><li><a href="http://fractal.build/"><strong>Fractal</strong></a></li><li><a href="https://storybooks.js.org/"><strong>StoryBook</strong></a> (note this one is specifically for <a href="https://facebook.github.io/react/">React.js</a> libraries and apps)</li><li><a href="http://astrum.nodividestudio.com/"><strong>Astrum</strong></a></li></ul><p>We have yet to find equivalent tools for native iOS and Android (if you know of one, please let me know!). In principle, the same idea should be possible though. The key difference would be that the output would need to be a native app. People would need to install or update that app on their phone/tablet in order to view the style guide (it’s the only way to view native components in their natural environment!), so distribution won’t be as easy as it is for web-based ones.</p><p>For iOS specifically, Apple provides <a href="https://developer.apple.com/library/content/samplecode/UICatalog/Introduction/Intro.html"><strong>UIKit Catalog</strong></a> which is sample code for an app that contains examples of each UI component. This can be used as a basis for building a bespoke style guide app. (Thanks to my colleague <a href="https://medium.com/u/3e65c9d9df2c">Juliana Cipa</a> for discovering that one!)</p><h3>Design Token Repository</h3><p>In larger design systems, especially ones where there are multiple UI libraries, it often makes sense to separate out the <a href="https://medium.com/eightshapes-llc/tokens-in-design-systems-25dd82d58421">design tokens</a> that are shared across all UI libraries. Typically these will be things like your brand’s colour palette, typography styles and logo images. <a href="https://medium.com/eightshapes-llc/space-in-design-systems-188bcbae0d62">Pre-defined spacing values</a> and icon graphics might also be included.</p><p>Those tokens then need a home and a means to be fed into the various UI libraries. This is what a design token repository does. It therefore becomes the “single source of truth” for this specific data.</p><p>A simple example of a design token repository might be a git repo where JSON files (containing the token data) and source SVG graphics for logos and icons are stored. Tools like <a href="https://github.com/salesforce-ux/theo"><strong>SalesForce Theo</strong></a> can convert and export the tokens from JSON into various formats suited to inclusion in web, Android, iOS and other UI libraries. Automated builds can be setup to update each of the UI libraries with freshly exported token data whenever the design token repository is updated. This ensures that they never drift out of sync.</p><p>Note that extracting token data can have other benefits. In the same way that it can be exported to code, it can also be exported as other things:</p><ul><li>ACO colour swatch files that designers can load in PhotoShop and Illustrator</li><li>Text styles and document colours for Sketch</li><li>Microsoft Office themes for PowerPoint, Word, etc.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*39BkJjGcP_bbnKhY_ZwG1A.jpeg" /><figcaption>A complex example of how a design token repository can feed data into a variety of places</figcaption></figure><p>More user-friendly alternatives to purely code-based token repositories exist:</p><ul><li><a href="https://brand.ai/"><strong>Brand.ai</strong></a> allows you to visually input and manage your tokens via a web interface and can then export them in a variety of formats.</li><li><a href="https://frontify.com/"><strong>Frontify</strong></a> let’s you do more or less the same thing, although it’s export facilities are less comprehensive than Brand.ai’s.</li></ul><p>As we shall see though, both Brand.ai and Frontify are actually hybrid tools as they <em>also</em> act as visual design repositories…</p><h3>Visual Design Repository</h3><p>Most design systems need to provide a means for UI designers to get hold of the most up-to-date UI component designs and templates. This is so that, when they produce UI designs and mock-ups for projects, they resemble the actual UI components in the UI library as accurately as possible. This central pot of UI designs is the visual design repository.</p><p>Likewise, in situations where a new UI component is being developed or an existing one is being evolved, the UI designers will need a way to push their designs back into the visual design repository so that others can then see and/or use them. Therefore a two-way synchronisation between designer’s tools and the visual design repository is desirable.</p><p>Another desirable feature is for the contents of the visual design repository to be browsable via a web interface. Developers and other stakeholders may not have the necessary design tools installed, so a web interface provides a universal way for people to browse available UI component designs.</p><p>In terms of presentation, such a web interface is essentially a form of <em>style guide</em>. It may even be <em>living</em> in the sense that it always contains the most up-to-date designs. There are however some important differences compared to a living style guide that is generated from a UI library:</p><ul><li>It contains <em>static pictures</em> of the components, not the components themselves.</li><li>Depending on your workflows, the corresponding real components in the UI library may end up looking slightly different to the original designs. For example, this could happen if, in the course of development, changes had to be made for performance or accessibility reasons. Or, it might be as simple as different browsers rendering the component in subtly different ways (so there is in fact no single “correct” appearance of the component).</li></ul><p>As explained above, it makes sense to consider the UI library (if/when you have one, of course) the definitive “source of truth”. Arguably, as long as all the relevant parties are happy with whatever changes arise in the real UI components, having visual discrepancies between them and what’s in the visual design repository shouldn’t be a problem. In fact, I <a href="https://medium.com/buildit/wysiwyg-must-die-4c34055ea7d7">recently argued</a> that the need for projects to produce high-fidelity visual screen designs at all could fade away entirely once you have an established design system.</p><p>However, if you do have a strong need to keep your visual design repository in sync with your UI library, then consider using a visual design generator (described in the next section).</p><p>Examples of visual design repositories are:</p><ul><li>A simple, shared folder (e.g. on Dropbox) containing shared templates, UI kits, etc.</li><li><a href="https://www.invisionapp.com/craft"><strong>InVision Craft </strong></a>— a plug-in for Sketch and PhotoShop and cloud service that let designers share designs. The web interface also provides commenting features, so other stakeholders can give feedback.</li><li><a href="https://zeroheight.com/"><strong>ZeroHeight</strong></a><strong> </strong>— a Sketch plug-in and cloud service that lets designers share Sketch files amongst themselves.</li><li><a href="http://folioformac.com/"><strong>Folio</strong></a><strong> </strong>— a tool (backed by a git repo) for versioning and sharing visual design files. If you’re interested, <a href="https://medium.com/u/c445e73d7e57">Lee Giles</a> has written up a workflow for <a href="https://medium.com/making-lost-my-name/maintaining-our-pattern-library-1d5b2e56372e">maintaining shared UI component designs via Folio</a>.</li><li><a href="https://www.abstractapp.com/"><strong>Abstract App</strong></a><strong> </strong>—a new tool that’s still in private alpha. It sounds similar to Folio. One to watch perhaps.</li></ul><p>Additionally, the following tools incorporate visual design repositories alongside design token repositories:</p><ul><li><a href="https://brand.ai/"><strong>Brand.ai</strong></a><strong> </strong>— provides plug-ins for Sketch and Illustrator allowing designers to upload and download component designs. It also synchronises design token data. For example, colour tokens appear as document colours inside Sketch.</li><li><a href="https://frontify.com/"><strong>Frontify</strong></a> — while it doesn’t provide plug-ins for automatic synchronisation of designs, you can upload images of your component designs into it and organise them into a style guide.</li></ul><h3>Visual Design Generator</h3><p><a href="http://airbnb.design/painting-with-code/">Airbnb’s announcement</a> of their <a href="http://airbnb.io/react-sketchapp/"><strong>React Sketch.app</strong></a> tool earlier this week made big waves in the design system community. It can take components written in React.js and <em>automatically</em> convert them into symbols in a Sketch file. It’s analogous to what a style guide generator does, except that the output is a visual design file instead of a living style guide.</p><p>Just like a style guide generator, this process can be automated so that it runs every time the UI library is updated. It therefore makes sense to store the output of such a tool in your visual design repository, so that it is easily accessible to all designers. That would ensure that your latest UI designs remain in sync with the contents of the UI library.</p><p>What is perhaps more exciting than the React Sketch.app tool itself, is the (perhaps new?) <em>category</em> of tools it represents: <em>Visual design generators</em>. Given the excitement it’s generated, I suspect it’s only a matter of time before more, similar tools emerge. Perhaps to support UI libraries other than React ones, or visual design tools other than Sketch.</p><p>Definitely an area to keep an eye on!</p><h3>Visual Design Tools</h3><p>Last but not least we have the visual design tools that are used to create the visual designs. Examples are:</p><ul><li><a href="https://www.sketchapp.com/"><strong>Sketch</strong></a></li><li><a href="http://www.adobe.com/products/photoshop"><strong>PhotoShop</strong></a></li><li><a href="http://www.adobe.com/products/illustrator"><strong>Illustrator</strong></a></li></ul><p>I don’t think I need to explain any of those further. 🙂</p><p>Arguably, visual prototyping tools like <a href="https://www.axure.com/">Axure</a>, <a href="https://balsamiq.com/">Balsamiq</a> and <a href="https://framer.com/">Framer</a> could also be lumped into this category as they also help designers express the intended look and feel of a UI (component).</p><p>In the architecture diagram above, these tools are shown on the boundary of the design system. On the one hand, you could make the case they are an integral part because they are connected to other parts like a visual design repository. On the other hand, perhaps they stand apart and are just the tools of the trade for designers. After all, you probably wouldn’t consider an IDE or text editor used by a developer being an integral part of the design system’s infrastructure.</p><h3>Conclusion</h3><p>I’m reasonably confident that the categories of tools we’ve identified so far are sensible ones. Most tools we’ve come across seem to fit into them naturally without feeling forced. Granted, some tools span multiple categories (e.g. Brand.ai), but they at least help clearly describe those tools’ functionalities.</p><p>Like I said at the start, this is probably an incomplete picture. I encourage you to debate it, challenge it and expand it. Perhaps other categories should be included? Perhaps there are further integrations between them?</p><p>Furthermore, I’d love to see the architectures of your design systems. Have you followed a similar pattern to the one in our diagram? A subset or superset of it? Or does yours look completely different.</p><p>I’m excited to see what you all come back with! 🤘</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a10e7b3aa30f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WYSIWYG Must Die]]></title>
            <link>https://medium.com/@cirrus/wysiwyg-must-die-4c34055ea7d7?source=rss-955b936dab83------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c34055ea7d7</guid>
            <category><![CDATA[wysiwyg]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[opinion]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[James Nash]]></dc:creator>
            <pubDate>Tue, 18 Apr 2017 16:22:54 GMT</pubDate>
            <atom:updated>2025-02-22T00:59:34.184Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Note:</strong> The canonical version of this blog post is now: <a href="https://cirrus.twiddles.com/blog/2017/04/18/wysiwyg-must-die/">https://cirrus.twiddles.com/blog/2017/04/18/wysiwyg-must-die/</a></p><p>Please update any links or bookmarks to this post. Thanks!</p><p>Now that my clickbaity headline got your attention, I should qualify my inflammatory statement a little: “WYSIWYG (What You See Is What You Get) <em>in the context of producing interactive user interfaces</em> Must Die”.</p><h3>Pixel Perfect Dreams</h3><p>The idea that you could visually design your app or website in a tool and then, at the click of a button, have it export a fully functional, interactive user interface (UI) is a seductive one. Why wouldn’t you want that? Non-technical people could create simple apps by themselves without ever needing to write a line of code. Even if the app needed more complex logic behind the scenes, you could at least unburden developers from having to code the UI portion of it.</p><p>Not only that. You’d eliminate any misunderstandings and discrepancies that might creep in when developers translate your pristine, pixel-perfect UI design into code!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IhZl8b-nEvUlj05a6AFrmw.jpeg" /></figure><p>This are precisely the kind of promise that many WYSIWYG tools make. Back in the day <a href="https://en.wikipedia.org/wiki/Microsoft_FrontPage">Microsoft FrontPage</a> would let anyone build a website with a few clicks. Then it was <a href="http://www.adobe.com/Dreamweaver">DreamWeaver</a>. Now it’s <a href="http://www.wix.com/">WIX</a>, or <a href="https://www.squarespace.com/">SquareSpace</a>, or one of countless others.</p><p>They vary in complexity and the creative freedom they afford the designers, but the basic premise is always the same: You just focus on how you want things to <em>look</em>, and they will take care of that code stuff automatically.</p><p>Sounds lovely. What’s the problem?</p><h3>Warning! Iceberg metaphor ahoy!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XDut-AU1wUBomEg4_44rWA.jpeg" /></figure><p>In a nutshell, how a (piece of a) UI <em>looks</em> is only the tip of the iceberg. There are a number of non-visual hygiene factors any UI (component) should meet:</p><ul><li><strong>It needs to be device agnostic.</strong> Whether your making websites or apps, you can’t escape the reality of different screen sizes, different pixel densities and different input mechanisms. In terms of UI design, that translates to fluid and responsive layouts — i.e. designs that will intelligently stretch, squash or adapt to the dimensions of <em>any</em> screen size. Likewise, user input might be via touch (which means there is no hover state!), mouse (meaning multi-touch gestures are not available), keyboard (do your interactive UI elements visual focus when you tab through them?) or combinations of those (Windows “convertible” laptops, anyone?) and your UI must work with <em>all</em> of them.</li><li><strong>It needs to be performant.</strong> We’ve long known that <a href="https://www.nngroup.com/articles/response-times-3-important-limits/">the speed at which a UI reacts to user input is critical</a>. In the context of a web experience, that includes the perceived page load speed. Studies have shown that <a href="https://blog.kissmetrics.com/speed-is-a-killer/">79% of web users will abandon a site if it hasn’t loaded within 3 seconds</a>. While the choice of visual styling is most definitely a factor in this, a lot of what influences performance is down to how things have been coded.</li><li><strong>It needs to be accessible.</strong> Whether it’s to <a href="https://www.out-law.com/page-330">avoid getting sued</a> , wanting to <a href="http://www.interactiveaccessibility.com/accessibility-statistics">address the largest possible market</a>, or — hopefully —just because you don’t want to be an arsehole, making your UI as inclusive as possible is a critical factor. Some aspects like the sizing and colouring of text and UI elements will affect how accessible your UI is to people with various visual impairments. However, how accessible it is to someone with no eyesight at all or one of countless other impairments (hearing, motor, neurological, etc.) depends heavily on how it has been coded. Does your UI code hook into relevant accessibility APIs? Does it use them appropriately?</li><li><strong>It needs to be robust.</strong> It’s relatively rare that your UI will only ever contain content that never changes and is therefore known when you design it. Far more commonly, much of its content will be dynamic. Displaying a user’s name and photo, embedding user-generated content, rendering a chart based on some downloaded data and more. These are all examples of the kind of things your UI will need to cope with and all of them will have edge cases that need to be catered for. What happens when your user has a very long name? What if the user generated content is written in a right-t0-left language? What if an uploaded image is not in the aspect ratio you need? What if the downloaded data requires more bars in your chart than you have screen space for? Besides dynamic content, you also have user settings to contend with. Will your UI hold up if the user has configured their system to have a larger default font size?</li><li><strong>It needs to integrate well into its target environment.</strong> A web experience should be mindful of its URLs (to enable bookmarking, sharing, and more), be SEO-friendly and aware of other considerations that are unique to the web.<br>An iOS app should heed <a href="https://developer.apple.com/ios/human-interface-guidelines/overview/design-principles/">Apple’s Human Interface Guidelines</a> not only for the visuals, but also how users navigate in the app — it’s not enough to <em>look</em> right, it needs to <em>feel</em> right too. It should probably consider and, where appropriate make use of, iOS-specific features like <a href="https://developer.apple.com/app-extensions/">App Extensions</a>, <a href="https://developer.apple.com/library/content/documentation/General/Conceptual/WatchKitProgrammingGuide/DesigningaWatchKitApp.html#//apple_ref/doc/uid/TP40014969-CH3-SW1">Apple Watch integration</a> and more.<br>Similarly, an Android app should aim to follow <a href="https://developer.android.com/design/index.html">Google’s Material Design</a> while being mindful of <a href="https://developer.android.com/design/patterns/pure-android.html">Android-specific UI conventions</a> which <a href="https://material.io/guidelines/platforms/platform-adaptation.html#">sometimes differ from those of the web or iOS</a>. Taking advantage of <a href="https://developer.android.com/guide/components/activities/tasks-and-back-stack.html">how an Android app can expose different tasks</a> (which can potentially be invoked by other apps) can provide a more seamless and useful experience. Likewise, integration with <a href="https://developer.android.com/design/wear/index.html">Android Wear</a> and/or <a href="https://developer.android.com/design/auto/index.html">Android Auto</a> is also worth considering.</li></ul><p>What all of these factors have in common is:</p><ul><li>They have an very tangible effect on the user experience (UX)</li><li>Achieving them demands close collaboration between design and development disciplines</li><li><strong>A visual picture of a UI (component) does not provide enough information</strong> to answer all the questions that will arise.</li></ul><p>It’s the last point that is crucial in the context of this article.</p><p>If I’m using a WYSIWYG tool to design a UI and I style some text to be bold and have a larger size, how can the tool know <em>why</em> I did that? Was it because that text is a heading (and if so, a heading of what exactly — where exactly does its section begin and end?). Or, was it perhaps simply a phrase I was trying to draw attention to?</p><p>If that tool were to then generate code, it could probably apply the correct styling. The font would be bold and the size would be just so. It would <em>look</em> right. However, if the output was HTML, it wouldn’t necessarily know that it should be marked up as &lt;h1&gt;, &lt;h2&gt; or maybe something entirely different like a &lt;blockquote&gt; perhaps — to play it safe it might just make it a &lt;div&gt;. That would be a pity because the choice of markup <em>will</em> have an affect on the accessibility (e.g. a screen reader might read out an outline of all the headings on the page to aid navigation) and SEO-friendliness (a search engine might ascribe more relevance to text inside an &lt;h1&gt; than to text in a &lt;div&gt;) of the resulting code.</p><p>How about something more complex like an interactive pie chart. If I draw a circle divided into segments in my WYSIWYG tool, how does it know that my intent was for that to be a pie chart as opposed to a picture of a fancy bicycle wheel or a stylised pizza? Even if it did know, how would it know where the data was coming from or what colours to use if a different dataset required more segments? How about accessibility — what should the text alternative to this pie chart be for an audio browser or braille display? Most WYSIWYG tools will throw their hands up in despair at this point and simply output your pie chart as a static PNG image.</p><blockquote>WYSIWYGBWYGIG: What You See Is What You Get But What You Get Is Garbage</blockquote><p>Clearly, there’s a lot more information that the designer would need to provide to a WYSIWYG tool in order for it to generate UI code that satisfies all the hygiene factors listed above.</p><p>Of course, most WYSIWYG tools acknowledge this to some degree. They’ll often let you assemble your design from a set of common UI widgets (buttons, inputs, checkboxes and so on) which, behind the scenes, apply some of necessary semantics. For instance, by dragging and dropping a button widget into your design, the tool knows that it is indeed a button (which, in turn, is a thing that can be clicked and has various states) as opposed to a generic rectangle with some text inside it. It can then output more appropriate code.</p><p>Taking that to its logical conclusion though, if there was a hypothetical WYSIWYG tool that allowed you to specify all the nuances of your UI component (it’s responsive layout behaviour, it’s interactive behaviours, it’s accessibility attributes, what coding conventions the output should follow, etc.), it would inevitably be quite complex and have a very steep learning curve. <strong>In effect the designer would be programming the UI design</strong> because they would need to tackle the same questions that a developer would.</p><p>It seems to me that this would pretty much defeat WYSIWYG’s whole <em>raison d’être</em> which is to avoid needing to do the programming. The thing is though, the actual <em>tools</em> themselves are making a valiant effort. From a technical perspective, they are often ingenious bits of software and it’s amazing just how much they <em>can</em> do. The problem is the unobtainable <em>dream</em> they are chasing after. <strong>WYSIWYG code generation was never a sensible expectation to have, it still isn’t and I highly doubt it ever will be.</strong></p><h3>What to do?</h3><p>Great. The promise of WYSIWYG tools generating decent, production quality code is fundamentally flawed. What now?</p><p>Let’s take a step back and think of what we’re actually trying to achieve. <strong>We want to craft great, interactive user experiences.</strong> Interactive prototypes can be an invaluable tool towards that end — they enable more life-like usability testing and they can convey the UI’s intended behaviour to developers and other stakeholders more accurately than other means.</p><p>I’d therefore say that using a WYSIWYG tool to knock up such prototypes <em>can</em> be useful, as long as everyone acknowledges that they are <strong>throw-away</strong> prototypes. The implications of that are:</p><ul><li><strong>Each prototype only needs to be good<em> enough</em> for its intended purpose.</strong> E.g. if the intent is to convey or test navigation through an app, there’s rarely any need to have the visual aesthetics fully branded and fleshed out.</li><li><strong>There can be many little prototypes.</strong> It’s OK to <em>not</em> have a single, all-encompassing master prototype. Instead, you can have many simple prototypes that each only demonstrate one area of interest.</li><li><strong>Not every prototype needs to be created in the same tool.</strong> Even if you use a WYSIWYG tool to generate some of your prototypes, it might not be the right tool for the job every time. Sometimes a few code snippets in <a href="http://codepen.io/">CodePen</a> will do the job. Other times a <a href="http://usabilitygeek.com/paper-prototyping-as-a-usability-testing-technique/">paper prototype</a> will suffice. Do whatever’s fastest and cheapest.</li><li><strong>Once a prototype has served its purpose, it gets retired.</strong> It will have been set up to test or demonstrate something. Once the outcome is known the real product can be built or updated accordingly. There’s no need to maintain the prototype afterwards. Over time that might mean what is in the real code differs in some way from the prototypes that went before (perhaps the visuals change, or things are altered due to technical reasons), but that’s absolutely fine! If you need a “single source of truth”, make it the final software itself not one of your design artefacts.</li></ul><p>With respect to the last point, it is perhaps worth noting that many organisations are obsessed with having some “high fidelity” visual design that shows exactly how the finished software should appear on screen. Often, presumably as a misguided attempt at combining detailed visual design <em>and</em> documenting interactive behaviour in the same artefact, WYSIWYG tools are used to create them. Other times, visual design tools like PhotoShop or Sketch will be used to create non-interactive visual mock-ups. In either case, what then tends to happen is that this visual prototype or mock-up becomes the thing that clients and other stakeholders review. <strong>It becomes the yardstick by which everything else that follows is measured.</strong></p><p>This attitude leads designers down an unproductive path of trying to refine and polish the visual mock-ups to perfection <em>before</em> they feed into development. It essentially forces a waterfall process onto the project and does not lend itself to a leaner, more agile way of working. Furthermore, as highlighted in the list of hygiene factors above, the output of WYSIWYG tools or, worse, static pictures fail to capture and communicate many important aspects of the UI.</p><p>Conversely, adopting leaner, more granular prototypes and visual artefacts not only improves efficiency, it also suggests that all those involved in the project better understand the nature of what they are trying to create.</p><p>So, in summary: <strong>WYSIWYG Must Die.</strong> 😜</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k8qr6cF4lh4dgP4JOnrRTQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c34055ea7d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hands on with Samsung’s Gear 360]]></title>
            <link>https://medium.com/@cirrus/hands-on-with-samsungs-gear-360-56dd9dfd5a4c?source=rss-955b936dab83------2</link>
            <guid isPermaLink="false">https://medium.com/p/56dd9dfd5a4c</guid>
            <category><![CDATA[360-video]]></category>
            <category><![CDATA[samsung]]></category>
            <category><![CDATA[cameras]]></category>
            <category><![CDATA[virtual-reality]]></category>
            <category><![CDATA[insidersgear360]]></category>
            <dc:creator><![CDATA[James Nash]]></dc:creator>
            <pubDate>Fri, 20 Jan 2017 14:00:14 GMT</pubDate>
            <atom:updated>2024-10-20T23:52:43.258Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Note:</strong> The canonical version of this blog post is now: <a href="https://cirrus.twiddles.com/blog/2017/01/20/hands-on-with-samsung&#39;s-gear-360/">https://cirrus.twiddles.com/blog/2017/01/20/hands-on-with-samsung&#39;s-gear-360/</a></p><p>Please update any links or bookmarks to this post. Thanks!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4j4RVfRv3mQXv024nT4NvQ.jpeg" /></figure><p>I recently got a <a href="http://www.samsung.com/global/galaxy/gear-360/">Samsung Gear 360</a> on loan courtesy of <a href="https://www.theinsiders.eu/campaigns/blog/14/13836/samsunggear360.htm">The Insiders</a>. It’s a camera that can record 360º photos (up to 30 megapixels) and 360º videos (up to 4k 30fps). When viewed via appropriate software or online services, you can interactively pan around the photos or videos in all directions to observe the scene as though you were where the camera was. This is especially impressive and immersive, when you view them via a VR headset like <a href="https://vr.google.com/cardboard/">Google Cardboard</a>.</p><p>The camera’s official price is currently £349 in the UK. However, if you shop around you can find it cheaper (for example, <a href="https://www.amazon.co.uk/Samsung-Gear-360-Camera-White/dp/B01M4J53CO/ref=sr_1_2?ie=UTF8&amp;qid=1484864754&amp;sr=8-2&amp;keywords=samsung+gear+360">Amazon currently offers it for about £275</a>)</p><h3>What’s in the box</h3><p>The Gear 360 comes in a funky, cylindrical package. Besides the camera and its removable battery, you’ll find the following in there:</p><ul><li>Mini tripod</li><li>Wrist strap that attaches to the mini tripod</li><li>microUSB cable</li><li>Soft pouch</li><li>Cleaning cloth</li><li>Instructions</li><li>License key for Samsung’s Action Director software for Windows</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-WBkON6crBRxT3C4nZkHvw.jpeg" /></figure><p>Notably absent are:</p><ul><li>A USB wall charger</li><li>A microSD card (the camera does <strong>not</strong> have internal storage, so you <em>will</em> need to get a memory card before using it!)</li></ul><h3>Setup</h3><p>Connecting the camera to my phone (a Samsung Galaxy S7) was pretty straight forward:</p><ul><li>Download &amp; install the <a href="https://play.google.com/store/apps/details?id=com.samsung.android.samsunggear360manager">Gear 360 app</a> from Google Play store</li><li>Run it and follow the in-screen prompts</li></ul><p>One minor niggle was that, on the first run, the app asks for some unexpected permissions (e.g.: the ability to make phone calls). I’m inclined to trust Samsung not to abuse them for nefarious purposes, but it’s still not clear to me <em>why</em> the app even needs those permissions. If this had been an app from a random publisher, I’d have quit and uninstalled at this point (considering the amount of phishing and malware that’s about these days). I’d suggest that Samsung either explain what those permissions are being used for before requesting them or else avoid requiring them in the first place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9tUmK2xnqaC5tUNmBlpoEQ.jpeg" /><figcaption>Why would a camera app need phone &amp; SMS capabilities?</figcaption></figure><p>Note that the app only supports the following phones — if you have something else, you’re out of luck unfortunately:</p><ul><li>Samsung Galaxy <strong>S7</strong> &amp; <strong>S7 Edge</strong></li><li>Samsung Galaxy <strong>S6</strong>, <strong>S6 Edge</strong> &amp; <strong>S6 Edge+</strong></li><li>Samsung Galaxy <strong>Note 5</strong></li></ul><p>Technically, you can use the camera without a phone and the app (you can still take photos and videos and then transfer them off the microSD card), but I wouldn’t recommend it. The live viewfinder provided by the app is very helpful. The app also allows you to control some settings that can’t be done on the camera directly. It is also responsible for downloading firmware updates and installing them onto the camera. Finally — and perhaps most importantly — the app takes care of <a href="https://en.wikipedia.org/wiki/Image_stitching">stitching</a> the images and videos it downloads off the camera. Without the stitching, they won’t look quite right when displayed in scrollable 360º viewers / players or in VR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fbyyD76a6Sl4uY-C3tTppA.jpeg" /><figcaption>Screengrabs of how YouTube renders stitched (on the left) versus unstitched (on the right) footage. Note how on the unstitched one you can still make out the black area between the two lenses and there is also some duplication of things visible near the edge of the lenses’ field of vision.</figcaption></figure><h3>Usage</h3><p>Using the Gear 360 is pretty straightforward. The buttons on the camera let you switch it on, switch between the various photo and video modes, take pictures and record videos. Alternatively, via the app on your phone, you can see a live viewfinder and remote control all functions of the camera.</p><p>At first I found myself trying to keep the camera level as I would with a normal one. However, after a while I realised it doesn’t matter (as much), since it’s recording a complete 360º, spherical view of its surroundings. You can’t <strong>not</strong> get something in the shot! Of course, a consequence of this is that yourself are in the shot too — unless you hide from the camera and remote control it from your phone.</p><p>The supplied mini tripod is quite sturdy and is invisible in photos and videos. However, if you have the wrist strap attached to it, that <em>does</em> tend to be partly visible in the photo. With the legs folded in it also doubles as a handle for holding the camera, though your hand will then be visible in the shot. Fortunately, it attaches via a standard tripod screw mount, so you can use pretty much any tripod or selfie stick instead. I got some good results with a selfie stick as it ends up being invisible in the final shot but is much longer than the mini tripod, thus giving photos and videos the appearance that the camera was floating in the air.</p><p>Using the app, you can then wirelessly download photos and videos from the camera to your phone. This uses <a href="https://en.wikipedia.org/wiki/Wi-Fi_Direct">Wi-Fi Direct</a> and is reasonably quick — transferring photos (which weigh in at around 5–6mb each) takes about 10–20 seconds. Videos take longer obviously (to give you a rough idea, a 56 second clip I recorded at 3840 x 1920 resolution was 406mb). Depending on their duration, they can therefore take several minutes to transfer.</p><p>Once on your phone, the app allows you to view them in various ways:</p><ul><li><strong>360º view</strong>: Displays photos &amp; videos as (the inside of?) a sphere. You can pan around it by swiping the screen. Alternatively, switching on “Motion View” lets you look around by moving your phone instead.</li><li><strong>Dual view</strong>: Shows what was captured by the front and back cameras as 2 images side-by-side.</li><li><strong>Panoramic view</strong>: Displays an <a href="https://en.wikipedia.org/wiki/Equirectangular_projection">equirectangular</a> version of the photo / video. This is actually unaltered image (if you open the photo or video in a non-360º-aware viewer, this is what you’ll see).</li><li><strong>Round view</strong>: Gives you a “tiny world” representation. You can pan around in all directions and zoom in and out. These often look quite cool. Unfortunately, there’s no option to export a high-res copy of this view. You have to therefore screenshot it, if you’d like to take a copy of what you see there.</li><li><strong>Stretched view</strong>: Is a stretched and, in my opinion, ugly view. You can pan around in this view too. But it seems pretty pointless.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sT9x5kmXYT5kEbUt8MUzCw.jpeg" /><figcaption>The same 360º photo viewed in 5 different ways</figcaption></figure><p>A more natural view option, akin to how services like Facebook or YouTube display 360º content, would have been nice. Also, built-in support for <a href="https://vr.google.com/cardboard/">Google Cardboard</a> would have been nice (currently, you need to find other 3rd party apps to do that). Perhaps future updates to the app will add things like that.</p><p>When transferring many photos and/or large videos, it is much faster to read them direct off the camera’s microSD card. You’ll need to use a card reader though, since the camera does not identify as a standard mass storage device when plugged in via USB (at least it did not on my Mac). The other drawback with this approach is that the images and videos are not stitched. Instead, you just get the raw images from both cameras side-by-side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WX9u0QJKzvGkbuQa57dAIw.jpeg" /><figcaption>Example of an unstitched image directly off the camera’s memory card. Note the black areas and slight overlap in what each camera captured.</figcaption></figure><p>I believe Samsung’s Action Director can do the stitching on a PC. However, on a Mac or Linux computer you’ll need to find alternative software to do it. I wasn’t able to find any free ones for the Mac, so I ended up relying entirely on the Gear 360 Android app for my stitching (which meant some of transfers took quite a long time).</p><p>Interestingly, videos stored on the camera’s microSD use the H.26<strong>5</strong> codec. Presumably the Gear 360 Android app converts to H.264 as part of its stitching process. Given that support for H.264 playback is much broader, on players, online services and devices, this is a sensible choice.</p><h3>Sharing photos &amp; videos</h3><p>You can share photos and videos direct from the Gear 360 app. This uses Android’s standard sharing mechanism, so the options presented to you depend on what other apps you have installed. The photos are actually just JPEG files and the videos are MP4 files (with H.264 video and AAC audio), except that they contain some <a href="https://developers.google.com/streetview/spherical-metadata">extra meta data</a> that indicates to compatible viewers and players that they should be displayed as 360º.</p><p>If you share them to an app or service that supports 360º content and understands that meta data (of the ones I tried, Facebook, YouTube and Flickr all do), then they will be displayed as an interactive 360º view that allows people to pan around and look in all directions. If the service does not, then you simply see a flat, equirectangular view (identical to the “Panoramic View” mode described above).</p><p><a href="https://www.flickr.com/photos/james_nash/31716084290/">360° view from Grand Coloane Resort</a></p><h3>Editing content</h3><p>The Gear 360 app does not provide any photo or video editing facilities. Apparently, the <a href="https://resources.samsungdevelopers.com/Gear_360/02_Download_Gear_360_Action_Director">Action Director</a> PC software that Samsung provides does. I don’t have a Windows PC though, so I was unable to try that out. Samsung doesn’t provide any software for Mac or Linux.</p><p>Apple’s iMovie does not currently support 360º video. I wasn’t able to find any free apps to edit 360º video on my Mac. However, I have access to Adobe Premiere and was able to use that. I’m not an expert at video editing, so I probably only scratched the surface of what’s possible. For an expensive professional tool, the 360º features in Premiere felt a bit underwhelming though. It can import and export 360º videos with the necessary meta data and you get an interactive 360º preview while editing. That’s about it as far as I could see.</p><p>The ability to change the default vantage point was something I wanted, but couldn’t do directly in Premiere. Eventually, I found a work-around using After Effects in this <a href="https://wistia.com/blog/360-video-shooting-techniques">“360 Video Production Tactics” blog post</a>, but it’s quite tedious to do.</p><p>With a bit of trial and error, I was able to put together the following video and I’m quite pleased with the result (considering that I’m a newbie to video editing in general, let along 360º video):</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F50F1-zsfV2Y%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D50F1-zsfV2Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F50F1-zsfV2Y%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a2eded41d62835e1b3e0771fcfa90ce1/href">https://medium.com/media/a2eded41d62835e1b3e0771fcfa90ce1/href</a></iframe><p>This is a nascent technology though, so I’m confident that the availability and feature set of 360º editing software, viewers and sharing services will evolve quickly.</p><h3>Conclusion</h3><p>Overall I’m quite impressed with the Gear 360. Compared to using your phone camera’s panorama or photosphere functions, being able to take a 360º photo in an instant is vastly more convenient. Furthermore, 360º <em>videos</em> aren’t even be possible at all using a traditional camera, so being able to capture those opens the door to whole new world of creative opportunities.</p><p>I’ve had a lot of fun playing with the camera and gradually figuring out what works and what doesn’t. There’s still much to discover and learn, but it’s exciting to explore what feels like a new medium.</p><p>Since it’s still a novelty, sharing 360º photos and videos online gets a lot of <em>ooohs</em> and <em>aaahs</em>. When you’re out with friends or family, standing in a circle around the camera and taking pictures produces some pretty cool group photos. Letting people see places you’ve visited as if they were there themselves goes down a treat too.</p><p>For a first generation product, the Gear 360 is pretty good. The device looks nice and feels sturdy. It’s fairly easy to operate and has very good picture quality. The Android app is functional, but could do with some improvements.</p><p>Considering the price point, it’s definitely an “early adopter” product for now. If you’re keen to dip your toes into 360º content production, then I can definitely recommend it. If you’re looking for your next camera for holiday snaps, you may want wait another generation or two so that the software kinks get ironed out and the prices drops further.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56dd9dfd5a4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some Principles Apart]]></title>
            <link>https://medium.com/@cirrus/some-principles-apart-45ce2001a050?source=rss-955b936dab83------2</link>
            <guid isPermaLink="false">https://medium.com/p/45ce2001a050</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[aeaorl]]></category>
            <category><![CDATA[conference]]></category>
            <dc:creator><![CDATA[James Nash]]></dc:creator>
            <pubDate>Tue, 17 Jan 2017 17:31:03 GMT</pubDate>
            <atom:updated>2024-10-20T23:50:49.935Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Note:</strong> The canonical version of this blog post is now: <a href="https://cirrus.twiddles.com/blog/2017/01/17/some-principles-apart/">https://cirrus.twiddles.com/blog/2017/01/17/some-principles-apart/</a></p><p>Please update any links or bookmarks to this post. Thanks!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*mXO-dv3wPFzdXfnHDd6l9g.jpeg" /></figure><p>Back in October I had the good fortune of being able to attend the excellent <a href="https://aneventapart.com/event/orlando-special-edition-2016">An Event Apart 2016 Orlando</a>, a three day web design conference. The speakers were all well known and highly respected figures in the web design community. The kind of people who have literally <em>written the book</em> on everything from <a href="https://en.wikipedia.org/wiki/Designing_with_Web_Standards">web standards</a> over <a href="https://abookapart.com/products/responsive-web-design">Responsive Web Design</a> through to the latest <a href="http://valhead.com/book/">CSS animation</a> and <a href="https://abookapart.com/products/get-ready-for-css-grid-layout">layout techniques</a>.</p><p>While all the talks were interesting in their own right, I couldn’t help but notice how a handful of underlying principles and themes emerged again and again. These are all things that I have come to value and apply to my own web work over the years, so I was chuffed to see such esteemed speakers share the same ideals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zDCo6ZpIDyxP-hH8vpLQeg.jpeg" /><figcaption>Web Standards legend and An Event Apart co-founder, <a href="https://medium.com/u/355cb93fe914">Jeffrey Zeldman</a>. Is it just me, or are celebrities always shorter than you expect in real life? ;-)</figcaption></figure><p>Web design and development is characterised by rapid and constant churn. Languages and browsers evolve, frameworks and libraries come and go, aesthetic styles go in and out of fashion and companies rise and fall. Amongst all that it can be difficult to spot and extract the valuable principles that will stand the test of time. The kinds of things that were good ideas years ago, are good ideas today and will most likely still be good ideas many years from now.</p><p>From several of the conference’s talks, here are a few such principles that stood out for me…</p><h3>Style guides are now standard</h3><p>Whenever any of the speakers touched on the process of actually designing and building a web experience, style guides got a mention. However, they weren’t called out as a newfangled, fancy way of doing things — rather, they were always mentioned matter-of-factly, as if to say: <em>Of course</em> we employ style guides, that’s just how we do things.</p><p>As someone who’s never been comfortable with static Photoshop comps and who’s actively been <a href="http://wiprodigital.com/2016/03/17/implementing-atomic-design-at-wipro-digital/">advocating the use of style guides at work</a> for some time now, I couldn’t agree more. Nonetheless, it is incredibly reassuring to see that style guides really have established themselves as an integral part of our web design and development craft.</p><p>As this approach begins to scale beyond individual projects, organisation-wide <a href="https://medium.com/buildit/design-systems-wtf-42956f673250">Design Systems</a> are emerging as the next big thing we need to focus on. Your UI style guide is now one component in a wider eco-system. Mr “Atomic Design” himself, <a href="http://bradfrost.com/">Brad Frost</a>, did a great talk on the ingredients and approaches needed to establish a successful Design System.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b2UkLz6hM8C5bM1BlWnwuA.jpeg" /><figcaption>Author of Atomic Design, <a href="https://medium.com/u/52f676b44c62">Brad Frost</a>. Seriously, what is it with celebs being shorter than me? Am I really that tall?</figcaption></figure><h3>Progressive Enhancement is as important as ever</h3><p>In a similar vein to style guides, Progressive Enhancement was repeatedly mentioned or shown as the de facto way we should be crafting web experiences. When discussing code, speakers invariably began with the careful choice of the most appropriate, semantic mark-up that would represent the information or functionality in the simplest possible form. Only then would CSS be added, including thoughtful styling fallbacks for cutting-edge CSS features. Finally they pointed out how the experience could be further enhanced using JavaScript.</p><p>As <a href="https://adactio.com/">Jeremy Keith</a> reminded us in his talk, Progressive Enhancement is very much about robustness. HTML is — by design — the most forgiving and also the most resilient of the languages we use. It is also the first thing the browser downloads, so, if for any reason that ends up being all that your users receive, it makes sense to ensure that it can at least provide the core experience. With that solid foundation in place, you can then enhance it as far as you like (or your budget allows).</p><p>By the way, <a href="https://medium.com/u/5271293d8452">Jeremy Keith</a> has since published an excellent — and free — web book on this subject: <a href="https://resilientwebdesign.com/">Resilient Web Design</a>.</p><h3>There’s more to UX than what you <em>see</em></h3><p>We live in a golden age of developer tools and frameworks. However, as much as they make our own lives easier, they by themselves will not aid the end user’s experience. We still need to be mindful of how our design and development choices can affect the user experience.</p><p>I often find that UX discussions focus primarily on the <em>visual</em> user interface and neglect many of the non-visual aspects of the experience such as: Performance, accessibility, reliability and coping with edge-cases. It was therefore refreshing to see so many talks highlight these topics.</p><p><a href="http://larahogan.me/">Lara Hogan</a> gave a great talk on performance and various techniques we can employ to improve our page load times. One noteworthy tidbit from that talk was the fact that 40% of users will abandon your site if it takes longer than 3 seconds to load. If that’s not proof that performance is an integral part of the user experience, I don’t know what is!</p><p><a href="https://twitter.com/feather">Derek Featherstone</a> encouraged us to practise “extreme design” — i.e. design for the edge cases amongst our spectrum of users. As he pointed out, if we solve a design problem for an extreme case we don’t just make the experience accessible to those specific users, we frequently produce an experience that is better for everyone.</p><h3>Device Agnosticism… duh!</h3><p>When <a href="https://medium.com/u/f4c52f5a54b0">Tim Berners-Lee</a> laid the foundations for what would become the Web, he was driven by a desire to allow scientists at CERN working on different kinds of computers, with different operating systems to share information with each other. These days we have a much greater diversity of devices accessing the Web, but the underlying principle that being agnostic to the user’s choice of browser, OS and device enables the broadest possible audience is as old as the Web itself and still every bit as important. Those that heed that principle and work <em>with</em> it rather than <em>against</em> it will reap its benefits.</p><p>People who used to build fluid layouts had a much easier time migrating to responsive layouts than those that were producing fixed-width, absolutely positioned, 960px layouts.</p><p>People who assumed their users would or wouldn’t do certain things on mobiles were <a href="http://globalmoxie.com/jhc/prez/mobile-myths.pdf">proven wrong</a> (and yet many made the same mistake again when tablets became mainstream). Meanwhile, those that didn’t artificially limit what users could and couldn’t do on their sites based on device were rewarded with more views, conversions and customer satisfaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_MEVnsNbtfA4aJSQYNx3Mg.jpeg" /><figcaption>Monsieur Responsive Web Design — <a href="https://ethanmarcotte.com/">Ethan Marcotte</a>. Finally found a tall one! And he clearly shares my refined taste in T-shirts!</figcaption></figure><p>A couple of talks looked at how to the Web is now evolving to incorporate even more devices. In “the Physical Interface”, <a href="https://twitter.com/bigmediumjosh">Josh Clark</a> showed many examples of how internet-connected gadgets and sensors are enabling us to expose and interact with Web resources in exciting, new ways. He also highlighted some of the ethical challenges we will need to grapple with when working with these things.</p><p><a href="https://medium.com/u/7558e26f1503">Cameron Moll</a>’s “Unified Design” explored how to provide our users with a consistent experience across all our web experiences as well as any other touch points we provide them with. Just working <em>on</em> any device is no longer enough. Users increasingly expect to be able to perform tasks <em>across</em> devices. He called out <a href="https://developers.google.com/web/progressive-web-apps/">Progressive Web Apps</a> as an area to watch, as they are one way that you might provide such services.</p><p>For me, these talks also reinforced the value of being device-agnostic: If your thinking, planning, designing and building has been device-agnostic, then you already knew that these developments were inevitable. None of this will come as a surprise and you’ll be ideally positioned to embrace the next wave of devices joining the Web (whatever they may be) and create amazing services across them that will excite your users.</p><h3>Conclusions</h3><p>Of course many interesting topics were covered beyond the few I’ve picked out above. For instance, thanks to <a href="https://medium.com/u/be9c04b39015">Rachel Andrew</a> and <a href="https://medium.com/u/d21301ee82b1">Jen Simmons</a>, I’m now super excited about CSS Grid support landing in mainstream browsers this year. As they explained and demonstrated, it can be applied <em>today</em> as a <em>progressive enhancement</em> to your current designs. Heh. There I go again pointing out those underlying, timeless principles!</p><p>While most presentations from this conference are not publicly available, <a href="https://aneventapart.com/news/post/orlando-2016-resources">a ton of supplementary materials</a> are. Plenty of <a href="https://aneventapart.com/news/tag/video">videos of talks</a> from various An Event Apart conferences are also available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*cYyMKqPKluFs5NPehZsCKw.jpeg" /><figcaption>The conference swag included this Blues Brothers inspired lunch box</figcaption></figure><p>Overall, I was very impressed by the conference. The speakers and talks were excellent. The venue was lovely (hell, we were next door to the <a href="https://disneyworld.disney.go.com/destinations/magic-kingdom/">Magic Kingdom</a>!). The food was tasty and the swag was cool. It was educational, inspirational and fun.</p><p>The speakers are also very approachable. Being able to say hello to some of the people who have influenced so much of how I think about and work with the Web was a real treat for me!</p><p>If I ever get a chance to attend An Event Apart again, I’d do so in a heartbeat!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45ce2001a050" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>