<?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 Scott Mathis on Medium]]></title>
        <description><![CDATA[Stories by Scott Mathis on Medium]]></description>
        <link>https://medium.com/@mathis_scott?source=rss-7499d9caf198------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Xjb0bU4bie50X8zI.jpg</url>
            <title>Stories by Scott Mathis on Medium</title>
            <link>https://medium.com/@mathis_scott?source=rss-7499d9caf198------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 01:59:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mathis_scott/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[Goodbye Clarity Icons, Hello Clarity Core!]]></title>
            <link>https://medium.com/claritydesignsystem/goodbye-clarity-icons-hello-clarity-core-adb07de9739e?source=rss-7499d9caf198------2</link>
            <guid isPermaLink="false">https://medium.com/p/adb07de9739e</guid>
            <category><![CDATA[vmware]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-components]]></category>
            <category><![CDATA[litelement]]></category>
            <category><![CDATA[clarity-design-system]]></category>
            <dc:creator><![CDATA[Scott Mathis]]></dc:creator>
            <pubDate>Wed, 10 Mar 2021 22:07:19 GMT</pubDate>
            <atom:updated>2021-04-22T17:46:34.126Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pqp8bMM8VOaQA0EEJ6UAxA.jpeg" /></figure><h3>Intro to Clarity Core</h3><p><a href="https://medium.com/claritydesignsystem/clarity-v4-how-clarity-expanded-and-improved-baabf1a98923">Clarity 4.0</a> was one of the most impactful releases in the history of the <a href="https://clarity.design/">Clarity Design System</a>. In 4.0, the new <a href="https://www.npmjs.com/package/@cds/core">Clarity Core package</a> of web components emerged from its 3.0 preview/beta status and introduced <a href="https://clarity.design/core-components/">almost two dozen new components</a>. Clarity also released the <a href="https://www.npmjs.com/package/@cds/react">Clarity React library</a> in 4.0, extending Clarity support for the first time to teams using React.</p><p>This is a huge milestone for Clarity and marks the beginning of <a href="https://medium.com/claritydesignsystem/claritys-future-user-focused-framework-independent-accessible-enterprise-ready-and-open-61a3f62eac93">a new era of framework independence</a>.</p><p>But something new rarely manifests without changing what has come before.</p><blockquote>With the 4.0 release, the <a href="https://clarity.design/icons">Clarity Icons</a> (<a href="https://www.npmjs.com/package/@clr/icons">@clr/icons</a>) package will be deprecated. The Clarity team’s current plan is to end-of-life Clarity Icons at a currently unspecified future date. After the 5.0 release, however, @clr/icons will have no new icons added to it and new major versions will stop at 5.0.</blockquote><h4>What?! Why do this?</h4><p>Clarity Icons was important to Clarity for a couple of reasons:</p><ol><li>It was one of the first projects <a href="https://medium.com/claritydesignsystem/the-road-to-svg-and-custom-elements-in-clarity-icons-1d691c6cc91">to use web components</a> to deliver a library of SVG icon glyphs. When I delivered the original proof-of-concept for Clarity Icons in November of 2016, the dominant implementation of icon libraries were “<a href="https://www.pluralsight.com/blog/creative-professional/icon-fonts">icon fonts</a>”. Icon fonts used icon glyphs that were accessed through <a href="https://en.wikipedia.org/wiki/Private_Use_Areas">the private use area (PUA) of a webfont</a>. This was a good solution at the time. But it had its limitations. <a href="https://cloudfour.com/thinks/seriously-dont-use-icon-fonts/">And then there was that <em>horse problem</em></a>. Clarity Icons allowed us to leave all of that behind and <a href="https://medium.com/claritydesignsystem/the-road-to-svg-and-custom-elements-in-clarity-icons-1d691c6cc91">embrace the future with web components and SVG</a>.</li><li>Clarity Icons were a precursor to our current <a href="https://medium.com/claritydesignsystem/claritys-future-user-focused-framework-independent-accessible-enterprise-ready-and-open-61a3f62eac93">framework-independent future</a>. While the web component portion of the original Clarity Icons package was not as full-featured as the web components in Clarity Core, Clarity Icons played a significant role in sparking conversations among the Clarity team about using web components as a basis for a full library of components. Even though the delivery of a Clarity web component library with <a href="https://www.npmjs.com/package/@cds/core">@cds/core</a> would ultimately make <a href="https://www.npmjs.com/package/@clr/icons">@clr/icons</a> redundant, there would not be a Clarity Core without Clarity Icons.</li></ol><p>Now that Clarity has delivered a library of web components, it makes sense for us to roll Clarity’s <em>library of web component icons</em> into the project where all the other web components live. And, while the <a href="https://www.npmjs.com/package/@clr/icons">@clr/icons</a> package is deprecated, its vision and mission will live on inside of Clarity Core.</p><h3>A great reason to use Clarity Core… tree-shaking!</h3><p>In addition to carrying forward the functionality and icons from the previous library, moving over to <a href="https://www.npmjs.com/package/@cds/core">@c</a>ds<a href="https://www.npmjs.com/package/@cds/core">/core</a> allows Clarity to offer upgrades to the library that will improve developer experience, bundle sizes, and performance.</p><p>When the original Clarity Icons library was created, our build architecture was not tree-shakeable. “Tree-shaking” here refers to the capability of <a href="https://rollupjs.org/guide/en/">build tools like Rollup</a> to remove unused JavaScript code from a project when it is bundled for delivery. The point of tree-shaking is to reduce the amount of JavaScript in an application by removing code that the application doesn’t need. Larger files take longer to download and longer for the browser’s JavaScript engine to parse.</p><p>Tree-shaking results in smaller bundles. So it’s a good thing.</p><p>When we began writing code for Clarity Icons, the Clarity team <a href="https://gulpjs.com/">was using Gulp</a> to package and deliver its component library. <a href="https://webpack.js.org/">Webpack</a> was the better part of a year away for us and getting the project on Rollup/Webpack and creating the icons library were parallel items of work. Clarity Icons was largely complete when the Rollup/Webpack work was just getting started.</p><p>As a result, tree-shaking was still just a thought experiment for us when @clr/icons was introduced. Many teams who have migrated their codebases from pre-Webpack to post-Webpack are likely familiar with the limbo of “we didn’t know what we didn’t know” when it comes to optimizing their project’s ability to treeshake.</p><blockquote>As a result of architectural decisions early on in the Clarity repository, Clarity Icons would not be tree-shakeable. <em>This meant that if you used one icon in an icon set all of its friends would be coming along for the ride!</em></blockquote><p>We identified this as a problem long before Clarity moved to Webpack in <a href="https://github.com/vmware/clarity/commit/3d00bd443b9100fcce1af6f3e95aa1a2218f9202#diff-b9cfc7f2cdf78a7f4b91a753d10865a2">version 0.10.8</a> (October 2017). But fixing this problem would require an overhaul of how our repository was structured and how the hundreds of icon glyphs were delivered.</p><p>Like technical debt in a lot of projects, re-writing the Clarity Icons library and re-structuring our build never jumped to the top of our list of priorities.</p><p><strong>Clarity Core gave us an opportunity to tackle this.</strong></p><p>As my colleague, <a href="https://medium.com/u/c2f4eb731d6e">Cory Rylan</a>, demonstrated <a href="https://medium.com/claritydesignsystem/design-system-performance-with-clarity-core-web-components-fbab56516f30">in a recent article</a>, being able to re-imagine a new component library from the ground up gave us an opportunity to redouble our focus on <a href="https://medium.com/claritydesignsystem/design-system-performance-with-clarity-core-web-components-fbab56516f30">improving performance, maintainability, and bundle-sizing</a>. The result has yielded a tree-shakeable library of icons. This makes the @cds/core icons library a significant upgrade over its predecessor.</p><h3>Migration</h3><p>By now, you are hopefully super-eager to <a href="https://clarity.design/get-started/developing/">jump onboard Clarity Core</a>. The migration path to the Core icons from any prior version of @clr/icons is straightforward because the Core icon library is backward-compatible to a large extent.</p><p>Here are the detailed steps for migrating from Clarity Icons to Clarity Core:</p><ol><li>Add <a href="https://clarity.design/get-started/developing/">@cds/core to your project</a>.</li><li>Substitute <strong>clr-icon</strong> web components in your application with <strong>cds-icon</strong>. A developer may be able to do a <em>find-and-replace</em> to complete this step.</li><li>Add icons to the <strong>ClarityIcons</strong> registry as needed. Depending on how ubiquitous the icons are in your application, this may be incredibly easy or a chore. Whether your team chooses to create an inventory list of all icon shapes in your application and then add them all in one big listing in the application module or whether your team prefers to add the icons on a component-by-component basis, Clarity Core icons offer multiple paths to migrate.</li></ol><p>Here’s an example of what a migration could look like:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Fcore-icons-migration-side-by-side%3Fembed%3D1&amp;display_name=StackBlitz&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Fcore-icons-migration-side-by-side&amp;image=https%3A%2F%2Fc.staticblitz.com%2Fassets%2Ficon-03bbb9acbba813917725387f46e5df03a95d232be240e910ce5f946a973b3f86.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/e88733041ddd36b84eea9fe1299e3a94/href">https://medium.com/media/e88733041ddd36b84eea9fe1299e3a94/href</a></iframe><h3>Core icons are backward-compatible but…</h3><p>In Core version 4.0, Clarity Icons’ full API — including all CSS classnames, icon shapes, and aliases — was re-implemented to make migration easier.</p><p>This legacy code, however, has been replaced with an improved API in 5.0.</p><p>For illustrative purposes, the following code examples demonstrate how tasks in Clarity Icons <em>(before)</em> can be accomplished with Clarity Core <em>(after 5.0)</em>.</p><p>Note that Clarity Core versions 3 and 4 are under the <a href="https://www.npmjs.com/package/@clr/core">@clr/core package name on npm</a>. In versions 3 and 4, the CSS classname-based API of Clarity Icons’ “clr-icon” component should work as expected but we recommend applications migrate to the new Clarity Core code examples.</p><h3>Using Icons</h3><p>Previously, using an icon in Clarity required importing the Clarity Icons CSS file <em>and</em> the @clr/icons file.</p><blockquote>Including a CSS file to display icons is no longer necessary in Clarity Core.</blockquote><p>In addition, loading the <em>@clr/icons</em> file would automatically load the “core set” of icons. Clarity Core no longer does this. To use an icon in your application, it must be added to the @cds/core ClarityIcons service as shown below.</p><p>Clarity Core also has a separate registration file for the icon web component that needs to be imported.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d0f0e04451f41613120fb2ca16178f3/href">https://medium.com/media/6d0f0e04451f41613120fb2ca16178f3/href</a></iframe><p>As before, icons are rendered in your application via a custom element (a.k.a. web component). That has remained the same but the prefix of the web component’s tag name has been changed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5062801431ff401dee20f126d8ecec41/href">https://medium.com/media/5062801431ff401dee20f126d8ecec41/href</a></iframe><h4>Why change the tag name prefix?</h4><p>Tag names in <a href="https://www.npmjs.com/package/@clr/angular">@clr/angular</a> and <a href="https://www.npmjs.com/package/@clr/icons">@clr/icons</a> are prefixed with <em>“clr-”</em> and all tag names in <a href="https://www.npmjs.com/package/@cds/core">@cds/core</a> are prefixed with <em>“cds-”</em>.</p><p>To prevent namespace collisions and overloading for teams using Clarity Core alongside Clarity Angular (or even Clarity Icons by itself), Clarity Core (<a href="https://www.npmjs.com/package/@cds/core">@cds/core</a>) could not use the same tag name as the other Clarity libraries.</p><p>We did not want to force users to choose between Core and Clarity Angular or Clarity UI, so we needed them to work alongside one another to some degree. Changing the prefix for Clarity Core’s web components was the best path forward to achieve that.</p><blockquote>While the old <em>“clr-”</em> prefix was a derivative of the word “clarity”, the <em>“cds-”</em> prefix is an abbreviation of the phrase “Clarity Design System”.</blockquote><h3>How to add icons to the API</h3><p>Clarity Icons could always add custom icon glyphs to the icon registry and share them across an application. <em>@cds/core</em> supports this as well.</p><p>As mentioned previously, the 4.x Clarity Core icons API is backward-compatible. So all of your old code will still work if you point it to the v4 or earlier Clarity Core icons API — assuming you’ve changed your tagnames from <em>&lt;clr-icon&gt; </em>to <em>&lt;cds-icon&gt;</em>.</p><p>Support for this legacy API will no longer be available after 5.0.</p><p>That makes this is a great opportunity to learn how to move forward with Clarity Core after legacy support ends.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/becbd810110481ee76067e4c923f3ffa/href">https://medium.com/media/becbd810110481ee76067e4c923f3ffa/href</a></iframe><h4>Why “addIcons()” when “add()” is more succinct?</h4><p>When we delivered the Clarity Core icon API, we wanted to make sure we had <em>at least one version</em> that was backward-compatible. addIcons() was the clearest choice for a method name because add() was already taken by the legacy API. We couldn’t change the call signature (a.k.a. the type and number of arguments passed to the add() method) without breaking backward-compatibility.</p><p>In the future, add() will be re-introduced as a method of the Clarity Core Icons API but will be an alias for the existing <em>addIcons()</em> method. So, in the future, the Clarity Core Icons API add() static method will have an identical call signature to the current addIcons() class method.</p><h4>What are you doing in the arguments with the arrays?</h4><p>Technically, the icon name and shape “array arguments” are <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html#tuple"><em>tuples</em></a>. They are easy to work with and don’t carry around a lot of the baggage associated with a vanilla JavaScript object. No checking for hasOwnProperty and all that.</p><p>One day, JavaScript will have <a href="https://github.com/tc39/proposal-record-tuple">a true tuple data structure</a>. Until then, we have this “array thing”.</p><h3>Add a custom icon</h3><p>We’ve gone over the method that will add an icon to the Clarity Core Icons API. But we haven’t covered how to format a custom icon to have it fully integrated with the API.</p><p>There are a couple of ways to do this. One way is straightforward and requires a bare minimum of work on a developer’s part. The second way makes a custom icon a first-class citizen inside Clarity Core but requires a little more understanding of the internals of the icons API.</p><p>Let’s go over both of these approaches now.</p><h4>Using an SVG</h4><p>The easiest way to add an icon to the Clarity Core icons API is to pass an icon name and the SVG of the icon as a string in the tuple argument of ClarityIcons.addIcons().</p><ul><li>The appeal of this approach is that it is easy. There’s not a lot of extra work to get from an SVG that a designer sent you to a glyph stored in the API.</li><li>The drawback of this approach is that the badging, status colors, and other functionality will not be available for that icon. It will only render what you pass to it.</li><li>Make sure you remove widths and heights from the <em>&lt;svg&gt;</em> tag itself. These might introduce unintended side effects when sizing your icon.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b2e1b0a7fdfe526a238642b9a1c67d88/href">https://medium.com/media/b2e1b0a7fdfe526a238642b9a1c67d88/href</a></iframe><h4>Using an icon template</h4><p>Those who are familiar with Clarity Icons understand that the icon components do a lot more than store an SVG in a registry. So how can you create an icon that takes advantage of all that built-in functionality?</p><p>The answer is using a Clarity Core<strong><em> icon template</em></strong>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Fcore-icons-migration-add-custom-icon%3Fembed%3D1&amp;display_name=StackBlitz&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Fcore-icons-migration-add-custom-icon&amp;image=https%3A%2F%2Fc.staticblitz.com%2Fassets%2Ficon-03bbb9acbba813917725387f46e5df03a95d232be240e910ce5f946a973b3f86.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb152a408382e1c110908fc269e893cc/href">https://medium.com/media/fb152a408382e1c110908fc269e893cc/href</a></iframe><ul><li>The renderIcon() function in the example above converts your <em>icon template</em> into an SVG. It builds the SVG for you and applies the formatting the icons library needs to be able to show solid, outlined, badged, and alerted icons when you tell it to.</li><li>Icons inside an icon template should be <a href="https://medium.com/claritydesignsystem/how-to-design-clarity-icons-a443b19ad84b">designed with a 36px x 36px viewbox</a>.</li><li>The icon template accepts &lt;path&gt;,<em> </em>&lt;circ&gt;,<em> </em>&lt;rect&gt;… virtually any SVG you throw its way. SVG wrapped in a &lt;g&gt; tag or other nested SVG structures may cause problems for it, however. Pass only flat paths and shapes and make sure that all SVG shape tags are self-closing (&lt;path … /&gt;<em> </em>instead of &lt;path …&gt;&lt;/path&gt;).</li><li>In the early days of Clarity Icons, we had trouble using CSS styling to customize strokes in some problematic browsers. As such, our library has always recommended <a href="https://medium.com/claritydesignsystem/how-to-design-clarity-icons-a443b19ad84b"><em>using filled paths instead of strokes</em></a>. This has not changed. Icon templates will be your best friend if you convert strokes and fonts in your glyphs to outlines/paths before exporting SVG from your vector art program of choice.</li><li>Not all of the properties in an icon template need to be defined. In the example, my-dot only has an outline and solid path. custom-icon has paths for everything! Core icons are smart enough to fallback to outline if you don’t have a solid variant or the solid or outline variant if badged and alerted variants are requested but not defined.</li><li>Including the badge-dot or warning-triangle in your badged and alerted paths is not necessary. The icon service applies those for you. But your icon will look better if it <a href="https://medium.com/claritydesignsystem/how-to-design-clarity-icons-a443b19ad84b#c8cd">allows space for the circular badges and warning triangles</a>. Even still, the icon library will apply the dot or triangle over any path you send it if the badged and alerted properties are defined in the icon template, as shown with custom-icon in the example.</li></ul><h3>Aliases and sets</h3><p>The Clarity Icons API gave users the ability to “alias” icon glyphs under different names and also load large sets of icons all at once.</p><p>This meant you could refer to icon glyphs by different names like “menu” instead of “bars”, “settings”, or “gear” instead of “cog”. In addition, <em>sets</em> gave users the ability to load dozens of icons with a single command. A lot of that changes in Clarity Core.</p><p><strong>Don’t use sets. </strong>With Clarity Core, we recommend <em>against</em> loading sets of icons because it presents challenges with tree-shaking. Products rarely use all the icons in a set and it is not wise to load all 129 icons in the “<em>essential</em>” set yet only use ten of them. Clarity recommends adding icons as they are needed. This is the optimum way to ensure applications remain lean and performant.</p><p><strong>Add icons, don’t alias them. </strong>As far as aliasing goes, <em>@clr/core</em> supports aliasing in 4.0. But we have a preference for <em>adding</em> icons instead. It does the same thing under the hood and there is no need for an application to be required to use Clarity’s naming conventions. Feel free to name our icons anything that makes sense for your application’s domain.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c30c31d3c35ea392005c1dbf5fcc8e2/href">https://medium.com/media/6c30c31d3c35ea392005c1dbf5fcc8e2/href</a></iframe><h3>Using an icon in your app</h3><p>Besides the new <em>cds-</em> prefix, using a Clarity Core icon in your application is no different than it was in <em>@clr/icons</em>.</p><p>But the new Core icon library has given us an opportunity to improve the developer experience.</p><p>The following examples are going to compare and contrast common use cases in <em>@clr/icons</em> with the preferred way to do the same thing in <em>@cds/core. </em>There are some running themes and migration should feel logical once a developer has a little practice migrating a couple of features.</p><h4>Size</h4><p>A stealth improvement in <em>@cds/core </em>is related to how icons can be sized. Previously, a <em>@clr/icons</em> component could be sized in one of two ways: setting the <em>style attribute</em> on the icon or passing a <em>numeric string</em> into the icon’s size attribute.</p><p>The numeric string approach caused problems for teams with <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP">strict content security policies</a>. This is because passing a number to the size of the attribute on the &lt;<em>clr-icon&gt;</em> element causes the web component to programmatically set its own style attribute. Some CSPs view this as a violation.</p><p>Clarity Core improved the size attribute so that it can now accept <strong><em>t-shirt size</em></strong> values <em>(xs, sm, md, lg, xl, xxl)</em>. T-shirt sizes resolve those CSP concerns by setting the icons to a handful of predefined dimensions without writing to the style attribute.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/851380e22f89f9a0d2e1e9bb84fb58b0/href">https://medium.com/media/851380e22f89f9a0d2e1e9bb84fb58b0/href</a></iframe><h4>Direction</h4><p>As with the old <em>@clr/icons</em> web component, users can set an attribute to rotate the icon glyph. In <em>@clr/icons</em>, this was the <em>dir</em> attribute. In <em>@cds/core</em>, the attribute is <strong><em>direction</em></strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d2c8c09532ff54b6ea9a5925b0a4d17/href">https://medium.com/media/5d2c8c09532ff54b6ea9a5925b0a4d17/href</a></iframe><p><strong><em>But, wait, there’s more!</em></strong></p><p><em>@cds/core</em> also introduces the <strong><em>flip</em></strong> attribute. This inverts the icon along its horizontal or vertical axis.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4e1641d3f16c43c6b45acdfff3c98af/href">https://medium.com/media/a4e1641d3f16c43c6b45acdfff3c98af/href</a></iframe><h4>Solid</h4><p>Similar to other items listed above, <em>@cds/core </em>accomplishes the same thing as the legacy <em>@clr/icons </em>did but by using an HTML attribute instead of a CSS classname.</p><p>This is consistent with how solid and outlined (filled and not filled) icons are rendered.</p><p>In <em>@clr/icons</em>, users had to use the <em>is-solid</em> classname on the web component to display an icon’s solid variant. In <em>@cds/core</em>, users only need to add the <strong><em>solid</em></strong> boolean attribute.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f62232eae4ce2a89c4492c4337477870/href">https://medium.com/media/f62232eae4ce2a89c4492c4337477870/href</a></iframe><h4>Inverse</h4><p>An <em>“inverse”</em> icon is an icon that is filled with a light color instead of a dark color. By default, this color is white. These are helpful when you need an icon on a dark background.</p><p>The difference between Clarity Core and Clarity Icons should start to feel familiar by this point.</p><blockquote>Instead of burdening applications with Clarity-specific CSS classnames, Clarity Core accomplishes the same styling through HTML attributes. This is consistent throughout all of our components in Clarity Core.</blockquote><p>As with solid icons, inverse icons used to use the <em>“is-inverse”</em> classname in <em>@clr/icons</em>. But now they use the <strong><em>inverse</em></strong> attribute.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5cfa94edd720e216310f36d3254db124/href">https://medium.com/media/5cfa94edd720e216310f36d3254db124/href</a></iframe><h4>Statuses and Colors</h4><p>Clarity Icons also allowed for the icon glyphs to show in a number of predefined colors (green, ochre, red, and blue) in addition to the icon inheriting its host element’s text color (generally the default dark gray).</p><p>These colors are aligned with statuses in Clarity and constitute the familiar triad of <em>“stoplight colors” –</em>success, warning, and danger–with blue as an “info” or highlight color.</p><p>As with the other cases above, <em>@cds/core </em>uses an attribute — called <strong><em>status</em></strong> — where <em>@clr/icons </em>used a CSS classname.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8086d368c25fcf9419f7b81fa9014191/href">https://medium.com/media/8086d368c25fcf9419f7b81fa9014191/href</a></iframe><h4>Badged and Alerted</h4><p>In both Clarity Core and Clarity Icons, icon glyphs can have “badged” and “alerted” variants. These variations feature a decoration in the top right corner of the icon glyph.</p><ul><li>For “badged” icons, this decoration is a <strong>round dot</strong>.</li><li>For “alerted” icons, this decoration is a <strong>triangle</strong>.</li></ul><p>This remains consistent in Clarity Core and Clarity Icons.</p><p>In <em>@clr/icons</em>, badges and alerts on icons were shown by adding a CSS classname. If you didn’t skip ahead, the next part should come as no surprise.</p><blockquote>In <em>@cds/core</em>, badges and alerts are shown by adding an HTML attribute.</blockquote><p>Clarity Core has one new twist that was not available in <em>@clr/icons</em>, however.</p><p>Both the alerted (or “triangled”) icons and badged (or “dotted”) icons can now be set to an <em>“inherit”</em> mode.</p><p>An <em>inherit-mode </em>means that the icon decoration will display with the same color as the rest of the icon.</p><p>By default, the badged dot is red and the alert triangle is dark orange (a.k.a. ochre). By setting them to inherit the color of the rest of the icon, you make the badge, the triangle, and the rest of the icon all one color.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b09e541d9d4eca5031e780d215edcb1a/href">https://medium.com/media/b09e541d9d4eca5031e780d215edcb1a/href</a></iframe><h3>In summary</h3><p>The introduction of <em>@cds/core</em> gave the Clarity team an opportunity to revisit Clarity Icons and improve its API and performance. Now that those upgrades have been introduced, it’s time to say goodbye to <em>@clr/icons</em>.</p><blockquote>The @<em>clr/icons </em>package<em> </em>has been deprecated in 4.0 and will end-of-life in the future. The exact date has not been determined (yet).</blockquote><p>It is recommended that all teams using <em>@clr/icons </em>migrate to <em>@cds/core</em> as soon as possible. The 4.x version of the <em>@clr/core </em>library is fully compatible with the public API of <em>@clr/icons</em>. We did this to give teams a chance to migrate at their own pace. But no new icon glyphs will be added to <em>@clr/icons </em>and no future support will be given to it after it reaches end-of-life.</p><p>The Clarity team is incredibly grateful for <em>@clr/icons</em>. The effort of <a href="https://medium.com/u/e1852758089c">Shijir Tsogoo</a> and many others put Clarity on the bleeding edge of icon libraries as one of the first SVG and web component-based solutions in early 2017. It also served as the proving ground for what eventually became Clarity Core and our drive for framework-independence.</p><p>We hope that current users of Clarity Icons will find that <a href="https://clarity.design/foundation/icons/">the icon library in Clarity Core</a> carries forward the innovations introduced in Clarity Icons. We also invite current users of <em>@clr/icons </em>to join us on our journey as we <a href="https://medium.com/claritydesignsystem/clarity-core-72f6d3a029bc">continue to embrace web standards and a framework independent future</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adb07de9739e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/claritydesignsystem/goodbye-clarity-icons-hello-clarity-core-adb07de9739e">Goodbye Clarity Icons, Hello Clarity Core!</a> was originally published in <a href="https://medium.com/claritydesignsystem">Clarity Design System</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clarity Core]]></title>
            <link>https://medium.com/claritydesignsystem/clarity-core-72f6d3a029bc?source=rss-7499d9caf198------2</link>
            <guid isPermaLink="false">https://medium.com/p/72f6d3a029bc</guid>
            <category><![CDATA[web-components]]></category>
            <category><![CDATA[custom-elements]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vmwareclarity]]></category>
            <category><![CDATA[clarity-design-system]]></category>
            <dc:creator><![CDATA[Scott Mathis]]></dc:creator>
            <pubDate>Mon, 28 Oct 2019 19:38:12 GMT</pubDate>
            <atom:updated>2019-10-28T19:38:12.437Z</atom:updated>
            <content:encoded><![CDATA[<h4>Our design system’s journey to framework independence</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pl0fa62cPfW6qUQfCtEyHA.png" /><figcaption>“Clarity Rocket” by Stela Stamenkova-Din</figcaption></figure><p><a href="https://medium.com/claritydesignsystem/claritys-future-user-focused-framework-independent-accessible-enterprise-ready-and-open-61a3f62eac93">Two weeks ago, we announced the work we’ve been doing</a> behind the scenes to build Clarity Core, a framework-independent design system based on web components. At a high level, these are our five key goals and drivers:</p><ul><li>Clarity is <strong>user-focused</strong>. Its design patterns are and will continue to be driven by our users.</li><li>Clarity is <a href="https://medium.com/claritydesignsystem/a-commitment-to-accessibility-56dcb88af5c2"><strong>committed to accessibility </strong>and inclusive design</a>.</li><li>Clarity is <strong>enterprise-ready </strong>and we think that raises the bar for usability.</li><li>Clarity has <a href="https://github.com/vmware/clarity">always been and is committed to <strong>remaining open source</strong></a>.</li><li>A big part of Clarity’s future will involve <strong>framework independence</strong>.</li></ul><p>My colleagues have already written about <a href="https://medium.com/claritydesignsystem/a-commitment-to-accessibility-56dcb88af5c2">our commitment to accessibility</a> and the efforts to which we have gone as a team to build an inclusive library of components. Today we will address that last bullet point — <em>framework independence</em>.</p><h3>What is framework independence?</h3><p>A front-end framework is (generally speaking) code written by an outside group or organization that ships with a web application. A framework typically handles the following features:</p><ul><li><em>Routing: </em>switching “pages” of the application without taking you to a new page</li><li><em>Data-binding: </em>when you change information in one place it shows up correctly in another</li><li><em>State management: </em>maintaining consistency of data so that everything remains as expected when you go from one page to another</li></ul><p>Frameworks can do more than this, surely, but that’s the gist of what they do. And <a href="https://github.com/tastejs/todomvc/tree/master/examples">there are hundreds of them</a>.</p><p>For the past decade, the front-end development community has been at the center of a veritable tempest of JavaScript frameworks. The most popular frameworks in use today are <a href="https://reactjs.org/">React</a>, <a href="https://angular.io/">Angular</a>, <a href="https://emberjs.com/">Ember</a>, and <a href="https://vuejs.org/">Vue</a>. And the landscape has been fairly rocky over the past 9 years, leading many to distrust that the current status quo will remain such for very long. That last part is called “framework fatigue” or sometimes “<a href="https://medium.com/@ericclemmons/javascript-fatigue-48d4011b6fc4#.prcj59904">javascript fatigue</a>”.</p><p>In the early days, Clarity rallied around Angular as a way to materialize our design system in a library complex, data-bound components and bring our product teams at VMware together on a common tech stack. This was a huge success for us as we saw the vast majority of products at VMware choosing Angular and Clarity to build their applications.</p><p>The good news is that we will continue to support and drive Angular adoption across the company. But the better news is that our patterns, services, and components will now be available to teams who rely on <a href="https://vuejs.org/">Vue</a>, <a href="https://reactjs.org/">React</a>, <a href="https://emberjs.com/">Ember</a>, <a href="https://elm-lang.org/">Elm</a>, or any other framework.</p><p>We feel strongly that the future of all viable component libraries is framework independence and our plan is to deliver on this belief.</p><h3>How are we going to do this?</h3><p>Our plan is to deliver a core set of <a href="https://developers.google.com/web/fundamentals/web-components/customelements">web components</a> in an npm package we are calling Clarity Core. In addition to these components, the Clarity Core library will contain helpers, mixins, services, and utilities that are generally useful across <a href="https://clarity.design/documentation">Clarity Angular</a>, Clarity Core, and <a href="https://clarity.design/icons">Clarity Icons</a>.</p><blockquote>Clarity Core will become a foundational piece of the existing Angular library we have because Clarity Angular will reuse its services and components.</blockquote><h3>Why web components?</h3><p>At this point in time, web components are a <a href="https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements">mature web standard</a>. They are available in <a href="https://caniuse.com/#feat=custom-elementsv1">almost every modern browser</a> and support can be polyfilled back to browsers that lack support.</p><p>We know that custom elements can work across all the browsers we support and that this is the right time to embrace them as a foundation for the Clarity Design System.</p><h3>How will this affect the Angular library?</h3><p>Clarity Core will not affect consumers of the Clarity Angular at all. Even when Clarity Core components and services are used as a foundational piece of the Clarity Angular library, the teams who rely on Clarity Angular will not know or need to know that it is there.</p><blockquote>The goal is to make this as minimally impactful to existing Clarity Angular applications as possible.</blockquote><p>An Angular application should not know or care whether a Clarity component is written 100% in Angular or is built on top of a Clarity Core component.</p><p>Additionally, Clarity will always rely on frameworks to do what they do best because it would be counter-productive for us to try and rebuild a framework inside of a library of web components. Our #1 framework at VMware is Angular, so we are committed in the long-term to supporting and growing Clarity Angular.</p><h3>I’ve had a hard time with web components in React. How does this help me?</h3><p>For the last few months, members of the Clarity team have been doing a deep dive into integrating web components with React applications. At the end of our journey, we identified an architecture of “<em>React wrappers</em>”. We’ve reviewed this architecture with some of VMware’s best React developers to make sure we had their stamp of approval before moving forward.</p><h3>How are you building this?</h3><p>The Clarity team put a lot of effort into researching the best path forward for this library. In the end, we identified <strong><em>three key attributes</em></strong> that we wanted to preserve:</p><ul><li>The architecture of the Clarity Core components library would be <strong><em>familiar </em></strong>enough that contributors with experience working with Clarity Angular could contribute to Clarity Core without a steep learning curve.</li><li>The APIs of the current Angular components would transfer as closely as possible to help manage situations where a current Angular component would be moving to the web component library.</li><li>The code underneath would adhere as closely as possible to emerging web standards as we continue to bet on web standards for the future.</li></ul><p>After several explorations into a variety of possibilities, we arrived at <em>five foundations</em> for the Clarity Core architecture. Note that the following is a deeper dive into the technical aspects of Clarity Core. If that’s not something that interests you, please jump forward to the next question.</p><ol><li><strong>Typescript</strong></li></ol><p><a href="http://www.typescriptlang.org/">Typescript</a> is a super-set of Javascript. It is a combination of a type-checker and transpiler. If you are writing Angular code, you are no doubt already familiar with its benefits. Carrying this forward into the Clarity Core component library is fundamental to the goal of the codebase remaining familiar to developers who have been working on Clarity Angular in the past.</p><p>2. <strong>Custom Properties</strong></p><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties">CSS Custom Properties</a> are the future and this is one big bet we are making on web standards. Custom properties <a href="https://caniuse.com/#feat=css-variables">already work in all major browsers</a>.</p><p>Additionally, custom properties are the most direct way to enable theming in a library of ShadowDOM encapsulated web components.</p><p>3. <strong>Lit Element</strong></p><p><a href="https://lit-element.polymer-project.org/">Lit element</a> is an incredibly solid and light foundation upon which to build a library of web components. Lit is maintained by the Polymer team at Google and our esteem for this library has grown the more we have worked with it.</p><p>Besides being a very lightweight dependency, Lit follows web standards — which was important to us because we believe web standards are the future. It also feels great to have your sole, major dependency be such a thin layer above the code running in the browser itself.</p><p>Lit is more than syntactic sugar, but one would be excused for viewing it as a convenient base class and nothing more. The simplicity and transparency of Lit also support our desire to keep the architecture as easy to work with as possible.</p><p>4. <strong>Minimally Stateful</strong></p><p>In our research, we wanted to make sure that Clarity Core components would be easy to use for product teams working in Angular or React. For extra credit, we also dove into Vue and a couple of other frameworks. We did hit a minor speed bump, however.</p><blockquote>Angular’s views and change detection cycle are just different enough from React’s Flux architecture and Virtual DOM that the way a developer works in one framework may not necessarily follow in the other framework.</blockquote><p>Sure, Angular developers have NgRx and can use that for state management combined with advanced (or some would say proper) use of RxJS to implement the Flux architecture in their Angular applications. But we do not have the luxury of only supporting one implementation of the Angular application architecture.</p><p>It also became clear early on that the current Clarity Angular library of components offers functionality tied to Angular. This constituted functionality that it would make no sense for us to replicate in a library of web components.</p><p>To be more specific, we are talking about features in Angular like reactive forms, routing, and two-way binding. While most frameworks have their own spin on these features, it became clear that most frameworks weren’t always in alignment on the details. In the end, we found <em>there was no one ideal solution</em>.</p><p>Our team now jokingly refers to the task of building frameworks-within-frameworks as “<em>Frankenstein Angular</em>” and have decided against re-building “framework features” into a framework-agnostic library of components.</p><blockquote>Instead, we decided the best path forward was to adopt a strategy of being “<strong>minimally stateful</strong>”.</blockquote><p>There are some features of a component that it would be tiresome to have to turn on and off from your application. Being “minimally stateful” means we will handle those tasks for you, track them for you, and communicate any changes so you can keep your application’s state current if you need to.</p><p>But we also concluded that any features of a component that an application developer might reasonably want to circumvent should be driven and managed by the application’s state — not from within the component.</p><p>As a consequence, a datagrid in Clarity Core won’t manage large chunks of data like the datagrid in Clarity Angular does. Likewise, a wizard in Clarity Core won’t be managing the state of its pages and the user’s ability to navigate them in the same way either.</p><p>While this may be a little surprising for developers used to monolithic, black-box components that gobble up hundreds of lines of JSON configurations, we feel confident that this will ultimately be liberating for application developers because it puts a level of customization in their hands that other libraries cannot match.</p><p>It also lowers the requirements for developers to invest in learning a component library API — especially one that may run counter to their framework of choice.</p><p>5. <strong>Reduce Through Reuse</strong></p><p>Ultimately, Clarity Core will be a refinement of the vision that resulted in the current library of Angular components.</p><blockquote>The intent with this new initiative is not to duplicate the effort with an unrelated library that requires separate support, maintenance, and its own entire team. The real value of Clarity Core, for us, is in what we can abstract and reuse.</blockquote><p>There are going to be some components in Clarity Angular that will always be built on top of Angular–even if they have a replicate in Clarity Core. But many, if not most, components in our Angular library will become wrappers for Clarity Core components. This will help our team differentiate between framework-driven features and core features of the components we deliver.</p><h3>How do we get there?</h3><p>We have a lot of work ahead of us and some effort towards fixing up the current Clarity architecture to allow for a new library of web components.</p><p>Presently, our roadmap to web components looks something like this:</p><h4>CSS Custom Properties–3.0 release (Nov-Dec 2019)</h4><p>Refactoring Clarity to use CSS Custom Properties is a big task — and one we completed just this month! We started by proving that we could use custom properties in all our supported browsers and reliably use them across the Shadow DOM.</p><p>The implementation involved cleaning up some technical debt in our SASS/CSS and then a significant chore of creating all the CSS Custom Properties. In addition, we handled the delivery in a way that isn’t a huge breaking change for teams that don’t need to theme their applications or prefer to use the SASS-based theming we support today through 3.0.</p><blockquote>But to fully realize the benefits of the web components in Clarity Core, we have to deprecate SASS-based theming in 3.0. <strong>This means, starting in 4.0, CSS Custom Properties will be the only way to theme Clarity applications.</strong></blockquote><h4>Move Clarity Icons to Core–3.0 release (Nov-Dec 2019)</h4><p>The <strong>Clarity Icons migration</strong> is our first proving ground for the Lit-based architecture and a fundamental effort towards delivering our set of essential components.</p><h4>Foundational Components–Q1 2020</h4><p>Following the icons migration, we will see more <strong>foundational components </strong>entering the fray.</p><blockquote>By “<em>foundational components</em>”, I mean components upon which more complex components depend. We cannot, for example, have an “icon button” without icons–or buttons.</blockquote><h4>Strategic Components–2020</h4><p>After we complete our foundational components, we plan to move on to <em>“strategic components”</em><strong> </strong>through the remainder of 2020. This phase two of component delivery will not constitute <em>all</em> of the components in Clarity Angular today but it will be a good number of them.</p><p>When designating something as a strategic component, we are looking for components that satisfy one of three criteria:</p><ol><li>Components that <strong><em>fill an immediate need</em></strong> with a component that non-Angular teams interested in using Clarity do not have access to today…</li><li>Components that <strong><em>augment the Clarity Angular library </em></strong>with components that the library currently doesn’t have, and…</li><li><strong><em>High-value components </em></strong>that are not easily replicated using the HTML and CSS Clarity currently offers.</li></ol><p>This may mean that we don’t jump right into forms. Maybe we focus on something like the datepicker. Or the wizard.</p><blockquote>It all depends on the intersection of need, value, and availability.</blockquote><h4>Contribution Guidelines–Nov 2019</h4><p>Our contribution guidelines<strong> </strong>will be released early on during our work on the “foundational components”. By nature, these components will be simpler in implementation. There will be a lot of “low hanging fruit” componentry that we will not be tackling right out of the gate as we focus on foundational components and more complex, strategic components. This makes this a fertile ground for external contributions and, if you’re looking to contribute, <a href="https://github.com/vmware/clarity/wiki/Contributing">keep an eye out for those contribution guidelines</a>!</p><h4>React Wrappers (2019 on…)</h4><p>Lastly, the foundational component work will introduce our library of <strong>“react wrappers” </strong>for Clarity Core. So keep an eye on those for a preview of how we plan to support React teams with Clarity Core.</p><h3>In Closing</h3><p>When it comes to components geared towards building websites and web applications, we feel the future of the web is <strong><em>framework independence</em></strong>. That doesn’t mean frameworks go away.</p><blockquote>But it does mean that component libraries that rely on a framework for their delivery will become less useful.</blockquote><p>As one of the founders of Clarity, I can say that this team has always bet on the web. Whether it was ES2015/ES6, CSS3, SVG, or HTML5, we unanimously believed the best path forward was adopting web standards.</p><p>We have proven that the time is right for web components and we feel confident that the time is right for Clarity Core.</p><p>Please <a href="https://github.com/vmware/clarity">keep an eye on our github repository</a> as work on Clarity Core progresses! And <a href="https://github.com/vmware/clarity/issues/3668">keep an eye on this RFC</a> for more details and discussion on the architecture of Clarity’s next leap forward.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72f6d3a029bc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/claritydesignsystem/clarity-core-72f6d3a029bc">Clarity Core</a> was originally published in <a href="https://medium.com/claritydesignsystem">Clarity Design System</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hello, 1.0!]]></title>
            <link>https://medium.com/claritydesignsystem/hello-1-0-257d728ee04b?source=rss-7499d9caf198------2</link>
            <guid isPermaLink="false">https://medium.com/p/257d728ee04b</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[user-interface]]></category>
            <category><![CDATA[vmware]]></category>
            <category><![CDATA[clarity-design-system]]></category>
            <dc:creator><![CDATA[Scott Mathis]]></dc:creator>
            <pubDate>Fri, 30 Nov 2018 15:22:31 GMT</pubDate>
            <atom:updated>2018-11-30T15:22:31.816Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qHV5N9ddRj0LSfk0i96JAw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/7TfsJqvT6TQ?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Alexander Kagan</a> on <a href="https://unsplash.com/search/photos/rocket-launch?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Today, the <a href="https://vmware.github.io/clarity/">Clarity Design System</a> is releasing version 1.0 of its library of Angular components, HTML and CSS framework, and icons library.</p><p>Before I go too far into what that means for our community, I would like to take a moment and acknowledge what a tremendous achievement this is. <a href="https://medium.com/claritydesignsystem/unveiling-project-clarity-73a19f0e562">When we started Clarity</a>, our hope was to bring consistency, sustainability, good citizenship, and great design to VMware’s suite of products.</p><p>Our journey led us to open source Clarity, followed by widespread adoption by VMware and several other large corporations, and finally emerging as one the most popular open source projects in VMware’s history. It has been a privilege to be a part of the Clarity team these past few years.</p><p>Here’s a quick countdown:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RTB34PKA7VDN2H5_KL7mRQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/MnSYYYqunXA?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Mike Szczepanski</a> on <a href="https://unsplash.com/search/photos/three?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Three</h3><p>Clarity is three years old.</p><p>When we began, we worked together to create what is today known as the Clarity Design System — a suite of HTML/CSS and Angular components built upon web standards and opinionated UX patterns. Our team started out driven by a commitment to improving user experience and making something that would be easy for our designers and developers to use.</p><p>These have been our guiding lights and continue to inspire us every day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WyfmFJpMEcKwb99KIjZJ2w.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/tQagUWpAx5k?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Priscilla Du Preez</a> on <a href="https://unsplash.com/search/photos/two?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Two</h3><p>In November of that first year, the Clarity Design System went open source.</p><p>We have now been open-source for two years. This has been a huge benefit to our partners and third parties who rely on VMware products, customize workflows for VMware products and build plug-ins on which their own customers rely.</p><p>Moreover, the open source community has been passionate, engaged, and supportive. External contributors account for 1 out of 20 issues that are resolved <a href="https://github.com/vmware/clarity">in our Github repository</a>. Many of these contributions are significant, like the alerts pager and bug fixes for our datagrid.</p><p>We are thankful to have such a strong community that is so committed to the success of Clarity. It is one of the reasons we have been able to deliver 1.0 to you today! ❤️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TwUUCOHt6DqJLt6FXBOn1w.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/d-pPg9pnZRY?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Agence Producteurs Locaux Damien Kühn</a> on <a href="https://unsplash.com/search/photos/one?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>1.0</h3><p>From its humble beginnings of being hosted on a computer we found underneath our design lead’s desk, the last stretch towards 1.0 has seen Clarity grow, mature, and attain new heights.</p><p>Our team members are regularly sharing their knowledge and experience at Angular conferences all over the world, including ngChina, ngAtlanta, and ngConf in Salt Lake City this year alone.</p><p>We have proven to be a valued project in the Angular community. Companies both large and small are choosing Clarity.</p><p>Even during our pre-1.0 days, the stability and maturity of our library far exceeded its age. Despite an aggressive release schedule, we have had only 8 patch releases to date. This means that we have averaged one regression every 4 months over a span of 128 weeks.</p><p>This is a direct result of the Clarity team’s commitment to putting UX first, building on top of web and accessibility standards, and putting a premium on doing things right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GnFhsaoOF6BvMJhvfFXzWw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/KTpSVEcU0XU?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Vladislav Babienko</a> on <a href="https://unsplash.com/search/photos/crossroads?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>What’s Next?</h3><p>After 96 consecutive weeks of releasing at least one version of Clarity every Thursday (even on holiday weeks!), <a href="https://medium.com/claritydesignsystem/updating-the-clarity-release-and-support-strategy-c1e37f7d5a0">our team is embracing a model of long-term support that follows the release schedule of the Angular library</a>. This makes sense because Angular is one of the only dependencies our library has.</p><p>We can also now use major, minor, and patch versions <a href="https://semver.org/">as intended in semantic versioning</a>. We will also be able to release minor and patch versions off-schedule when changes are ready for our users.</p><p>Soon, the Clarity team will be meeting to build our roadmap for 2.0. We have a lot of features to discuss and we plan to <a href="https://github.com/vmware/clarity/wiki/Work-in-progress">continue being as transparent as we can with our community about what we are working on and why</a>.</p><p>This has been an exciting three years. But this is just a milestone, not an end. After 1.0, I’m sure we will have a few growing pains with the new delivery model but I’m confident that the team that got us here is capable of moving us forward.</p><p>Thank you to everyone who has contributed to making this a reality! I look forward to the next phase of our epic journey as we continue our commitment to great code, usable components, and exceptional user experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=257d728ee04b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/claritydesignsystem/hello-1-0-257d728ee04b">Hello, 1.0!</a> was originally published in <a href="https://medium.com/claritydesignsystem">Clarity Design System</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Road to SVG and Custom Elements in Clarity Icons]]></title>
            <link>https://medium.com/claritydesignsystem/the-road-to-svg-and-custom-elements-in-clarity-icons-1d691c6cc91?source=rss-7499d9caf198------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d691c6cc91</guid>
            <category><![CDATA[icons]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[design-systems]]></category>
            <dc:creator><![CDATA[Scott Mathis]]></dc:creator>
            <pubDate>Wed, 04 Jan 2017 16:47:09 GMT</pubDate>
            <atom:updated>2017-01-04T16:47:09.083Z</atom:updated>
            <content:encoded><![CDATA[<p>From <a href="http://fontawesome.io/">Font Awesome</a> to the next most-awesome-thing to happen to your icons, this article will talk about <a href="https://vmware.github.io/clarity/">Project Clarity</a>’s winding path <a href="https://vmware.github.io/clarity/documentation/iconography">to its own icon system</a>. It will also give you a behind-the-scenes look at the research we did to create Clarity Icons.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5j9ZQe5-eUBAvEZu-e2Lww.png" /></figure><h3>In the beginning: The awesome and not-so-awesome</h3><p>When the Clarity project started out, our team was focused on delivering a design system composed of UI components that were useful and easy to adopt. Initially, Clarity’s iconography was supplied by the ubiquitous <a href="http://fontawesome.io/">Font Awesome</a> library. But we hit limitations with tying our visual identity to an icon system that was designed outside of Clarity as our set of components evolved.</p><p>The strokes in Font Awesome were thicker than our typography, meaning the icon glyphs dominated the text in many cases. The aesthetic of the icons also looked mismatched as our visual style became more opinionated and concrete. As a design system which primarily supported VMware products, we also found that we needed imagery specific to our business’ use cases.</p><p>This meant we needed icons that third party icon fonts did not provide. To complicate matters further, our applications rarely used more than 12% of Font Awesome’s icons. We were loading hundreds of glyphs to use somewhere between 10–20 of them. This constituted an inefficient use of our resources, loading multiple files in most cases only to use a small fraction of their content. It also created maintenance issues with having more than one source of truth for our iconography.</p><p>The choice became clear that the Clarity team would need to provide their own set of icons that complemented the visual design of Project Clarity.</p><h3>Our first evolution: SVGs as backgrounds</h3><p>To maintain the ease-of-use that made Font Awesome so convenient, our first icons were delivered as <a href="https://css-tricks.com/using-svg/#article-header-id-4">SVG backgrounds</a>. This allowed us to generate and <a href="https://jsfiddle.net/smathis/5s2htqL7/">bundle the icons with the CSS</a> and was a painless transition for our end-users.</p><blockquote>Before — With FontAwesome<br>&lt;i class=“fa fa-check”&gt;&lt;/i&gt;</blockquote><blockquote>After — SVGs as background images<br>&lt;span class=”clr-icon clr-icon-success”&gt;&lt;/span&gt;</blockquote><p>Using SVGs as base64 background images worked well until our icon library began to grow. Our teams needed to have glyphs in different colors — white icons for dark backgrounds, green icons for success, and red icons for errors.</p><p>The problem with our “SVG as backgrounds” approach was that each variation required a completely new icon to be generated as a base64 image in our CSS package.</p><p>As you can imagine, this was not scalable and would penalize all of our users with a hefty CSS download, even users who didn’t want to use our icons.</p><p>Shortly after putting Font Awesome behind us, we found ourselves needing to evolve one step further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LREZmFRaNYr7z8xnalphuA.jpeg" /><figcaption>Photo by Joshua Earle. Courtesy of Unsplash.com.</figcaption></figure><h3>Considering options and requirements</h3><p>The Clarity team wanted to explore all of our options in this next phase because we knew whatever we decided would introduce a breaking change. We maintain a design systems used by dozens of products across VMware and aspired to become an open-source project available to teams across the globe. We have always taken the stability of our library seriously and tend to think long and hard about changes to our codebase that introduce work for our end-users.</p><p>Because of this, we knew that we needed to <em>commit</em> to an icon system. We could not change our approach every few releases. We needed to weigh our options, choose a path, and stay on course for a very long time, if not indefinitely.</p><p>To help us make this choice, we identified several requirements:</p><p><strong>Opt-out.</strong> While we hoped that our icon system would be compelling, we believed that Clarity users who opted out should not be unduly penalized. We agreed that it should be easier for people to use Clarity Icons with the design system, but users should not be forced to download a huge set of SVGs or an icon font that they did not plan to use. Opting out needed to be an option.</p><p><strong>Sizing. </strong>Our research showed us that icon fonts and the various flavors of delivering SVGs yielded better and worse results when scaling icons down. We also found quirks in scaling icons up and dealing with positioning inside of containers. We wanted to make sure we chose an approach that didn’t hoist this kind of pain onto our users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*2ZdCQlEDUTOFWYI1lVbBPA.png" /><figcaption>“Badging” an icon</figcaption></figure><p><strong>Multi-colored.</strong> Additionally, the team did a heuristic analysis of what products needed from our design system’s iconography. One of the most common requirements was <a href="https://jsfiddle.net/smathis/8d5w545t/">badging</a>. Badging required an icon to support at least two colors. We needed an icon system that would allow the use of multiple colors within the same glyph without a lot of hassles or brittle code.</p><p><strong>Interactive patterns.</strong> In addition to supporting multiple colors in one glyph, our users also needed to be able to add interactivity to the icon set. This meant we needed a system that made animation, hover, and click effects easy to implement — preferably through custom CSS or by using classnames included with the Clarity Icon library.</p><p><strong>Extensibility and scale.</strong> We needed to be able to extend our set of icons to ridiculous numbers without a negative impact to our end users. We also wanted an easy way for users to add custom icons to our icon system so that applications could be built from one source of truth, instead of several icons in one icon font, still more in an image sprite, and another group of icons in a separate font.</p><p><strong>Future facing. </strong>In the interest of full disclosure: yes, we did look at CSS sprites! There are some Clarity-based applications that use them. But it’s already clear that the industry is moving towards vector graphics for icons. One thing the Clarity team wanted to do was propose a solution that embraced the future. We did not want to introduce an icon system that saddled our users with an antiquated approach right out of the gate. We wanted Clarity Icons to be as cutting edge and as forward thinking as it could be, even if it meant short-term pain for our development team with packaging (or writing) polyfills and supporting legacy browsers.</p><h3>Revisiting SVG as backgrounds</h3><p>With our intentions illustrated above, let’s take a look at how “SVG as backgrounds” measured up:</p><p><strong>✕ Opting Out: </strong>This was not an option unless users recompiled Clarity’s SASS files to strip out the base64 backgrounds.<br><strong>✔︎ Sizing: </strong>This approach performed well in this regard. The background would size to its container using the `background-size: contain` CSS style. It was also SVG-based so it looked good at small sizes and on different form factors.<br><strong>✕ Multi-colored: </strong>This was doable but it required generating a new SVG background for every color combination. So “doable” but not scalable.<br><strong>✔︎ Interaction and animation: </strong>In terms of very basic interaction and animation, “SVG as backgrounds” worked fine. But depending on the desired effects, it might require additional versions of the SVG.<br><strong>✕ Grouping and scale: </strong>While the base64 images could be delivered in separate SASS files, it would be a pain for Clarity users to strip them out. Scale was also a concern because we were looking at a matrix of possible color variations against stylistic variations like outlined and solid icons.<br><strong>✔︎ Future outlook: </strong>While “SVG as backgrounds” was not the right choice for Clarity, it is a good option for an application that has a well-defined use case for icons. It is vector-based and easy to work with. Our challenge with it grew from needing our icon system to be packaged with Project Clarity and the requirement that we support many unknown use cases to deliver a flexible icon system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*rY9H8XG4nKQaUbiQAzz_Ew.png" /><figcaption>Punchy select boxes! Not to call anyone out. But PUA conflicts are going to be a source of tremendous hilarity over the next several years. Taken from my iPhone about a month ago.</figcaption></figure><h3>Icon fonts: It’s not you, it’s us</h3><p>Our first alternative exploration was, of course, icon fonts. Icon fonts have been going strong for at least eight years now. They are vector-based and generally easy to work with. Everyone on the team was familiar with using icon fonts like Font-Awesome and icon font generators like <a href="https://icomoon.io/app/">icomoon</a>. Our intent was to test if this approach met our requirements.</p><p><strong>✕ Opting Out:</strong> I will preface this by saying this is usually not a problem. But the Clarity Project tries to deliver an encapsulated version of its look and feel by bundling the fonts it uses into the CSS. Good or bad, this gives our users one less thing to worry about accompanied by the negative of making it a challenge for users to opt out without recompiling the SASS.<br><strong>✕ Sizing:</strong> Creating a font is a very specialized skill set and doing it properly requires a good deal of know-how, experience, and tools beyond the standards of Sketch or Illustrator. Even well-designed icon fonts can present challenges with baseline alignment and blurriness at smaller sizes. We encountered this when we created an exploratory icon font using our icon glyphs and icomoon.<br><strong>✕ Multi-colored:</strong> The immediate rebuttal here is “stack icons”. But stack icons did not get a thumbs-up from us for a variety of reasons. First, it meant we had to introduce various bits of these icons into the UTF-8 PUA which was already strained across form factors. Second, positioning at scale was tricky and fraught with misalignment. And third, styling these individual layers of iconography meant layers and layers of very brittle pseudo-selector code in the CSS.<br><strong>✕ Interaction and animation:</strong> The icon font was capable of very basic animation and interaction. Anything more complex required a perfect storm of CSS styling, positioning, and properly sized glyphs. For us, it was a house of cards and felt frail and inflexible.<br><strong>✕ Grouping and scale:</strong> This was a “no” that owed more to our delivery than a limitation of the technology. The easy answer is that users could load separate CSS files for each icon set. But this was not a good answer for our situation because we bundle our fonts as base64 in the CSS. Additionally, it would require us to manage the PUA of our sets diligently to avoid conflicts. Ultimately, we could not guarantee that our end-users would not use their own icon fonts to supplement ours. In this spirit, the team preferred to stay away from PUA altogether.<br><strong>✕ Future outlook:</strong> Icon fonts are not going anywhere. But neither are CSS sprites. As SVG-based icons become easier to use, we believe SVG-based iconography will be viewed as the preferable solution. Then again, wingdings are still a thing.</p><h3>SVG references in the &lt;use&gt; tag</h3><p>Another approach we examined was inlining SVG with the “use” tag. This would allow us to store our SVGs in one location and reference them anywhere else we wanted to. The only catch was it required us to insert large SVG files in the DOM somehow. While not as big of a requirement for a single-page application using Clarity Angular, this seemed a heavy-handed for other use cases — especially if we were talking about a page that only needed two or three of the icons in the set.</p><p>Additionally, we found SVGs in the “use” tag to be finicky with fills, strokes, and shapes. With this approach, we found our CSS selectors could not really drill-down into the SVG. Our options were limited to hacks using the “fill” and “currentColor” styles. This would have been fine for a smaller set of icons with clearly defined functionality and a developer who was well-versed in these hacks.</p><p>But it wasn’t going to work for us because our framework, by definition, needed to be flexible.</p><p><strong>✕ Opting Out: </strong>While simply not loading the SVG file with the icon “defs” in it is the most obvious task in opting out, Clarity users would also have had to locate and remove `use` tags from our templates. In a large application, this was not viable.<br><strong>✔︎ Sizing: </strong>SVGs via the `use` tag could be sized up and down easily. Being SVGs, they were clear at very small sizes and across form factors. But we did encounter problems when using them inline, alongside text. This approach would have required effort to align the icons to the text baseline, in some cases we found this effort was not broadly applicable.<br><strong>✕ Multi-colored: </strong>This was a “yes and no” for “use” tags. “use” tags could handle the bare minimum of this requirement. But it was such a chore to navigate fill and currentColor stylings that we believed this approach fell short in this regard.<br><strong>✕ Interaction and animation: </strong>We found the implementation of our sample animations and interactions to be clunky and overly complex. There was one interaction that never worked the way we wanted it to in our exploration.<br><strong>✔︎ Grouping and scale:</strong> This approach allowed us to deliver icons in sets that users could choose to include or remove as they needed them. This was good, although it put an added responsibility on our users to include SVG files in their DOM. It also meant that we needed a very clear strategy for naming conventions for these icon sets to avoid naming collisions with HTML IDs both across sets and within the DOM.<br><strong>✕ Future outlook: </strong>Of the three most popular approaches for using SVG icons, this is the one that we projected as having the weakest legs. The control over the SVG is extremely limited, especially when compared to the challenges involved with the limited styling options. While a valid approach in the short-term, we couldn’t find a reason why anyone would be doing this a half-decade from now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UXf2N9IevL5dqZC4FiVhEg.jpeg" /><figcaption>Photo by Agberto Guimaraes. Courtesy Unsplash.com.</figcaption></figure><h3>Custom Elements: We have a winner!</h3><p>Due to the flow of these kinds of stories, one might imagine that the winner of the Clarity Icons Bake-Off was saved for last. And that would be correct.</p><p>In the end, the team decided on injecting SVG into an <a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components/Custom_Elements">HTML5 custom element</a>. The big downside is that it <em>does</em> require JavaScript to define the custom elements. But the JavaScript aspect also offered an upside in terms of opting out and customization, described later.</p><p>One significant advantage of this approach was being able to manipulate SVG in your DOM with vanilla CSS. Disadvantages included custom elements having limited support, especially in legacy browsers, as well as the general inline SVG downside of images loading and not really being cached. Note that last downside hasn’t been an issue for us thus far.</p><p><strong>✔︎ Opting Out:</strong> Opting out of this approach is as straightforward as not loading the “clarity-icons.js” file in your application. But you can still use the custom element tags “clr-icon” and their corresponding “shape” attributes to alias to any icon font or CSS background image that you would rather use. So a big thumbs-up here for opting out.<br><strong>✔︎ Sizing: </strong>SVG-based. Predictable sizing, as with “SVG as backgrounds”. Yep, pretty awesome here as well.<br><strong>✔︎ Multi-colored: </strong>Because this produces inline SVG, CSS can manipulate the SVG all the way down to individual paths . Every path within an icon can have its own color and even transitions between colors with a simple CSS selector. This is true for the CSS included with the Clarity Icons package, as well as any custom CSS written by end-users.<br><strong>✔︎ Interaction and animation: </strong>Another big win for inline SVG. We were able to accomplish interactions and animations with very simple and readable CSS that were impossible with other approaches.<br><strong>✔︎ Grouping and scale: </strong>Because we include our SVG inside a JavaScript framework, it’s easy for us to manipulate our set of icons, create aliases for those icons, and add or remove icons from the set. There’s an issue with whether or not users will need to download the full set of icons inside the JavaScript. But we are working on that in the hope that we can deliver Clarity Icons with just the icons a user needs.<br><strong>✔︎ Future outlook: </strong>Custom elements are a “thing”. They are part of the <a href="https://www.w3.org/TR/custom-elements/">HTML5 spec</a> and <a href="http://caniuse.com/#feat=custom-elementsv1">one day will be available in every major browser</a>. After working with Clarity Icons, we feel strongly that this is the way people will be using icon libraries in the future. Our confidence was bolstered when <a href="https://www.kickstarter.com/projects/232193852/font-awesome-5">Font Awesome announced that the pro version of FA5</a> will offer an “SVG icon framework” that sounds very similar to what we have built with Clarity Icons. We’re happy to be at the forefront of this tectonic shift in how people build iconography in their applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/1*nCEGhgPvkQBw7d-VSeQ_dA.png" /><figcaption>Take THAT, icon font! And I even zoomed the browser in on this so I could screen-shot it. This is a hover effect from our icon research, btw. Accomplished with just a few lines of CSS applied to a custom element.</figcaption></figure><p>To conclude our Clarity Icons travelogue, here’s a final look at where we started and where we wound up:</p><blockquote>Where We Started — FontAwesome<br>&lt;i class=“fa fa-check”&gt;&lt;/i&gt;</blockquote><blockquote>Halfway There — SVGs as backgrounds<br>&lt;span class=”clr-icon clr-icon-success”&gt;&lt;/span&gt;</blockquote><blockquote>Where We Wound Up — Clarity Icons!<br>&lt;clr-icon shape=“success”&gt;&lt;/clr-icon&gt;</blockquote><p>Not too shabby!</p><p>Our next article on Clarity Icons will demonstrate the practical benefits of our icon system and how to use it to create your own custom library of SVG-based icons.</p><p>Until then, <a href="https://vmware.github.io/clarity/documentation/iconography#guidelines">check out our evolving documentation</a> and keep an eye out for bigger, better, and more coming soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d691c6cc91" width="1" height="1" alt=""><hr><p><a href="https://medium.com/claritydesignsystem/the-road-to-svg-and-custom-elements-in-clarity-icons-1d691c6cc91">The Road to SVG and Custom Elements in Clarity Icons</a> was originally published in <a href="https://medium.com/claritydesignsystem">Clarity Design System</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>