<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Caity Opelka</title>
    <description>The latest articles on DEV Community by Caity Opelka (@imcaity).</description>
    <link>https://dev.to/imcaity</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F515806%2F1d905f35-a7cc-43d0-8d43-16cae145044d.png</url>
      <title>DEV Community: Caity Opelka</title>
      <link>https://dev.to/imcaity</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/imcaity"/>
    <language>en</language>
    <item>
      <title>Testing Library: More than a Great Name</title>
      <dc:creator>Caity Opelka</dc:creator>
      <pubDate>Mon, 22 Mar 2021 14:01:51 +0000</pubDate>
      <link>https://dev.to/imcaity/testing-library-more-than-a-great-name-1726</link>
      <guid>https://dev.to/imcaity/testing-library-more-than-a-great-name-1726</guid>
      <description>&lt;p&gt;For much of my coding bootcamp experience, I've done a lot of test-driven development, but those tests have mostly, if not always, targeted the algorithms and individual parts of the components rather than the behaviors triggered by someone who is interacting with the app. There's a tool available with perhaps the most genius name, making it easily searchable even if you can't remember it: Testing Library (That's probably what you entered into the search bar, right?).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://kentcdodds.com/" rel="noopener noreferrer"&gt;Kent C. Dodds&lt;/a&gt; created React Testing Library in 2018. He had been using and teaching Airbnb's Enzyme, a library with a lot of different capabilities. With so many options available in Enzyme, he found that he spent a lot of time trying to teach which parts of Enzyme were considered the current best practice before he could begin to teach functionality. Instead of continuing to waste time, he shifted his focus. He wanted to build a smaller library that encouraged better testing practices, and so React Testing Library was born. Realizing that most of the APIs were not React-specific, he eventually released its core as DOM Testing Library as well.&lt;/p&gt;

&lt;p&gt;Note that it is a utility library, not a framework, so it doesn't replace suites like Mocha and Jest but rather works alongside them. Its purpose is to test the UI, or how the user interacts with the app. In the example below that is included in &lt;a href="https://testing-library.com/docs/example-react-router" rel="noopener noreferrer"&gt;Testing Library's documentation&lt;/a&gt;, this test is specifically targeting a route built with React Router.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;full app rendering/navigating&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;renderWithRouter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/you are home/i&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBeInTheDocument&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;leftClick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;button&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;userEvent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/about/i&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;leftClick&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/you are on the about page/i&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBeInTheDocument&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;landing on a bad page&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;renderWithRouter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;route&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/something-that-does-not-match&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/no match/i&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBeInTheDocument&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rendering a component that uses useLocation&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;route&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/some-route&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="nf"&gt;renderWithRouter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;LocationDisplay&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;route&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByTestId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;location-display&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toHaveTextContent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;route&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How is this different from Enzyme? Testing Library is checking the DOM nodes, so it's testing the behavior of your application from a user's perspective. Enzyme, on the other hand, checks the actual components for things like props and state. A typical user isn't concerned with props or state but rather that their expectations are met when they navigate to a page, open a modal, or click a button. With Testing Library, though the code may change within the components, the functionality should remain intact, which means you won't have to refactor the tests every time you refactor the components.&lt;/p&gt;

&lt;p&gt;Testing the UI can be done by manually navigating and clicking around the site to test its functionality, but as an app increases in size, so does the time it takes to check all of the necessary behavioral aspects. Testing Library is a great tool to automate these checks by mimicking the interactions a user may have while using an app. I look forward to implementing it in future projects.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://www.npmjs.com/package/@testing-library/react" rel="noopener noreferrer"&gt;React Testing Library&lt;/a&gt; can be installed with&lt;br&gt;
&lt;code&gt;npm install --save-dev @testing-library/react&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and the &lt;a href="https://www.npmjs.com/package/@testing-library/dom" rel="noopener noreferrer"&gt;DOM Testing Library&lt;/a&gt; can be installed with&lt;br&gt;
&lt;code&gt;npm install --save-dev @testing-library/dom&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Building a Simple Footer with SVG Icons</title>
      <dc:creator>Caity Opelka</dc:creator>
      <pubDate>Tue, 16 Mar 2021 03:53:09 +0000</pubDate>
      <link>https://dev.to/imcaity/building-a-simple-footer-with-svg-icons-4951</link>
      <guid>https://dev.to/imcaity/building-a-simple-footer-with-svg-icons-4951</guid>
      <description>&lt;p&gt;If you're looking for icons to build any app, there are plenty of libraries and resources available with great premade options, but sometimes you just need something that's custom.&lt;/p&gt;

&lt;p&gt;Let's talk about SVGs. An SVG is a scalable vector graphic. That means that no matter its size, it maintains clean lines. A vector graphic can be resized because its shape is defined by mathematical precision. On the other hand, a raster graphic loses its integrity when it is shown larger than its original size. See below for a visual representation with the vector on the left and the raster on the right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9tpjeqyqwukowi9s8yj0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9tpjeqyqwukowi9s8yj0.jpg" alt="Vector vs. Raster" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You're probably wondering why even bother creating an SVG if the icon is going to be small anyway? Imagine that you have created all of these icons as PNGs, which is a file type that can be created with a transparent background. If you want to change the background in the app behind the PNG, it's as easy as changing the CSS, but if you want to change the color of the icon itself, it &lt;em&gt;can't&lt;/em&gt; be done without changing the original icon file and then replacing the image in the app.&lt;/p&gt;

&lt;p&gt;Because an SVG is just built with math, it's not only scalable but it's also just code. This means that it is possible to style it with your regular CSS, so if you want to change its fill color, it can be targeted without having to change the image outside of the code.&lt;/p&gt;

&lt;p&gt;Also note that because SVGs are just code, another benefit over using PNGs or other image file types is that no requests have to be made to find the images to retrieve them from wherever they are located, resulting in a lighter app.&lt;/p&gt;

&lt;p&gt;Sounds pretty neat, right? Let's start building that footer.&lt;/p&gt;

&lt;p&gt;For the sake of brevity, because SVGs tend to have a fair amount of code, I'll only show three icons, but you can use as many as you would like. It's tempting to plug in the icons like below, and this will absolutely render them to the page, but those paths are pretty long. Imagine adding links and having to sift through this big chunk of code if you needed to make a change.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;footer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;footer-wrap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;svg&lt;/span&gt; &lt;span class="nx"&gt;xmlns&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://www.w3.org/2000/svg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;footer-icon&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M21.63,29A11,11,0,0,1,19,28.66l-2.46,6.53a18.16,18.16,0,0,0,5.08.81,17.78,17.78,0,0,0,8-1.93l-3.59-6A10.83,10.83,0,0,1,21.63,29Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M39.57,19.11h-7a10.86,10.86,0,0,1-3.88,7.28l3.64,6.08A18,18,0,0,0,39.57,19.11Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M10.61,18a11,11,0,0,1,3.33-7.8L9.65,4.61a17.93,17.93,0,0,0,4,29.49l2.5-6.6A11,11,0,0,1,10.61,18Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M21.63,7a11,11,0,0,1,10.76,9h7.12A18.06,18.06,0,0,0,21.63,0a17.1,17.1,0,0,0-1.88.19L21.08,7C21.26,7,21.45,7,21.63,7Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M18.05,7.68,16.7.73a17.66,17.66,0,0,0-4.58,2l4.31,5.61A12.07,12.07,0,0,1,18.05,7.68Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/svg&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;svg&lt;/span&gt; &lt;span class="nx"&gt;xmlns&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://www.w3.org/2000/svg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;footer-icon&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M38.07,32.51H7.51l4.22-15.86.19.7a1.51,1.51,0,0,0,.86,1,1.44,1.44,0,0,0,.62.13,1.49,1.49,0,0,0,.69-.16l2.12-1.07,1.28,5.38a1.58,1.58,0,0,0,.89,1.06L23.83,26l7.6,4.65a1.51,1.51,0,0,0,.8.22h5.84a1.72,1.72,0,0,0,1.53-1.74,1.54,1.54,0,0,0-1.53-1.54l-5.25.07-7.49-4.57L20.48,21l-1.59-6.67a1.5,1.5,0,0,0-.85-1,1.47,1.47,0,0,0-.65-.15,1.59,1.59,0,0,0-.69.17l-2.17,1.09L13.19,9.5a1.53,1.53,0,0,0-3,0L7.09,21.29V1.53A1.53,1.53,0,0,0,5.56,0H5.13A1.54,1.54,0,0,0,3.6,1.53V34.47A1.54,1.54,0,0,0,5.13,36H38.07a1.54,1.54,0,0,0,1.53-1.53V34A1.53,1.53,0,0,0,38.07,32.51Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/svg&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;svg&lt;/span&gt; &lt;span class="nx"&gt;xmlns&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://www.w3.org/2000/svg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;footer-icon&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;M14.29,12.43a3.37,3.37,0,0,0,.35.89l.95,1.48c1.08,1.7,2.2,3.45,3.45,5.08A3.56,3.56,0,0,0,21.59,21l.35,0A3,3,0,0,0,24,18.84,3.44,3.44,0,0,0,22.82,16c-1.61-1.21-3.35-2.28-5-3.32l-1.44-.9a4.5,4.5,0,0,0-1-.41l-1.69-.65.33.93C14.15,12,14.22,12.22,14.29,12.43Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;M39.46,15.25C38.62,7.65,31.16.54,23.51,0h-.4A3.45,3.45,0,0,0,19.4,3.61c0,.9,0,1.8,0,2.7V7.65a2.91,2.91,0,0,0,.68,2.15,2.19,2.19,0,0,0,1.65.57h0c2.22-.06,2.2-2.15,2.19-2.84V4.91l.55.08a7.8,7.8,0,0,1,1.59.34A12.9,12.9,0,0,1,34.9,16.16c.77,5.28-1.29,9.71-6,12.8a13.17,13.17,0,0,1-7.35,2.21A12.78,12.78,0,0,1,12.1,27.1C7.27,21.81,7,15.25,11.29,9.55c.4-.53.77-1.09,1.13-1.61l.6-.89-.12-.24c-.47-.93-1.24-2.17-2.42-2.17A3,3,0,0,0,8.4,5.86,17.84,17.84,0,0,0,3.72,20,18,18,0,0,0,11.47,32.6,17.52,17.52,0,0,0,21.55,36,17.78,17.78,0,0,0,31.09,33C37.41,29.05,40.3,22.9,39.46,15.25Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/svg&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/footer&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's make it easier to maintain. Ideally, it would be nice to find some separation from those long paths. Luckily, there's an element for that. According to &lt;a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use" rel="noopener noreferrer"&gt;MDN&lt;/a&gt;, "the &lt;code&gt;&amp;lt;use&amp;gt;&lt;/code&gt; element takes nodes from within the SVG document, and duplicates them somewhere else." Let's push the paths down, placing each one in a &lt;code&gt;&amp;lt;symbol&amp;gt;&lt;/code&gt; tag and giving them each an individual &lt;code&gt;#id&lt;/code&gt;. Then, we'll use the &lt;code&gt;&amp;lt;use&amp;gt;&lt;/code&gt; tag at the top and refer back to the id to reference the symbol.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;footer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;footer-wrap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;svg&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;footer-icon&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#chart&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/use&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/svg&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;svg&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;footer-icon&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#graph&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/use&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/svg&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;svg&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;footer-icon&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#timer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/use&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/svg&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;svg&lt;/span&gt; &lt;span class="nx"&gt;xmlns&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://www.w3.org/2000/svg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hide-bottom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;symbol&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;chart&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="nx"&gt;viewBox&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0 0 43.2 36&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M21.63,29A11,11,0,0,1,19,28.66l-2.46,6.53a18.16,18.16,0,0,0,5.08.81,17.78,17.78,0,0,0,8-1.93l-3.59-6A10.83,10.83,0,0,1,21.63,29Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M39.57,19.11h-7a10.86,10.86,0,0,1-3.88,7.28l3.64,6.08A18,18,0,0,0,39.57,19.11Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M10.61,18a11,11,0,0,1,3.33-7.8L9.65,4.61a17.93,17.93,0,0,0,4,29.49l2.5-6.6A11,11,0,0,1,10.61,18Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M21.63,7a11,11,0,0,1,10.76,9h7.12A18.06,18.06,0,0,0,21.63,0a17.1,17.1,0,0,0-1.88.19L21.08,7C21.26,7,21.45,7,21.63,7Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M18.05,7.68,16.7.73a17.66,17.66,0,0,0-4.58,2l4.31,5.61A12.07,12.07,0,0,1,18.05,7.68Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/symbol&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;symbol&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;graph&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="nx"&gt;viewBox&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0 0 43.2 36&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M38.07,32.51H7.51l4.22-15.86.19.7a1.51,1.51,0,0,0,.86,1,1.44,1.44,0,0,0,.62.13,1.49,1.49,0,0,0,.69-.16l2.12-1.07,1.28,5.38a1.58,1.58,0,0,0,.89,1.06L23.83,26l7.6,4.65a1.51,1.51,0,0,0,.8.22h5.84a1.72,1.72,0,0,0,1.53-1.74,1.54,1.54,0,0,0-1.53-1.54l-5.25.07-7.49-4.57L20.48,21l-1.59-6.67a1.5,1.5,0,0,0-.85-1,1.47,1.47,0,0,0-.65-.15,1.59,1.59,0,0,0-.69.17l-2.17,1.09L13.19,9.5a1.53,1.53,0,0,0-3,0L7.09,21.29V1.53A1.53,1.53,0,0,0,5.56,0H5.13A1.54,1.54,0,0,0,3.6,1.53V34.47A1.54,1.54,0,0,0,5.13,36H38.07a1.54,1.54,0,0,0,1.53-1.53V34A1.53,1.53,0,0,0,38.07,32.51Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/symbol&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;symbol&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;timer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="nx"&gt;viewBox&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0 0 43.2 36&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;M14.29,12.43a3.37,3.37,0,0,0,.35.89l.95,1.48c1.08,1.7,2.2,3.45,3.45,5.08A3.56,3.56,0,0,0,21.59,21l.35,0A3,3,0,0,0,24,18.84,3.44,3.44,0,0,0,22.82,16c-1.61-1.21-3.35-2.28-5-3.32l-1.44-.9a4.5,4.5,0,0,0-1-.41l-1.69-.65.33.93C14.15,12,14.22,12.22,14.29,12.43Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;M39.46,15.25C38.62,7.65,31.16.54,23.51,0h-.4A3.45,3.45,0,0,0,19.4,3.61c0,.9,0,1.8,0,2.7V7.65a2.91,2.91,0,0,0,.68,2.15,2.19,2.19,0,0,0,1.65.57h0c2.22-.06,2.2-2.15,2.19-2.84V4.91l.55.08a7.8,7.8,0,0,1,1.59.34A12.9,12.9,0,0,1,34.9,16.16c.77,5.28-1.29,9.71-6,12.8a13.17,13.17,0,0,1-7.35,2.21A12.78,12.78,0,0,1,12.1,27.1C7.27,21.81,7,15.25,11.29,9.55c.4-.53.77-1.09,1.13-1.61l.6-.89-.12-.24c-.47-.93-1.24-2.17-2.42-2.17A3,3,0,0,0,8.4,5.86,17.84,17.84,0,0,0,3.72,20,18,18,0,0,0,11.47,32.6,17.52,17.52,0,0,0,21.55,36,17.78,17.78,0,0,0,31.09,33C37.41,29.05,40.3,22.9,39.46,15.25Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/symbol&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/svg&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/footer&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice also that the className has now moved to the &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; tags that wrap the &lt;code&gt;&amp;lt;use&amp;gt;&lt;/code&gt; elements. From there, all you have to do is add your links and style the footer however you like.&lt;/p&gt;

&lt;p&gt;A few extra tidbits about these SVGs. If you notice, each one is made up of paths. Just like with other html elements, you can give the paths a class or an id and style them individually as well. To illustrate this, let's go a little crazy with the path colors.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;symbol&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;chart&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="nx"&gt;viewBox&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0 0 43.2 36&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;path-pink&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M21.63,29A11,11,0,0,1,19,28.66l-2.46,6.53a18.16,18.16,0,0,0,5.08.81,17.78,17.78,0,0,0,8-1.93l-3.59-6A10.83,10.83,0,0,1,21.63,29Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M39.57,19.11h-7a10.86,10.86,0,0,1-3.88,7.28l3.64,6.08A18,18,0,0,0,39.57,19.11Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;path-orange&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M10.61,18a11,11,0,0,1,3.33-7.8L9.65,4.61a17.93,17.93,0,0,0,4,29.49l2.5-6.6A11,11,0,0,1,10.61,18Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;path-purple&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M21.63,7a11,11,0,0,1,10.76,9h7.12A18.06,18.06,0,0,0,21.63,0a17.1,17.1,0,0,0-1.88.19L21.08,7C21.26,7,21.45,7,21.63,7Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;M18.05,7.68,16.7.73a17.66,17.66,0,0,0-4.58,2l4.31,5.61A12.07,12.07,0,0,1,18.05,7.68Z&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/symbol&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After styling the code above to correspond with the colors matching their classes, the output will look like the image below. The changes will only affect the individual paths on the specified icon.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjyl95ekn6wi7j0hz0r86.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjyl95ekn6wi7j0hz0r86.jpg" alt="Colorful Icon" width="800" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there you have it - all you need to create a footer of scaleable and easily editable and maintainable (and probably many other -ables) icons!&lt;/p&gt;

</description>
      <category>css</category>
      <category>codenewbie</category>
      <category>svg</category>
    </item>
    <item>
      <title>CSS :is() fun</title>
      <dc:creator>Caity Opelka</dc:creator>
      <pubDate>Mon, 08 Mar 2021 22:16:10 +0000</pubDate>
      <link>https://dev.to/imcaity/css-is-fun-3fee</link>
      <guid>https://dev.to/imcaity/css-is-fun-3fee</guid>
      <description>&lt;p&gt;After skimming over some lines of CSS recently, I realized that I had read over a line and understood it without ever having seen it before. I had just come across the &lt;code&gt;:is()&lt;/code&gt; pseudo-class function for the first time, and it looked something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;header&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;font&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;sans&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's easy to understand that the above code targets the color and font of any &lt;code&gt;h1&lt;/code&gt; or &lt;code&gt;a&lt;/code&gt; tags inside of the header element. Another way to write the above rule is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;header&lt;/span&gt; &lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nx"&gt;header&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;font&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;sans&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It may not seem like it's that much less to write, but imagine if you were targeting more than two or three elements. The code could get very long and repetitive without the use of &lt;code&gt;:is()&lt;/code&gt;. Writing less code typically leads to having less bugs but that's not the only advantage to using this pseudo-class.&lt;/p&gt;

&lt;p&gt;If you have a long chain of selectors and one of them is invalid, that one error invalidates the entire CSS rule. The browser just throws it out completely.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;header&lt;/span&gt; &lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nx"&gt;header&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;font&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;sans&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the example above, let's say that you accidentally put a colon in front of the anchor tag. Now the entire rule is invalid. Neither the &lt;code&gt;h1&lt;/code&gt;s or the links will be able to access this rule. On the other hand, if this were written using the &lt;code&gt;:is()&lt;/code&gt; pseudo-class, any other selectors that are not invalid will still be affected by the rule.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;header&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;font&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;sans&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example above, although the anchor tag is invalid, the browser will still use the rule on the h1 tag. Only the invalid selector is ignored by the browser with the use of the &lt;code&gt;:is()&lt;/code&gt; pseudo-class.&lt;/p&gt;

&lt;p&gt;You can also reverse the logic. In the previous examples, we targeted &lt;code&gt;h1&lt;/code&gt;s and anchors within the header element. Another way to use &lt;code&gt;:is()&lt;/code&gt; is to target the functionality of a specific selector in many elements. Below, we are giving all links within the &lt;code&gt;main&lt;/code&gt;, &lt;code&gt;.title&lt;/code&gt;, and &lt;code&gt;p&lt;/code&gt; tag a color of purple on hover.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;purple&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One thing to note is that it does follow a level of specificity. Let's target anything with a class of &lt;code&gt;.title&lt;/code&gt; or a paragraph tag in the main element and give them a color of orange.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;main&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;is&lt;/span&gt;&lt;span class="p"&gt;(.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;orange&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now imagine further down in the CSS file, you try to reassign the color of the paragraph text to red.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;main&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You might be surprised to find out that the color remains orange. This is because the color was originally tied to whatever selector had the highest rank of specificity when it was passed to the &lt;code&gt;:is()&lt;/code&gt; pseudo-class. In this case, &lt;code&gt;.title&lt;/code&gt; had the highest specificity, which then ties the color of &lt;code&gt;p&lt;/code&gt; to the color of &lt;code&gt;.title&lt;/code&gt;, resulting in the paragraph text remaining red. If the &lt;code&gt;.title&lt;/code&gt; class had not been called in the previous &lt;code&gt;:is()&lt;/code&gt; pseudo-class, the color of the paragraph text would indeed have updated to the color of the most recent rule because the paragraph tag became the selector with the highest specificity.&lt;/p&gt;

&lt;p&gt;This mini-dive into the &lt;code&gt;:is()&lt;/code&gt; was the result of coming across a snippet of code that sparked my curiosity. Stay curious! There's always more to learn.&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;Sources: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:is" rel="noopener noreferrer"&gt;MDN&lt;/a&gt;&lt;/em&gt;
&lt;/h6&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>Coding for Colorblindness</title>
      <dc:creator>Caity Opelka</dc:creator>
      <pubDate>Mon, 01 Mar 2021 17:54:59 +0000</pubDate>
      <link>https://dev.to/imcaity/coding-for-colorblindness-45kk</link>
      <guid>https://dev.to/imcaity/coding-for-colorblindness-45kk</guid>
      <description>&lt;p&gt;With so many apps in competition with each other, designers and developers aim to create a distinct identity, and one of the most prominent features of an app's identity is its color scheme. With all of the colors we have available, it's easy to get carried away with the aesthetic and overlook accessibility.&lt;/p&gt;

&lt;p&gt;About 8% of men &lt;em&gt;(1 in 12)&lt;/em&gt; and .5% of women &lt;em&gt;(1 in 200)&lt;/em&gt; of people are colorblind, and 99% of those with colorblindness have reduced red-green sensitivity.&lt;/p&gt;

&lt;p&gt;The image below includes five examples of pairs that cause confusion. To someone who isn't colorblind, these colors are very different, but to someone who is colorblind, these pairs are indistinguishable.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2zdarzz2j37es68s7l7m.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2zdarzz2j37es68s7l7m.jpg" alt="Color Comparison" width="337" height="197"&gt;&lt;/a&gt;&lt;br&gt;
A person with red-green colorblindness may see something similar to this:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhqhfvonihg8peccl9n0x.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhqhfvonihg8peccl9n0x.jpg" alt="Colorblind Color Comparison" width="337" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can understand immediately how this can cause issues with readability. If you are using color to call attention to something, perhaps a chart that uses color to differentiate areas, you have to account for how the colors will be viewed by someone with a red-green deficiency. Is the contrast different enough? Is there another way you can represent the data - can you use different patterns?&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi4ky8jr756y8k0m92vzw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi4ky8jr756y8k0m92vzw.jpg" alt="Chart Comparison" width="454" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another example is when you attempt to log in to a website but you attempted with the wrong password. Typically, you'll receive a red error. How can you make this more apparent using more than just color? The addition of a caption or an icon can get the point across more clearly.&lt;/p&gt;

&lt;p&gt;If you're still in the planning phase, there is an easy way to check what users see if they have reduced red-green sensitivity in Adobe products like Illustrator and Photoshop. In the &lt;code&gt;View&lt;/code&gt; tab of the main navigation dropdown, you'll see a &lt;code&gt;Proof Setup&lt;/code&gt; option where you can select a &lt;code&gt;Color blindness&lt;/code&gt; type. This will simulate how a user will interpret your current color palette. Currently, it does not show a view for tritanomaly (reduced sensitivity to blue light), but that type of colorblindness is extremely rare.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwdjnayh7a4qony6tt24q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwdjnayh7a4qony6tt24q.png" alt="Check Adobe view for colorblindness accessibility" width="800" height="1104"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're in the coding phase, you can check the colorblind compatibility in the Chrome dev tools. Expand the menu to see &lt;code&gt;More tools&lt;/code&gt;, and find the &lt;code&gt;Rendering&lt;/code&gt; option.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsd0dn5elalpfxz566dqq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsd0dn5elalpfxz566dqq.png" alt="Check dev tools for colorblindness accessibility" width="800" height="1031"&gt;&lt;/a&gt;&lt;br&gt;
From there, find the &lt;code&gt;Emulate vision deficiencies&lt;/code&gt; section, and you can toggle the dropdown to view the current app in the browser using types of colorblindness.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftohrnzl64ds335jy9pby.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftohrnzl64ds335jy9pby.jpg" alt="Chrome dev tools: Rendering" width="338" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Colors create a story by conveying certain emotions, but as designers and developers, we have to go beyond just the use of color to ensure that we captivate our entire audience. Iconography can also be a helpful tool to work in tandem with color when appropriate, because the visual representation does not rely on color alone. Accounting for colorblindness is just one of the ways we can make our apps more accessible. It doesn't take a lot of additional time, and we owe it to our community to make accessibility a priority. &lt;/p&gt;

&lt;h6&gt;
  
  
  Sources:
&lt;/h6&gt;

&lt;p&gt;&lt;a href="https://iristech.co/statistics/" rel="noopener noreferrer"&gt;https://iristech.co/statistics/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.colourblindawareness.org/colour-blindness/types-of-colour-blindness/" rel="noopener noreferrer"&gt;https://www.colourblindawareness.org/colour-blindness/types-of-colour-blindness/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>React vs. Svelte: What's the Big Difference?</title>
      <dc:creator>Caity Opelka</dc:creator>
      <pubDate>Mon, 22 Feb 2021 14:31:44 +0000</pubDate>
      <link>https://dev.to/imcaity/react-vs-svelte-what-s-the-big-difference-32fd</link>
      <guid>https://dev.to/imcaity/react-vs-svelte-what-s-the-big-difference-32fd</guid>
      <description>&lt;p&gt;As graduation day from coding bootcamp draws nearer and nearer, I have begun to look around for additional frameworks and other tech to add to my knowledge base. Most of my experience during bootcamp has relied on utilizing React, and now that I have had a fair amount of practice with it, I'm eager to see how it compares with other frameworks. One name that seems to be abuzz is Svelte. Although it is relatively new &lt;em&gt;(born November 2016)&lt;/em&gt;, Svelte appears to have a great reputation and high developer satisfaction rates.&lt;/p&gt;

&lt;p&gt;Upon first look, both React and Svelte are component-based, so React developers should be very familiar with how things are grouped and the concept of importing files where needed. One thing to note is that the syntax may take a little bit of adjustment time for a new coder, but overall seems pretty easily understandable. Because the styling is also done in the components, the risk of side effects is low as style changes made to one component do not affect its parent or children.&lt;/p&gt;

&lt;p&gt;In the example below, you can see the familiarity of the syntax. The content between the &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tags can be compared to React's constructor method, and the content between the &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; tags can be compared to React's render method. The &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; has its own separate tag in Svelte. The click handlers also closely resemble the onClick in React, but you'll notice the formulation of the concatenated string is denoted by &lt;code&gt;$:&lt;/code&gt; rather than declared another const.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;firstName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;Bugs&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lastName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;Bunny&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;snack&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;carrot&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nl"&gt;$&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;fullName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleClick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;snack&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;cookie&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;fullName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;click&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Would&lt;/span&gt; &lt;span class="nx"&gt;you&lt;/span&gt; &lt;span class="nx"&gt;like&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;snack&lt;/span&gt;&lt;span class="p"&gt;}?&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/main&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;ff3e00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;uppercase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;font&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="nx"&gt;em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;font&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/style&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  What's the difference?
&lt;/h6&gt;

&lt;p&gt;React is fast, but Svelte is faster. One main difference between Svelte and React is that Svelte is a compiler, while React uses the Virtual DOM to compile the code.&lt;/p&gt;

&lt;p&gt;Svelte turns the application into vanilla JavaScript during build time before updating the DOM (the real DOM). On the other hand, React updates the DOM by use of &lt;em&gt;diffing&lt;/em&gt;. Diffing is the process of comparing the previous version of the render (the real DOM) with the latest updates to the Virtual DOM. Once the browser has compared the real DOM and the Virtual DOM, it updates the user interface with the differences it found. Because Svelte does not use the Virtual DOM, that is one less step that has to run before a change is reflected in the browser. For a visual representation, see the image below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbc61pjoivzl99vsqtj8k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbc61pjoivzl99vsqtj8k.png" alt="Svelte vs. React" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A deterrent for young coders may be that because Svelte is still relatively new, the community is much smaller than React's. This means that if you get stuck and you are looking for scenarios that may be similar to what you are experiencing, there are a lot less resources out there currently to serve as guidance.&lt;/p&gt;

&lt;h6&gt;
  
  
  But that shouldn't stop you from giving Svelte a try.
&lt;/h6&gt;

&lt;p&gt;There's no harm in toying around with new tech. Svelte may be young but it is becoming increasingly popular, so go ahead and get your hands qwerty.&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;Sources:&lt;/em&gt;
&lt;/h6&gt;

&lt;p&gt;&lt;a href="https://www.simform.com/react-vs-svelte/" rel="noopener noreferrer"&gt;https://www.simform.com/react-vs-svelte/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://svelte.dev/" rel="noopener noreferrer"&gt;https://svelte.dev/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://reactjs.org/" rel="noopener noreferrer"&gt;https://reactjs.org/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>svelte</category>
    </item>
    <item>
      <title>OAuth: Oh... so I AUTHorized What?</title>
      <dc:creator>Caity Opelka</dc:creator>
      <pubDate>Tue, 12 Jan 2021 19:09:46 +0000</pubDate>
      <link>https://dev.to/imcaity/oauth-oh-so-i-authorized-what-3ai1</link>
      <guid>https://dev.to/imcaity/oauth-oh-so-i-authorized-what-3ai1</guid>
      <description>&lt;p&gt;We've all seen the authorization box pop up, but most people tend to click through quickly to get the result that they want. Here's an example of what a user sees on screen with a simple verification through OAuth which will allow &lt;a href="https://www.codewars.com/" rel="noopener noreferrer"&gt;Codewars&lt;/a&gt; access to a given scope of data from a user's &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;Github&lt;/a&gt; account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzwkjba84vb8ibfmshzqc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzwkjba84vb8ibfmshzqc.png" alt="login-sample" width="800" height="954"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's explore an example of two services interacting without &lt;a href="https://oauth.net/" rel="noopener noreferrer"&gt;OAuth&lt;/a&gt;. A user - we'll call him Jack - wants to print a photo through a printing service app but the photo is stored in another app like Google Drive. Before authorization between services was available, the only way for the printing app to get access to Jack's photo would be to ask him to log in to Google with his Google credentials on the printing service's app. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3fiuf4ebzg4dygf8ewif.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3fiuf4ebzg4dygf8ewif.jpg" alt="Blog-Img-1" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is clearly problematic.&lt;/strong&gt; Not only does the printing service have access to everything in Jack's Google account, but Jack has to trust that the printing service will surely, definitely, immediately log out of his account when the service is complete. He'll also have to trust that the printing service will throw away his credentials and absolutely never do anything malicious.&lt;/p&gt;

&lt;p&gt;Let's run through the flow again. Jack tells the printing service that he wants to use a photo from his Google account. The printing service says "Okay, let me grab the photo for you from your Google account."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6cfr45b6wq3n83vzqy2d.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6cfr45b6wq3n83vzqy2d.jpg" alt="Blog-Img-2" width="800" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The printing service then goes to Google and asks, "Hey Google, can you give me this photo from Jack's account?" Google says, "No, I don't know you, so I can't trust you with Jack's information, but let me ask Jack what he would like me to do".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fshvqadatuqqx4m0qeaqp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fshvqadatuqqx4m0qeaqp.jpg" alt="Blog-Img-3" width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;This is where OAuth comes into play.&lt;/em&gt;&lt;/strong&gt; To Jack, it appears that Google is asking for his consent, but Google is actually going to use OAuth to verify that client (the photo printing service) is authorized to access the user's data. Google tells OAuth that it needs consent from Jack to be able to give the client app access to his account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwb0cxik97az7lee08ewe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwb0cxik97az7lee08ewe.jpg" alt="Blog-Img-4" width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OAuth then goes to Jack for confirmation. "Hey, this printing company is asking for access to your account. Take a look at this list of things that they would like to access, and respond with your consent or rejection".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhie2bc7hgnwn2fzmnjnh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhie2bc7hgnwn2fzmnjnh.jpg" alt="Blog-Img-5" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Jack gives his consent with the click of a button, and OAuth sends the printing service an authorization token. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F13zdfel0i2ymrmgj24uj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F13zdfel0i2ymrmgj24uj.jpg" alt="Blog-Img-6" width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The printing service takes this token to Google and says, "Hey Google, can you give me this photo from Jack's account? Here is the token that says I have access to this scope of things". Google says, "Sure, let me grab that for you".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjq1mhe2jeifhohaoplst.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjq1mhe2jeifhohaoplst.jpg" alt="Blog-Img-7" width="800" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What's important here is that Jack didn't have to enter his Google credentials into the printing service. Because of that, but the printing service only received access to Jack's photos rather than Jack's entire Google account. The original purpose of OAuth was to authorize the use of one service to another without the user giving more information than is necessary. Because it is an authorization tool between services, it can also be used to verify authorization between microservices within the same app. This provides more security by compartmentalizing permissions of the data rather than storing everything in one central location.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Sass: CSS That Sparks Joy</title>
      <dc:creator>Caity Opelka</dc:creator>
      <pubDate>Tue, 05 Jan 2021 05:22:48 +0000</pubDate>
      <link>https://dev.to/imcaity/sass-css-that-sparks-joy-2glg</link>
      <guid>https://dev.to/imcaity/sass-css-that-sparks-joy-2glg</guid>
      <description>&lt;p&gt;SassScript, or Sass, is changing the way we style. As developers, we're always trying to find ways to increase efficiency. Rather than combing through long CSS files with seemingly no structure, Sass introduced a way of streamlining code with some very familiar syntax. It's so familiar, in fact, that you could write all CSS code in an SCSS file, and it would be completely compatible. Of course, there's no point in doing that, but the idea is that you don't have to learn an entirely new language to be able to use Sass. You can make small changes as you get more comfortable, and create more efficient code as you learn all of the tricks Sass brings with its &lt;a href="https://sass-lang.com/" rel="noopener noreferrer"&gt;syntactically awesome style sheets&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Sass is a preprocessor. In other words, it's an extension of CSS, but it's a format that cannot be read by the browser. Because of this, you'll need a compiler, which will take the SCSS you have written and turn it into a CSS file. If you're using VS Code, there is an extension that you can install called &lt;a href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.live-sass" rel="noopener noreferrer"&gt;Live Sass Compiler&lt;/a&gt;. If you don't have VS Code, there are several other ways to get started at &lt;a href="https://sass-lang.com/install" rel="noopener noreferrer"&gt;sass-lang.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So what's so great about Sass?&lt;/strong&gt; For starters, let's say you have a CSS file containing all of your brilliant code, and your client wants to change the color of the text. Think about all of the different selectors where you have used this color and must now hunt down and change them all. Clearly, this is a violation of the D.R.Y. &lt;em&gt;(don't repeat yourself)&lt;/em&gt; method. Wouldn't it be more efficient to only have to change the color in one place? With Sass, you can create variables to replace your repetitive code. &lt;strong&gt;Variables&lt;/strong&gt; start with a '$' prefix like below and can then be used as the property value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;$color&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="mi"&gt;8429&lt;/span&gt;&lt;span class="nx"&gt;FF&lt;/span&gt;

&lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;$color&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also group things by &lt;strong&gt;nesting&lt;/strong&gt;, which has a visual similarity to the nested elements you see in HTML. If you style an anchor selector in CSS, the style will affect all anchors on the page. If you want to style the anchors of the navigation bar in a different way, you can easily target the nav by nesting with Sass. Only the anchor tags in the nav will be affected by this styling. Of course, this is just one example, and you can nest other areas besides the navigation as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;nav&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;inline&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;$color&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;secondary&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a really easy way to create separation both functionally and visually. Another way to form groups using Sass is the &lt;strong&gt;module system&lt;/strong&gt;. Introduced in 2019, this isn't dissimilar from CSS in that it is possible to use multiple CSS files in one app, however, when using more than one file, CSS will have to make multiple HTTP requests as it renders your page. On the other hand, Sass modules are compiled into &lt;strong&gt;one&lt;/strong&gt; big CSS file.&lt;/p&gt;

&lt;p&gt;To denote a module, the file name must begin with an underscore. This lets the compiler know that the file is only a partial. Let's say you want to have a separate file to store the branding colors. Create a new SCSS file using the underscore prefix.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;_branding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;scss&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this file, you may have some variables relating to the color scheme. If you want to use any of the colors from that module in another module, load them with &lt;a class="mentioned-user" href="https://dev.to/use"&gt;@use&lt;/a&gt; and the file name. Then reference the namespace, based on the file name when referring to the variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;use&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;branding&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;branding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$color&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the file name is particularly long, you can also shorten it using &lt;em&gt;'as'&lt;/em&gt;. Though the above 'branding' is not a particularly long name, we'll use it again below as an example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;use&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;branding&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$color&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that as of October 2020, Sass announced that the &lt;a class="mentioned-user" href="https://dev.to/import"&gt;@import&lt;/a&gt; method of accessing modules is deprecated and will be soon phased out. When using &lt;a class="mentioned-user" href="https://dev.to/import"&gt;@import&lt;/a&gt;, the modules are available globally which causes unexpected side-effects if, for example, different modules contain the same name. To utilize modules, access them with the &lt;a class="mentioned-user" href="https://dev.to/use"&gt;@use&lt;/a&gt; method above.&lt;/p&gt;

&lt;p&gt;Another way to create reusable styles is a &lt;strong&gt;mixin&lt;/strong&gt;. Think about how many times you use code to center something. With Sass, you can write the code once and implement it in multiple areas. To use the mixin, simply add an &lt;a class="mentioned-user" href="https://dev.to/include"&gt;@include&lt;/a&gt; and the name of the mixin where you would normally write the property.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;mixin&lt;/span&gt; &lt;span class="nf"&gt;center&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;justify&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;align&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;include&lt;/span&gt; &lt;span class="nf"&gt;center&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mixins can also take in parameters to make them more dynamic. Adding to the example from above, you can add a parameter and make a decision later about how to appropriately center the selector depending on its use. Notice that the parameter starts with a '$' prefix.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;mixin&lt;/span&gt; &lt;span class="nf"&gt;center&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$direction&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;justify&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;align&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;flex&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;$direction&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;include&lt;/span&gt; &lt;span class="nf"&gt;center&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;column&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mixins bear a resemblance to &lt;strong&gt;functions&lt;/strong&gt; which are also a feature of Sass, but they differ in that functions have to return something, and they don't use &lt;a class="mentioned-user" href="https://dev.to/include"&gt;@include&lt;/a&gt;. Let's look at a very handy trick I learned from &lt;a href="https://www.kevinpowell.co/" rel="noopener noreferrer"&gt;Kevin Powell&lt;/a&gt;. Maybe you have been tinkering with colors and you can't decide whether you like a dark or light background but every time you change it, you have to change the color of the text for visibility. You can create a function that will handle the change for you. With Sass, you can even use conditional statements. The below example evaluates the lightness of the background color passed in and returns the appropriate value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nf"&gt;color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$bg&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;lightness&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$bg&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;return&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="mi"&gt;555&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;return&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One more key feature of Sass to note is the ability to use &lt;strong&gt;inheritance&lt;/strong&gt;. You can pass properties of a selector to other selectors by using @extend. Just like CSS, the file is read top to bottom, so if code is followed by a property of the same name, the bottommost code will be run.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;font&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Arial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Helvetica&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sans&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;font&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="nx"&gt;px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;h4&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;extend&lt;/span&gt; &lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;font&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Above are just a few of the basic (or not-so-basic) features of Sass to make your code cleaner and more efficient. You can find plenty of other tips and tricks to explore at &lt;a href="https://sass-lang.com/" rel="noopener noreferrer"&gt;sass-lang.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>productivity</category>
      <category>sass</category>
    </item>
    <item>
      <title>Getting to Know ESLint</title>
      <dc:creator>Caity Opelka</dc:creator>
      <pubDate>Wed, 23 Dec 2020 19:10:26 +0000</pubDate>
      <link>https://dev.to/imcaity/getting-to-know-eslint-51p5</link>
      <guid>https://dev.to/imcaity/getting-to-know-eslint-51p5</guid>
      <description>&lt;p&gt;When I started learning Javascript, I was encouraged to use &lt;a href="https://eslint.org/" rel="noopener noreferrer"&gt;ESLint&lt;/a&gt;, but I had no idea what it was... and I had no idea that it wasn't working until my instructor pointed out that my linter wasn't catching any of my errors. I reinstalled the extension in &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt; and suddenly I was amazed. It is a node-npm based tool so you will need to &lt;a href="https://docs.npmjs.com/downloading-and-installing-node-js-and-npm" rel="noopener noreferrer"&gt;install node&lt;/a&gt; in order to run ESLint. Then you can install ESLint globally by finding the extension in VSCode or entering the command in the terminal&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install -g eslint&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;What is a linter? The name is very telling. A linter is a helpful debugging tool that sifts through your code looking for patterns of behavior. If it catches an irregularity, it will alert you with the type of error and its location in the document. Not all errors will break your code, but ESLint is there to tell you when any appear and help you to follow best practices.&lt;/p&gt;

&lt;p&gt;Before ESLint came around, a common way to check code for these kinds of errors was by copying the code and pasting it into a website like &lt;a href="https://jslint.com/" rel="noopener noreferrer"&gt;JSLint&lt;/a&gt;, but now we can do it seamlessly inside of the text editor.&lt;/p&gt;

&lt;p&gt;Nothing comes loaded by default, but they do have a package of recommended rules that can be easily added to get you started. You can create a new &lt;em&gt;eslintrc.js&lt;/em&gt; file, and add the recommended rules inside or build your own set. If you take a look at the documentation of &lt;a href="https://eslint.org/docs/rules/" rel="noopener noreferrer"&gt;ESLint's rules&lt;/a&gt;, the checkmark denotes all of the rules included in that package.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;extends&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;eslint:recommended&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each rule in the documentation has tips for usage and reasons why you may or may not want to use it. You can add more rules or override recommended rules, using a value of 0 to turn the rule off, 1 to show a warning, and 2 to show an error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;extends&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;eslint:recommended&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;es6&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rules&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;no-var&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Above, you can see an example of adding an ES6 environment for the use of arrow functions and other exciting ES6 features. There's also an added no-var rule that is set to show a warning. Now if you were to try to declare a variable with the keyword &lt;em&gt;var&lt;/em&gt;, you can trust that ESLint will catch it with a not-so-subtle hint just like those squiggly lines under misspelled words on all of the papers you stayed up late to write over the years.&lt;/p&gt;

&lt;p&gt;In VSCode, The error will appear in the problems panel, showing its location in the file. You can click the error in the panel and it will bring you to the actual line of code where you can inspect it and make any changes. It's simple and straightforward but who wants to sift through errors like trailing white space or missing semi-colons? To increase efficiency, you can add auto-fix in your global settings to take care of small errors and cut down on time spent searching for each individual error. To do this, navigate to your settings.json at Code &amp;gt; Preferences &amp;gt; Settings &lt;em&gt;(Command + ,)&lt;/em&gt; and type &lt;em&gt;eslint&lt;/em&gt; into the search bar. This is where you can add an auto-fix.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;editor.codeActionsOnSave&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;source.fixAll.eslint&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it catches a larger error like a declared variable that is never used, ESLint doesn't know what you would like to do with that variable so it will remain until you fix it. If it finds an error that can't be auto-fixed, you can check the "problems" tab in VS Code and it will give you a short explanation of the error found as well as where to look for it in your file. Double-clicking on the error in the problems tab will bring you directly to the line where the error exists.&lt;/p&gt;

&lt;p&gt;In the beginning, we installed the linter globally but in the short example above, we created a file in the root folder of the project. Because different environments have different rules, this makes it easy to pinpoint errors based on that specific environment. It also makes it easier to transition files when working with a team. So you've made your ideal configurations, and you're feeling pretty great about it. Your files are wonderfully clean. Then one of your teammates makes some changes, and when you pull the new file, your linter finds some errors to clean up. The beauty of using ESLint in your project vs. globally is that you can share rules with your teammates so you all have the same workspace. If you don't create a new set of rules in the project's root folder, it will just fall back to the global settings. &lt;/p&gt;

&lt;p&gt;As a new developer, ESLint has been very helpful as a guide to learning best practices. Because the errors are so apparent, it's easy to see how to properly form your code and make less errors as you get more practice.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Javascript Spread Operator... Putting it Together</title>
      <dc:creator>Caity Opelka</dc:creator>
      <pubDate>Mon, 14 Dec 2020 14:56:03 +0000</pubDate>
      <link>https://dev.to/imcaity/javascript-spread-operator-putting-it-together-3f8b</link>
      <guid>https://dev.to/imcaity/javascript-spread-operator-putting-it-together-3f8b</guid>
      <description>&lt;p&gt;The spread operator, which is denoted by three dots (...) is defined on &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax" rel="noopener noreferrer"&gt;MDN&lt;/a&gt; as syntax that "allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected."&lt;/p&gt;

&lt;p&gt;Let's break down what that means, starting with function calls.&lt;br&gt;
In the example below, there is a function that accepts three arguments, and there is an array of elements. If you were to pass the array to the function as an argument, it would take the entire array as the first argument and evaluate to undefined for the other unused arguments. Instead, you can use the spread operator before the array, which essentially removes the brackets and passes the array elements as arguments to the function. Note: The array in this example contains more elements than there are function parameters. In this case, because we have three parameters, the function will take the first three elements from the array as arguments.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx2fpmgajah4q98euhrr7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx2fpmgajah4q98euhrr7.jpg" alt="Spread Operator: Functions" width="800" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, let's look at how the spread operator works with arrays. One very handy use is to make a copy of an array. In the example below, notice that largeDogsReference is pointing directly to largeDogs. This is not a copy, but rather a reference to the same array. Any changes made to either of them will affect both. You can see that if we compare largeDogsReference to largeDogs, we can expect an output of true because they are the same array. To make a copy rather than a new reference, simply use the spread operator in front of the array name that you would like to copy, and enclose it in square brackets. Now if we compare largeDogsCopy to largeDogs, we can expect an output of false because they are now two different arrays, even though they currently have the same elements.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F628f77o5dcsgasyjkc2w.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F628f77o5dcsgasyjkc2w.jpg" alt="Spread Operator: Arrays" width="800" height="244"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Be careful.&lt;/strong&gt; When using the spread operator to make a copy of an array, it only goes one level deep. If the array that you copy contains other arrays or objects, those elements will still be pointing to their current reference.&lt;br&gt;
&lt;em&gt;Order matters.&lt;/em&gt; The order in which you add the arrays is the order in which they will combine. In the example below, you can see that if we switch the order of the two dog arrays, the order of the elements will also switch.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhpfnycnvc0ybradq9bfi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhpfnycnvc0ybradq9bfi.jpg" alt="Spread Operator: Arrays" width="800" height="573"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, you might be wondering, "Why not just use the concat() method to merge the arrays?" In the example below, you can see that since this is just a regular array, the advantage to using the spread operator is that you can add in any other elements as well.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fw52xb5heu9lfw6onl1un.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fw52xb5heu9lfw6onl1un.jpg" alt="Spread Operator: Arrays" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lastly, we can use the spread operator with objects. Just as we did with the elements of an array, we can use spread to copy the keys of an object. This is demonstrated in the example below.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbfubla3ajxsgml9iamso.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbfubla3ajxsgml9iamso.jpg" alt="Spread Operator: Objects" width="800" height="692"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once again, order matters. The spread operator will overwrite the values depending on its placement.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn1zi80p8mxijwii60d98.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn1zi80p8mxijwii60d98.jpg" alt="Spread Operator: Objects" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The spread operator is very useful whether it's passing arrays to a function, adding information together in arrays or objects, or just for making copies of arrays and objects so we don't make unwanted changes to the original reference.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Well-Baked Pseudocode</title>
      <dc:creator>Caity Opelka</dc:creator>
      <pubDate>Thu, 19 Nov 2020 14:58:30 +0000</pubDate>
      <link>https://dev.to/imcaity/well-baked-pseudocode-c1o</link>
      <guid>https://dev.to/imcaity/well-baked-pseudocode-c1o</guid>
      <description>&lt;p&gt;If you want to bake a loaf of bread, and you pull out the recipe card, the directions won't begin with "make bread". Of course, we're going to make bread but the point of a recipe card is to provide guidance as to &lt;em&gt;how&lt;/em&gt; to make bread. It's broken down into simple parts, and as you complete each step, the dough starts to take form. The same can be said about pseudocoding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is pseudocode?&lt;/strong&gt;&lt;br&gt;
Pseudocode is a list of steps that illustrates how to achieve the desired result. The steps are written in plain natural language so they can be read and understood easily and can be translated into any programming language. You should pseudocode as if you're walking yourself through the objectives of the problem. It may seem tedious to pseudocode for simple logic, but it provides good habit-forming practice and will certainly help when constructing more complex problems.&lt;/p&gt;

&lt;p&gt;Let's write some pseudocode to find the sum of a range when given an array of two numbers, and we want the range to include the starting and ending numbers.&lt;/p&gt;

&lt;p&gt;First, it's helpful to identify the input(s) and expected output(s), including the expected datatypes, as well as any constraints or edge cases that may require special handling.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqdv68demhmspgloyinwl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqdv68demhmspgloyinwl.jpg" alt="pseudocoding example step 1" width="800" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you can start writing the logic for how you want to achieve the desired output, with each step serving as a stand-in for a line of code. If a line of pseudocode becomes lengthy, you may want to take a second look to see if it should be broken down into smaller steps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhnaxoz99tr6b0eb8aowd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhnaxoz99tr6b0eb8aowd.jpg" alt="pseudocoding example step 2" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you have a solid list of instructions, then you're finally ready to write the code, and you're on your way to a fully baked solution. Now for the fun part! Let's go ahead and fill in the spaces we left below each line of pseudocode with actual code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6y7lvjjgpee4nz7y930k.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6y7lvjjgpee4nz7y930k.jpg" alt="pseudocoding example step 3" width="800" height="566"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you might be thinking that sure looks like a lot of pseudocoding for a short amount of code, and you're right, but maybe you've written some code but didn't account for a specific edge case. With the pseudocode steps included as comments, anyone is able to follow your thought process and can easily make suggestions. It's tempting to want to start to code immediately but we'll save a lot of time in the end by setting ourselves up for success from the start. &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
