<?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: Thalita G.</title>
    <description>The latest articles on DEV Community by Thalita G. (@thalitadev).</description>
    <link>https://dev.to/thalitadev</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%2F597665%2F143505b9-f634-4d9a-861b-5ac3d1277bcc.jpg</url>
      <title>DEV Community: Thalita G.</title>
      <link>https://dev.to/thalitadev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thalitadev"/>
    <language>en</language>
    <item>
      <title>Step-by-step guide: Pass your cursor position to CSS variables with JavaScript</title>
      <dc:creator>Thalita G.</dc:creator>
      <pubDate>Sun, 16 May 2021 14:36:35 +0000</pubDate>
      <link>https://dev.to/thalitadev/step-by-step-guide-pass-your-cursor-position-using-css-variables-c7b</link>
      <guid>https://dev.to/thalitadev/step-by-step-guide-pass-your-cursor-position-using-css-variables-c7b</guid>
      <description>&lt;p&gt;&lt;a href="https://thalita.dev/" rel="noopener noreferrer"&gt;My website&lt;/a&gt; has a little illustration that tracks your cursor's position. The only JavaScript that happens there is passing the cursor position to CSS variables. Everything else is in CSS using 2D transforms. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fgt3zy104hwhykyd2cd6l.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fgt3zy104hwhykyd2cd6l.gif" alt="Thalita website tracked illustration"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;In this tutorial, you'll learn how to pass event behaviour to CSS using CSS variables.&lt;/p&gt;

&lt;h1&gt;
  
  
  Set up your HTML and CSS
&lt;/h1&gt;

&lt;p&gt;We'll be making a square with a little red dot inside. The red dot will be what will be controlled with transforms later on.&lt;/p&gt;

&lt;p&gt;The HTML code is pretty simple:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"tracker"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The CSS will center the square on the window and puts the red dot on the top left of the container. I also like setting up the CSS variables in CSS for a default state. CSS variables generally default to 0, but you may not always want that to be the case.&lt;/p&gt;

&lt;p&gt;Here's the CSS:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;--x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.container&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;.tracker&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;200px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;200px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-50%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;-50%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="m"&gt;#333&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.tracker&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&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="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1000px&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 how it ends up looking like:&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/Thalita/dbjng1yt/embedded/result,html,css//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Make the event listener and pass the variable in JavaScript
&lt;/h1&gt;

&lt;p&gt;Next, we make the event listener and pass the event behaviour to CSS variables.&lt;/p&gt;

&lt;p&gt;Let's declare the position x and y first, and add the event listener itself:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;x&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="na"&gt;y&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="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mousemove&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;e&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;saveCursorPosition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;clientX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;clientY&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;As you can see, we'll be making a function &lt;code&gt;saveCursorPosition&lt;/code&gt;. This is where we'll be passing the CSS variables. The two arguments will be the event's &lt;code&gt;clientX&lt;/code&gt; and &lt;code&gt;clientY&lt;/code&gt;, which is the cursor position.&lt;/p&gt;

&lt;p&gt;To make the cursor position responsive, we'll divide the values by the &lt;code&gt;innerWidth&lt;/code&gt; and &lt;code&gt;innerHeight&lt;/code&gt;, like so:&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;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I use &lt;code&gt;toFixed(2)&lt;/code&gt; to round the values.&lt;/p&gt;

&lt;p&gt;After that, we can finally pass the positions to the CSS variables! To select the root, you use &lt;code&gt;document.documentElement&lt;/code&gt;. You may be used to declaring CSS values using the style property, like &lt;code&gt;style.transform = ''&lt;/code&gt;. This isn't possible with CSS variables, where you'll have to use &lt;code&gt;style.setProperty()&lt;/code&gt; instead due to the unique way CSS variables are formatted. You'll end up with this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--x&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--y&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Put these in your function, and you end up with this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;x&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="na"&gt;y&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;saveCursorPosition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--x&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--y&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mousemove&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;e&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;saveCursorPosition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;clientX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;clientY&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;h1&gt;
  
  
  Add the transform with the CSS variables to your CSS
&lt;/h1&gt;

&lt;p&gt;Now that we have everything ready, we'll now add the transform property to the red dot. This takes a little bit of math, but basically we'll multiply the container's width by the CSS variable, and add that to the -50% that centers the dot.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="nc"&gt;.tracker&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&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="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1000px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-50%&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="m"&gt;200px&lt;/span&gt; &lt;span class="err"&gt;*&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--x&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-50%&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="m"&gt;200px&lt;/span&gt; &lt;span class="err"&gt;*&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--y&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;Optionally, you can add a transition that acts as a stabiliser simply by adding this one line &lt;code&gt;transition: transform 0.1s&lt;/code&gt;. It's best to keep the timing lower than 0.3s. I don't recommend using this on too many elements, but it adds a nice effect.&lt;/p&gt;

&lt;p&gt;And that's it! The transform will now change according to the CSS variable, thus following your cursor. The final result can be seen on this JSFiddle (including the transition):&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/Thalita/oug7etbh/embedded/result,js,html,css//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Why you should use CSS variables to pass event behaviour
&lt;/h1&gt;

&lt;p&gt;Now you know how to pass event behaviour using CSS variables, but perhaps you still have doubts about CSS variables in general.&lt;/p&gt;

&lt;h2&gt;
  
  
  Readability
&lt;/h2&gt;

&lt;p&gt;Readability in general is pretty subjective. But I do believe it's the major reason to make use of CSS variables.&lt;/p&gt;

&lt;p&gt;My general thumb of rule is always: all style-related features should be left to CSS, everything else to JavaScript.&lt;/p&gt;

&lt;p&gt;JS isn't meant for style manipulation. I mean, look at this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.a-class&lt;/span&gt;&lt;span class="dl"&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;pos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;x&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="na"&gt;y&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&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;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;250&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&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;height&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&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;left&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&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;top&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&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;transform&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`translate(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&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="mi"&gt;50&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px)`&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 just not very elegant, you see? You could use &lt;code&gt;cssText&lt;/code&gt; so you'd at least not have this multiline However, this still isn't convenient when this isn't the only inline CSS you use. Besides, readability or maintainability won't be much better even with &lt;code&gt;cssText&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It's also for the same reason that I prefer not to use libraries like GSAP and anime.js. Unless the animation is so complex that these libraries would outperform CSS, I'd rather go for CSS.&lt;/p&gt;

&lt;p&gt;Speaking of performance...&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance
&lt;/h2&gt;

&lt;p&gt;This is where things get a little more complicated, but the tl;dr of this would be: It generally &lt;strong&gt;outperforms&lt;/strong&gt; JS in terms of scripting.&lt;/p&gt;

&lt;p&gt;Whether you pass the styling with CSS or JS makes no difference in terms of re-rendering itself. This means that you'll mainly find improved performance in JS itself.&lt;/p&gt;

&lt;p&gt;Usually, whenever you want to change the position of an element, you'd do something like &lt;code&gt;el.style.transform= 'translateY(50%)';&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Say you have 10000 divs, you'd loop through each element to add inline CSS to it. With CSS variables, you'd only need to change the value once on the parent element or the root. It should be clear that the latter would have better performance. In case you're doubting this, I did some benchmark testing using &lt;a href="https://jsben.ch/" rel="noopener noreferrer"&gt;Jsben.ch&lt;/a&gt;. Some information about what I've done:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Before each test, I've created these 10000 divs, set the CSS variable, and added inline CSS to all of them with &lt;code&gt;el.style.transform= 'translateY(var(--percent))';&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The first test case adds inline CSS with a regular variable.&lt;/li&gt;
&lt;li&gt;The second test case changes the CSS variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2F8v15p64hv3tj5o4pxo0j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F8v15p64hv3tj5o4pxo0j.png" alt="The loop with regular variable can only do 84 operations when redeclaring the CSS variable can do a whopping 609023 operations!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's a pretty big difference huh.&lt;/p&gt;

&lt;p&gt;It may seem ridiculous to add inline styling to all these elements individually, but this is exactly what I see happening on many websites. Whereas in CSS variables you'd typically already have the CSS set beforehand in your stylesheet. All you'd need to do is change the CSS variable.&lt;/p&gt;

&lt;p&gt;But hey, what if you use inline styling on both cases? That's when inline styling using a regular variable wins.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fzkl8aoh5ewtpvxpe8lvs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fzkl8aoh5ewtpvxpe8lvs.png" alt="The loop with regular variable can do 83 operations and the loop with the CSS variable can only do 60 operations, making their speed closer than the previous case."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I don't see anyone ever doing this though...&lt;/p&gt;

&lt;p&gt;When you use CSS variables for a ton of animations and transitions on your page, you might wanna start using JS for animation instead. This isn't so much a CSS variable problem as it is the performance of CSS animations in general. However, you can still use CSS variables to pass the CSS while doing the animation logic itself in JS! Here's &lt;a href="https://greensock.com/css-variables/" rel="noopener noreferrer"&gt;a very short article&lt;/a&gt; about using CSS variables with GSAP.&lt;/p&gt;

&lt;h2&gt;
  
  
  How about browser support?
&lt;/h2&gt;

&lt;p&gt;CSS variables are pretty widely used nowadays, and for a great reason too! &lt;strong&gt;All modern browsers&lt;/strong&gt; support this feature at this point. There are just a few things to consider if you need to support legacy browsers as well:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Internet Explorer doesn't support CSS variables at all. If you still need to support IE, you could either opt for a polyfill, but at that point, you're better off just using JS.&lt;/li&gt;
&lt;li&gt;Edge 15 (pre-Chromium) has a few bugs that may hinder you. But honestly, it's almost become impossible to keep Edge 15 installed, so there's very little reason to support it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more information, check out &lt;a href="https://caniuse.com/css-variables" rel="noopener noreferrer"&gt;Can I Use&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  A new world has just opened!
&lt;/h1&gt;

&lt;p&gt;Now that you know how to pass these events, there's so much more you can do with it! If you want to make this work on touch devices, you can use the &lt;code&gt;touchmove&lt;/code&gt; event for it. Try to play around with other events as well! You could make a complex parallax using JavaScript only to pass the &lt;code&gt;scroll&lt;/code&gt; event values and CSS for everything else.&lt;/p&gt;

&lt;p&gt;Not only do you know how to use it, but you also understand &lt;strong&gt;why&lt;/strong&gt; you'd use this, and how this would improve performance.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" alt="Thalita logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/thalitadev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | &lt;a href="https://thalita.dev" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>webdev</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>DISCUSS: Finding inspiration for new projects</title>
      <dc:creator>Thalita G.</dc:creator>
      <pubDate>Thu, 13 May 2021 12:23:14 +0000</pubDate>
      <link>https://dev.to/thalitadev/discuss-finding-inspiration-for-new-projects-1k6n</link>
      <guid>https://dev.to/thalitadev/discuss-finding-inspiration-for-new-projects-1k6n</guid>
      <description>&lt;p&gt;Personal projects are a great addition to your portfolio as a way to showcase not only your skills, but also your general problem-solving and interests! It's the reason why so many people are so focused on it, especially when they haven't been able to make any projects for others yet.&lt;/p&gt;

&lt;p&gt;Personally, I don't have difficulty thinking of new projects. (it's usually the anxiety to start them but let's not focus on that 😅) So no, this isn't so much about me.&lt;/p&gt;

&lt;p&gt;I'd like this discussion to be for those who can't seem to figure out how to find inspiration for new projects. I see this question being asked so often yet I haven't yet encountered any articles that address this. (feel free to share them if you have some! 😉)&lt;/p&gt;

&lt;h1&gt;
  
  
  ✍ Comment below answering the following questions
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Where do you find inspiration and ideas to start a new project?&lt;/li&gt;
&lt;li&gt;Most of us devs aren't exactly good at designing. How do you go around that?&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ciETrbsg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sa0hfs0886uf0g7c0b7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ciETrbsg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sa0hfs0886uf0g7c0b7e.png" alt="Thalita logo" width="50" height="50"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/thalitadev"&gt;Twitter&lt;/a&gt; | &lt;a href="https://thalita.dev"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>watercooler</category>
      <category>career</category>
      <category>motivation</category>
    </item>
    <item>
      <title>DISCUSS: The blurred line between front-end and fullstack</title>
      <dc:creator>Thalita G.</dc:creator>
      <pubDate>Fri, 07 May 2021 14:05:12 +0000</pubDate>
      <link>https://dev.to/thalitadev/discuss-the-blurred-line-between-front-end-and-fullstack-20co</link>
      <guid>https://dev.to/thalitadev/discuss-the-blurred-line-between-front-end-and-fullstack-20co</guid>
      <description>&lt;p&gt;The meaning of a "front-end webdeveloper" has really shifted over the years as more technologies started becoming the norm. Here are two of my favourite articles that talk about this: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/ooooops-i-guess-were-full-stack-developers-now/" rel="noopener noreferrer"&gt;&lt;strong&gt;CSS Tricks&lt;/strong&gt;: ooooops I guess we’re* full-stack developers now&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://bradfrost.com/blog/post/front-of-the-front-end-and-back-of-the-front-end-web-development/" rel="noopener noreferrer"&gt;&lt;strong&gt;Brad Frost&lt;/strong&gt;: front-of-the-front-end and back-of-the-front-end web development&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Front-ends without frontiers
&lt;/h1&gt;

&lt;p&gt;I've started off as a front-end webdeveloper myself. As I started learning more back-end technologies it was hard for me to tell when I could start considering myself a fullstack. Even today, I'm not actually sure where the front-end ends and where the back-end begins.&lt;/p&gt;

&lt;p&gt;The front-end has become such a blurred subject that it made job hunting exceedingly slower. Now you have to carefully read every job description just to determine what kind of "front-end webdeveloper" they're talking about.&lt;/p&gt;

&lt;p&gt;I've even seen job descriptions that use front-end and fullstack interchangeably. Yes. Not even sure if that's intentional or they're a little confused themselves. 😶&lt;/p&gt;

&lt;h1&gt;
  
  
  ✍ Comment below answering the following questions
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Do you consider yourself a fullstack webdeveloper? Why?&lt;/li&gt;
&lt;li&gt;If you could make a clear definition of "front-end" and "fullstack", what would it be?&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;a href="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" alt="Thalita logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/thalitadev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | &lt;a href="https://thalita.dev" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>watercooler</category>
      <category>webdev</category>
    </item>
    <item>
      <title>DISCUSS: Climate change and webdevelopment</title>
      <dc:creator>Thalita G.</dc:creator>
      <pubDate>Thu, 29 Apr 2021 14:05:55 +0000</pubDate>
      <link>https://dev.to/thalitadev/discuss-how-much-does-climate-change-impact-your-decisions-as-a-dev-3d93</link>
      <guid>https://dev.to/thalitadev/discuss-how-much-does-climate-change-impact-your-decisions-as-a-dev-3d93</guid>
      <description>&lt;p&gt;I know, I know! Earth Day has already passed and I should've asked this last week. I only realised after I'd posted last week's discussion post that this topic would have been very relevant to that day. Still, this is worth talking about!&lt;/p&gt;

&lt;p&gt;I'll be mainly focusing on webdev, but this could apply to any programming field.&lt;/p&gt;

&lt;h1&gt;
  
  
  How our decisions could impact the environment
&lt;/h1&gt;

&lt;p&gt;It shouldn't come as a surprise that the internet accounts for almost 4% of global emissions. Here's a &lt;a href="https://www.climatecare.org/resources/news/infographic-carbon-footprint-internet/" rel="noopener noreferrer"&gt;handy infographic&lt;/a&gt; if you'd to know a more!&lt;/p&gt;

&lt;p&gt;It's the reason why big companies are starting to opt for green energy. Think of Google running 100% on renewable energy for several years now. It even has a &lt;a href="https://sustainability.google" rel="noopener noreferrer"&gt;site dedicated to sustainability&lt;/a&gt;! By using Google's services, you're essentially running your stuff on green energy.&lt;/p&gt;

&lt;p&gt;Then, we've got the other side of the hill, like the NFT craze that's still lingering. One of the major arguments against NFT was its environmental impact due to the computing power required for each transaction. Even the &lt;a href="https://www.theatlantic.com/ideas/archive/2021/04/nfts-werent-supposed-end-like/618488" rel="noopener noreferrer"&gt;creator of NFT&lt;/a&gt; talks about it. But right now, the technical solutions to reduce all that computing power are out there.&lt;/p&gt;

&lt;p&gt;That's how we can make a difference. 🌱&lt;/p&gt;

&lt;p&gt;Now, I don't want to go in-depth about this topic. This isn't an article to inform you all of it. Giving some examples might give some clarity on where I'm going with this. I mainly want to hear from others what they think they could do about it!&lt;/p&gt;

&lt;h1&gt;
  
  
  ✍ Comment below answering the following questions
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Do you think your &lt;strong&gt;development process&lt;/strong&gt; can benefit or harm nature, even if in a small way? If so, how?&lt;/li&gt;
&lt;li&gt;Is environmental impact part of your decision-making process when choosing between &lt;strong&gt;products for development&lt;/strong&gt;? (e.g. hosting)&lt;/li&gt;
&lt;li&gt;After reading this short post, do you feel climate change should &lt;strong&gt;cross your mind more often&lt;/strong&gt; in your problem-solving process?&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;a href="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" alt="Thalita logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/thalitadev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | &lt;a href="https://thalita.dev" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>watercooler</category>
      <category>webdev</category>
    </item>
    <item>
      <title>DISCUSS: JavaScript just DIED! What language should replace it?</title>
      <dc:creator>Thalita G.</dc:creator>
      <pubDate>Thu, 22 Apr 2021 12:18:25 +0000</pubDate>
      <link>https://dev.to/thalitadev/discuss-javascript-just-died-what-language-should-replace-it-2ak5</link>
      <guid>https://dev.to/thalitadev/discuss-javascript-just-died-what-language-should-replace-it-2ak5</guid>
      <description>&lt;p&gt;People usually have a love-hate relationship with JavaScript. It's got its beauty and its unavoidable quirks. We're all familiar with them. We can't deny that it's been an absolute powerhouse for the web, though.&lt;/p&gt;

&lt;p&gt;You'll always find Js in the top 10 or even top 5 lists of most popular programming languages. It's also the #1 topic on dev.to!&lt;/p&gt;

&lt;p&gt;But what if all of that suddenly went, like, POOF! 👻&lt;/p&gt;

&lt;h1&gt;
  
  
  Now now, where's this coming from?
&lt;/h1&gt;

&lt;p&gt;First of all, special thanks to @technoglot for the inspiration!&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Her article asked this simple question: What would your tech stack look like if JavaScript didn't exist?&lt;/p&gt;

&lt;p&gt;I'm a webdeveloper through and through. Naturally, I'd start unpacking all CSS-only solutions! However, I started thinking more about the implications of JavaScript's death, like...&lt;/p&gt;

&lt;h1&gt;
  
  
  ✍ Comment below answering the following question
&lt;/h1&gt;

&lt;p&gt;If JavaScript stopped existing, &lt;strong&gt;what language do you think should replace it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, I understand that some programming languages aren't quite ready for things like DOM manipulation and such. Imagine these things would be implemented into said languages.&lt;/p&gt;

&lt;p&gt;Or perhaps you have a better version of JavaScript in mind? 😮☝ Let me know! &lt;/p&gt;




&lt;p&gt;&lt;a href="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" alt="Thalita logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/thalitadev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | &lt;a href="https://thalita.dev" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>watercooler</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>DISCUSS: If there's one CSS feature you could add, what would it be?</title>
      <dc:creator>Thalita G.</dc:creator>
      <pubDate>Thu, 15 Apr 2021 14:08:16 +0000</pubDate>
      <link>https://dev.to/thalitadev/discuss-if-there-s-one-css-feature-you-could-add-what-would-it-be-202j</link>
      <guid>https://dev.to/thalitadev/discuss-if-there-s-one-css-feature-you-could-add-what-would-it-be-202j</guid>
      <description>&lt;p&gt;CSS has gone a very long way from being a simple stylesheet to something more dynamic. Think of calc() and CSS variables. They haven't turned CSS into a programming language, but they sure are helpful!&lt;/p&gt;

&lt;p&gt;But there's still a lot that could be added to CSS! Now, imagine you were a wizard who possesses the entire W3 team and whoever works on our browsers... 🧙‍♂️✨&lt;/p&gt;

&lt;h1&gt;
  
  
  ✍ Comment below answering the following question
&lt;/h1&gt;

&lt;p&gt;If there was one &lt;strong&gt;CSS feature&lt;/strong&gt; you could add that gets &lt;strong&gt;instantly supported&lt;/strong&gt; by all major browsers, what would it be?&lt;/p&gt;

&lt;p&gt;This can be a new feature or something that's already in W3 but isn't supported yet. It also doesn't have to be a property, you can think about functions as well. The possibilities are endless!&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" alt="Thalita logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/thalitadev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | &lt;a href="https://thalita.dev" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>watercooler</category>
      <category>css</category>
    </item>
    <item>
      <title>TIP: Never leave your email address raw in the mailto link! Here's what to do instead</title>
      <dc:creator>Thalita G.</dc:creator>
      <pubDate>Wed, 14 Apr 2021 17:36:09 +0000</pubDate>
      <link>https://dev.to/thalitadev/tip-never-leave-your-email-address-raw-in-the-mailto-link-here-s-what-to-do-instead-1c70</link>
      <guid>https://dev.to/thalitadev/tip-never-leave-your-email-address-raw-in-the-mailto-link-here-s-what-to-do-instead-1c70</guid>
      <description>&lt;p&gt;Usually, when you leave your email address on your website for people to click on, you may do something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"mailto:name@example.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;name@example.com&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Right?&lt;/p&gt;

&lt;p&gt;This is, however, the perfect recipe to get spam into your email!&lt;/p&gt;

&lt;h1&gt;
  
  
  This is how email harvesting works
&lt;/h1&gt;

&lt;p&gt;In order for spambots to get a nice long list of emails to annoy people to click their suspicious-looking links, they use email harvesters to curate these lists. Emails are typically found on websites where people leave theirs to be contacted.&lt;/p&gt;

&lt;p&gt;Some people think this is easy to solve simply by masking the email like &lt;code&gt;name[AT]example[DOT]com&lt;/code&gt;. This, however, doesn't solve anything due to two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The mailto link still contains the actual email address as you can't replace it with the one above. Since email harvesters look into the source code of your website, they'd still be able to get your email.&lt;/li&gt;
&lt;li&gt;Most email harvesters are advanced enough to detect common patterns like [AT] and (AT) and such, so they won't do much.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, what now?&lt;/p&gt;

&lt;h1&gt;
  
  
  Encode your email address
&lt;/h1&gt;

&lt;p&gt;Fortunately, there's a way to make your email address unreadable for email harvesters!&lt;/p&gt;

&lt;p&gt;You may have seen characters like &lt;code&gt;&amp;amp;amp;&lt;/code&gt; and &lt;code&gt;&amp;amp;gt;&lt;/code&gt; in HTML before. These are called &lt;strong&gt;HTML entities&lt;/strong&gt;. These are symbols that have been encoded so they won't be mistaken for HTML tags.&lt;/p&gt;

&lt;p&gt;However, what not many people know is that you can encode every single character into an HTML entity. And even better, putting these into your hrefs will convert them back into regular text for normal visitors that are visiting your website rather than looking at the source code. It's perfect for this situation!&lt;/p&gt;

&lt;p&gt;HTML entities for regular letters are made of HEX encoding. The HTML entities would look like like &lt;code&gt;&amp;amp;#HEXCODE;&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Let's do it!
&lt;/h1&gt;

&lt;p&gt;Use &lt;a href="https://onlineutf8tools.com/convert-utf8-to-html-entities" rel="noopener noreferrer"&gt;this handy tool&lt;/a&gt; to convert! Make sure to copy the entire href link, not just your email address!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F4wp8z4lq06l79pradccx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F4wp8z4lq06l79pradccx.jpg" alt="Example screenshot of how to convert the link"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;After that, copy-paste that string into your href and you're done! Here's how it should look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"&amp;amp;#x6d;&amp;amp;#x61;&amp;amp;#x69;&amp;amp;#x6c;&amp;amp;#x74;&amp;amp;#x6f;&amp;amp;colon;&amp;amp;#x6e;&amp;amp;#x61;&amp;amp;#x6d;&amp;amp;#x65;&amp;amp;commat;&amp;amp;#x65;&amp;amp;#x78;&amp;amp;#x61;&amp;amp;#x6d;&amp;amp;#x70;&amp;amp;#x6c;&amp;amp;#x65;&amp;amp;period;&amp;amp;#x63;&amp;amp;#x6f;&amp;amp;#x6d;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;My email&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes the whole thing a lot harder to decypher for most email harvesters. That, while still keeping the link clickable for others! On top of that, using inspect element to check the HTML gives you the decoded email, even though the source code has it encoded!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fvb34uh9ajgg3gohr8aa7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fvb34uh9ajgg3gohr8aa7.jpg" alt="Comparison of devtools and source code"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This means that it still ends up being readable for humans.&lt;/p&gt;

&lt;p&gt;It's even better if you use some non-traditional way of masking your email address in the actual text, or just don't use your email at all (like in the sample above).&lt;/p&gt;

&lt;p&gt;We're all good now! No more disappointments that you think you just got a client but it turns out to be spam!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F85t5l2vp28xdw748e2tv.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F85t5l2vp28xdw748e2tv.gif" alt="Good job fellow dev"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" alt="Thalita logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/thalitadev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | &lt;a href="https://thalita.dev" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>html</category>
      <category>security</category>
    </item>
    <item>
      <title>DISCUSS: How would the ideal browser for devs be like?</title>
      <dc:creator>Thalita G.</dc:creator>
      <pubDate>Thu, 08 Apr 2021 12:51:50 +0000</pubDate>
      <link>https://dev.to/thalitadev/discuss-how-would-the-ideal-browser-for-devs-be-like-3l84</link>
      <guid>https://dev.to/thalitadev/discuss-how-would-the-ideal-browser-for-devs-be-like-3l84</guid>
      <description>&lt;p&gt;Imagine a world where devs have the perfect browser to make and debug websites with... a browser that helps us develop faster and more efficiently... how would it be like?&lt;/p&gt;

&lt;p&gt;Firefox is always seen as one of the best browsers among the most popular ones, and there are already dev-oriented browsers like &lt;a href="https://polypane.app" rel="noopener noreferrer"&gt;Polypane&lt;/a&gt;, but could we go a step further?&lt;/p&gt;

&lt;h1&gt;
  
  
  ✍ Comment below answering these two questions
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;What browser do you currently use and why?&lt;/li&gt;
&lt;li&gt;How do you see a perfect browser for devs? What features would it have? Think of stuff like: an even more advanced CSS debugger than Firefox', an in-built colour picker, accessibility tools etc.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;a href="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" alt="Thalita logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/thalitadev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | &lt;a href="https://thalita.dev" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>watercooler</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to get a free custom email domain + hosting AND launch your first newsletter</title>
      <dc:creator>Thalita G.</dc:creator>
      <pubDate>Thu, 01 Apr 2021 23:29:15 +0000</pubDate>
      <link>https://dev.to/thalitadev/how-to-get-a-free-custom-email-domain-hosting-and-launch-your-first-newsletter-3nm4</link>
      <guid>https://dev.to/thalitadev/how-to-get-a-free-custom-email-domain-hosting-and-launch-your-first-newsletter-3nm4</guid>
      <description>&lt;h2&gt;
  
  
  Table of contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Receiving and sending emails&lt;/li&gt;
&lt;li&gt;Sending newsletter&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many tutorials have become out-of-date, aren't truly free, are unnecessarily complicated, or provide email services that aren't compatible with others. Since I've managed to solve this on my own, I might as well share how I did it!&lt;/p&gt;

&lt;p&gt;This website is being hosted on &lt;a href="https://www.netlify.com" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt;, which doesn't offer email hosting. Since I wanted to write newsletters, I had to find a way to get a custom email domain!&lt;/p&gt;

&lt;p&gt;I'd also decided to use &lt;a href="https://buttondown.email/" rel="noopener noreferrer"&gt;ButtonDown&lt;/a&gt; to write newsletters, so I wanted to make sure that everything works smoothly.&lt;/p&gt;

&lt;p&gt;Let's get started right away!&lt;/p&gt;

&lt;h1&gt;
  
  
  Receiving and sending emails &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;I assume you've already registered your domain (I use &lt;a href="https://www.namesilo.com/" rel="noopener noreferrer"&gt;NameSilo&lt;/a&gt; by the way 😉) and are hosting on Netlify. We'll be adding DNS records through Netlify.&lt;/p&gt;

&lt;p&gt;For receiving and sending emails, we'll use &lt;a href="https://www.zoho.com/mail/" rel="noopener noreferrer"&gt;Zoho&lt;/a&gt;. Zoho's email service has a free plan that includes using your custom domain. If you don't mind not being able to do any IMAP/POP for forwarding, it's the perfect free solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Register to Zoho
&lt;/h2&gt;

&lt;p&gt;Visit &lt;a href="https://www.zoho.com/mail/zohomail-pricing.html/" rel="noopener noreferrer"&gt;Zoho's pricing page&lt;/a&gt;, scroll down to the "Forever Free Plan" and sign up. Write your domain and complete your registration. Don't worry about choosing a name for your admin account, you'll be able to create as many aliases as you like.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fddxxnnqeucv17o6dm8nl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fddxxnnqeucv17o6dm8nl.jpg" alt="Zoho's register screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Add DNS records
&lt;/h2&gt;

&lt;p&gt;Zoho takes you through its onboarding progress, including adding DNS records.&lt;/p&gt;

&lt;p&gt;First, we need to verify our domain. Select "Others" from the list of DNS managers. We'll verify the site through a TXT record.&lt;/p&gt;

&lt;p&gt;To do to Netlify's DNS settings, go to your Netlify dashboard, select your domain, go to &lt;strong&gt;Domain Settings&lt;/strong&gt;, and then &lt;strong&gt;Go to DNS panel&lt;/strong&gt; under your primary domain's options. Adding a new record gets you a modal where you can fill in the DNS record.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;img src="https://media.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%2Fe6hkn0jfos23dsn1btrf.jpg" alt="Adding a new DNS record to Netlify"&gt;
&lt;/h1&gt;

&lt;p&gt;Here's what needs to be filled in (TTL in seconds to be left blank):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Record type&lt;/strong&gt;: TXT&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Name&lt;/strong&gt;: @&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Value&lt;/strong&gt;: zoho-verification=(code provided by Zoho).zmverify.zoho.eu&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It may sometimes take a while before the DNS records get updated, so if the verification doesn't work right away, try again.&lt;/p&gt;

&lt;p&gt;Next, we add the &lt;strong&gt;MX records&lt;/strong&gt;. MX (Mail Exchange) records specify the server that should handle emails. Each MX record has its priority number, the lower the number the higher the priority of that server. This means that when an email to the domain is detected, the server with the highest priority will catch it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fxbhgdn9p8esojr3mk0xs.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fxbhgdn9p8esojr3mk0xs.jpg" alt="Visual explainer about the purpose of MX records"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Zoho has 3 different MX records in case one of them is down. Here's an overview of all three.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
        &lt;thead&gt;
            &lt;tr&gt;
                &lt;th&gt;Record type&lt;/th&gt;
                &lt;th&gt;Name&lt;/th&gt;
                &lt;th&gt;Priority&lt;/th&gt;
                &lt;th&gt;Value&lt;/th&gt;
            &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
            &lt;tr&gt;
                &lt;td&gt;MX&lt;/td&gt;
                &lt;td&gt;@&lt;/td&gt;
                &lt;td&gt;10&lt;/td&gt;
                &lt;td&gt;mx.zoho.eu&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;MX&lt;/td&gt;
                &lt;td&gt;@&lt;/td&gt;
                &lt;td&gt;20&lt;/td&gt;
                &lt;td&gt;mx2.zoho.eu&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;MX&lt;/td&gt;
                &lt;td&gt;@&lt;/td&gt;
                &lt;td&gt;50&lt;/td&gt;
                &lt;td&gt;mx3.zoho.eu&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/tbody&gt;
    &lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Zoho is one of the few email services that allow you to have MX records from different services. This is the reason why I decided to go for it as Zoho allows you the most freedom when it comes to DNS records.&lt;/p&gt;

&lt;p&gt;Lastly, we add &lt;strong&gt;SPF&lt;/strong&gt; (Sender Policy Framework), which is another TXT record. It allows Zoho to send your emails through its server. You'll only be able to receive emails without adding the SPF.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fjgg0em97odxsa1l3ka8q.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fjgg0em97odxsa1l3ka8q.jpg" alt="Visual explainer about the purpose of SPF"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's the TXT record that needs to be added:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Record type&lt;/strong&gt;: TXT&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Name&lt;/strong&gt;: @&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Value&lt;/strong&gt;: v=spf1 include:zoho.eu ~all&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This record needs to be modified later in the tutorial during the newsletter setup, but we'll use this for now.&lt;/p&gt;

&lt;p&gt;You can also add a &lt;strong&gt;DKIM signature&lt;/strong&gt; to your domain. A DKIM (DomainKeys Identified Mail) signature is a unique identifier for your email address so your emails won't end up in spam, since it verifies that the email hasn't been spoofed. This is optional but highly recommended.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fb3zuco75i2tu33awchlf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fb3zuco75i2tu33awchlf.jpg" alt="Visual explainer about the purpose of a DKIM signature"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;Proceed to Configure DKIM&lt;/strong&gt; and you'll be taken to another page to create a new selector. The selector's name can be anything you like. Personally, I go for "zoho" to ensure the name won't conflict with anything else I may add in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Ft8ucuoro0kacryq3ryhc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ft8ucuoro0kacryq3ryhc.jpg" alt="Create a new selector on Zoho"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll then have to create a TXT record that contains the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Record type&lt;/strong&gt;: TXT&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Name&lt;/strong&gt;: zoho._domainkey (or whatever selector name you've chosen)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Value&lt;/strong&gt;: v=DKIM1; k=rsa; p=(your unique key, don't show this anywhere in public!)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Create your email aliases (optional)
&lt;/h2&gt;

&lt;p&gt;Now that everything has finally been set up, it's time to create some aliases if you need any.&lt;/p&gt;

&lt;p&gt;To create an alias for your existing account, go to Zoho's &lt;strong&gt;Control Panel&lt;/strong&gt;, go to &lt;strong&gt;User Details&lt;/strong&gt;, and select your account. Then, go to &lt;strong&gt;Mail Accounts&lt;/strong&gt; and you'll be able to manage your aliases there.&lt;/p&gt;

&lt;p&gt;Zoho allows you to use as many aliases as you like, so feel free to go crazy there.&lt;/p&gt;

&lt;p&gt;And that's it! Feel free to test your new email address by sending an email to it and sending one back.&lt;/p&gt;

&lt;h1&gt;
  
  
  Sending newsletters &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;I wanted to go for ButtonDown because it's a very generous newsletter service. It's free when you have under 1000 subscribers. You can also generate RSS feeds, and it automatically creates a newsletter archive for you. On top of that, it's very &lt;a href="https://buttondown.email/features/privacy" rel="noopener noreferrer"&gt;privacy-friendly&lt;/a&gt;. Definitely something to appreciate!&lt;/p&gt;

&lt;p&gt;Zoho also has its own &lt;a href="https://www.zoho.com/campaigns/" rel="noopener noreferrer"&gt;newsletter service&lt;/a&gt; that has a free plan as well, so feel free to check that out if you prefer to stay in the Zoho ecosystem.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Register your account and set up your newsletter
&lt;/h2&gt;

&lt;p&gt;Your username will be used to refer to you in newsletters (eg. in the from field), while your email address will be the &lt;strong&gt;custom domain used to send your newsletter&lt;/strong&gt;. The email address you use for the newsletter can be an alias you made in your Zoho account. It doesn't have to be though, especially if you add ButtonDown's MX records. I just think it's more convenient to receive all your emails in one place.&lt;/p&gt;

&lt;p&gt;You can change these any time of course.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Add DNS records
&lt;/h2&gt;

&lt;p&gt;Yup, we're doing the DNS thing again.&lt;/p&gt;

&lt;p&gt;First, we add the &lt;strong&gt;MX records&lt;/strong&gt;. For the same reason as Zoho, it has 2 records so the second can backup the first. ButtonDown doesn't provide any priority numbers, so we have to choose those ourselves.&lt;/p&gt;

&lt;p&gt;ButtonDown's MX records aren't necessary since &lt;strong&gt;Zoho already manages inbound mails for you&lt;/strong&gt;, but since some email services check MX records to see whether the email should be in spam or not, so I'd rather just keep them.&lt;/p&gt;

&lt;p&gt;In order to avoid the least conflict possible, we put ButtonDown's MX records in an entirely different subdomain. ButtonDown allows its MX records to be put anywhere on your domain. Feel free to choose any subdomain here. Personally, I went for "buttondown".&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
        &lt;thead&gt;
            &lt;tr&gt;
                &lt;th&gt;Record type&lt;/th&gt;
                &lt;th&gt;Name&lt;/th&gt;
                &lt;th&gt;Priority&lt;/th&gt;
                &lt;th&gt;Value&lt;/th&gt;
            &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
            &lt;tr&gt;
                &lt;td&gt;MX&lt;/td&gt;
                &lt;td&gt;buttondown&lt;/td&gt;
                &lt;td&gt;10&lt;/td&gt;
                &lt;td&gt;mxa.mailgun.org&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;MX&lt;/td&gt;
                &lt;td&gt;buttondown&lt;/td&gt;
                &lt;td&gt;20&lt;/td&gt;
                &lt;td&gt;mxb.mailgun.org&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/tbody&gt;
    &lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Next, we add a &lt;strong&gt;CNAME record&lt;/strong&gt;. A CNAME (Canonical Name) record will run a server under the domain you've chosen. In this case, ButtonDown uses Mailgun's CNAME record to be able to track email clicks and opens using Mailgun's API. If you want analytics on your emails, you'll need this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F6olc6rbh5gegstkmvga9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F6olc6rbh5gegstkmvga9.jpg" alt="Visual explainer about how CNAME records work"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lastly, we add a few TXT records. The following is for domain verification:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Record type&lt;/strong&gt;: TXT&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Name&lt;/strong&gt;: smtp._domainkey&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Value&lt;/strong&gt;: k=rsa; p=(your unique key, don't show this anywhere in public!)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now we need to do some tinkering. Both Zoho and ButtonDown use &lt;strong&gt;SPF&lt;/strong&gt; for sending emails, and adding both records separately leads to some conflicts, since they check the first SPF that appears and nothing else. This means that all SPFs need to be in one record. We're going have to merge the two.&lt;/p&gt;

&lt;p&gt;Delete the current SPF that we've added earlier, since we can't edit records. Instead, add this record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Record type&lt;/strong&gt;: TXT&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Name&lt;/strong&gt;: @&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Value&lt;/strong&gt;: v=spf1 include:zoho.eu include:mailgun.org ~all&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;v=spf1 refers to the type of TXT, ~all refers to the domains being allowed to send anything, and between these two you can include any domains to allow them to send emails.&lt;/p&gt;

&lt;p&gt;So now, both Zoho and Mailgun are allowed to send emails. Neat!&lt;/p&gt;

&lt;p&gt;Once again, it could take a while for the DNS records to be updated. If the verification doesn't work right away, try again.&lt;/p&gt;

&lt;p&gt;And there we go! Not only you have a free custom domain for your email now, you even have an up and running newsletter! ButtonDown is full of options, so make sure to look around and customise it to your audience's needs.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" alt="Thalita logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/thalitadev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | &lt;a href="https://thalita.dev" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>career</category>
      <category>email</category>
    </item>
    <item>
      <title>DISCUSS: The Locomotive scroll — what do you guys think of it?</title>
      <dc:creator>Thalita G.</dc:creator>
      <pubDate>Mon, 29 Mar 2021 12:33:21 +0000</pubDate>
      <link>https://dev.to/thalitadev/the-locomotive-scroll-what-do-you-guys-think-of-it-48gc</link>
      <guid>https://dev.to/thalitadev/the-locomotive-scroll-what-do-you-guys-think-of-it-48gc</guid>
      <description>&lt;p&gt;The locomotive scroll is always a bit of a hit-or-miss to designers. Some absolutely hate it due to questionable UX, but many agencies that have Awwwards SOTD sites use it (or something similar) so it's definitely widely loved as well. Others think that it depends on the site and whether it adds to the overall experience.&lt;/p&gt;

&lt;p&gt;I don't hear this topic a lot among devs though, so I wonder what you guys think of it!&lt;/p&gt;

&lt;h1&gt;
  
  
  What is the locomotive scroll?
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/locomotivemtl/locomotive-scroll" rel="noopener noreferrer"&gt;Github repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Locomotive scroll is a smooth scrolling plugin made by the web agency (surprise surprise) &lt;a href="https://locomotive.ca/" rel="noopener noreferrer"&gt;Locomotive&lt;/a&gt;. All you have to do is add the plugin, initialise it, and add a tiny bit of HTML where you'd like the scrolling behaviour to be. It also includes parallax features using the "scroll speed" of your elements.&lt;/p&gt;

&lt;p&gt;What it does is replacing the default scrolling behaviour of pages and replace it with a much more easened scroll. This generally gives scrolling through the page a more pleasing feeling.&lt;/p&gt;

&lt;p&gt;Here are some examples of sites that use the locomotive scroll (or similar behaviour that looks like it):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://locomotivemtl.github.io/locomotive-scroll/" rel="noopener noreferrer"&gt;The plugin's demo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://locomotive.ca/" rel="noopener noreferrer"&gt;Locomotive's site&lt;/a&gt; (of course...)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://normal.studio/" rel="noopener noreferrer"&gt;Normal Studio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://thierrychopain.com" rel="noopener noreferrer"&gt;Thierry Chopain&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://synchronized.studio" rel="noopener noreferrer"&gt;Synchronized studio&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  ✍ Comment below answering the following question
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Do you find it mezmerising or are you one of those people who absolutely can't stand it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Elaborated a bit on how Locomotive scroll works for those who aren't familiar with plugins like this one.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fsa0hfs0886uf0g7c0b7e.png" alt="Thalita logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/thalitadev" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | &lt;a href="https://thalita.dev" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>discuss</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Celebrating my website launch</title>
      <dc:creator>Thalita G.</dc:creator>
      <pubDate>Mon, 22 Mar 2021 15:07:05 +0000</pubDate>
      <link>https://dev.to/thalitadev/celebrating-my-website-launch-3h9n</link>
      <guid>https://dev.to/thalitadev/celebrating-my-website-launch-3h9n</guid>
      <description>&lt;p&gt;&lt;em&gt;After a long time, I have finally updated my website and decided to start my blog with it. Here's my first post, explaining the progress that I went through.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I started helping people on the &lt;a href="https://scrimba.com/"&gt;Scrimba&lt;/a&gt; Discord server shortly after it was launched. I realised that perhaps my knowledge and explanations could be valuable. I'd also discovered places where you could share your posts, like dev.to. It made me start thinking about starting a blog, a place where I can share my experience with others.&lt;/p&gt;

&lt;p&gt;And now, I'm finally writing my first post ever. On a brand-new website.&lt;/p&gt;

&lt;h1&gt;
  
  
  Goals and constraints
&lt;/h1&gt;

&lt;p&gt;I've just started looking for a new job, so I had to make sure I got a newly updated website as soon as possible, while still making this a comfortable space for myself.&lt;/p&gt;

&lt;p&gt;So, the site must:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Be finished within 2 weeks&lt;/li&gt;
&lt;li&gt;Show off my personality and what I enjoy&lt;/li&gt;
&lt;li&gt;Showcase my skills right off the bat&lt;/li&gt;
&lt;li&gt;Use my favourite stack, the JAMstack&lt;/li&gt;
&lt;li&gt;Be usable on devices and browsers that block JavaScript&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  The design
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aCsC3TQ3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j9tkwn9alrbcrogdoh6l.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aCsC3TQ3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j9tkwn9alrbcrogdoh6l.jpg" alt="A draft of the design I made in 2020" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I already had a general idea of the design last year. The website would be made of windows. The homepage including my little bot tracking your mouse position. It'd have the navigation at the bottom since it's a much more logical location on mobile. It'd have theme options that'd always use any shade of red as its main colour. It'd show your current location on the website for easy navigation.&lt;/p&gt;

&lt;p&gt;The terminal-like introduction on my homepage came later. So did the little header on top of the window containing your current location. The idea of the latter was already there at the time. I just didn't know where to place it.&lt;/p&gt;

&lt;p&gt;Initially, I was planning to add a lot of different particles and motion in the background to add to the tech-like feeling. However, I decided to leave it as it is now as I started to take a liking its current look while developing. My website should be a place for people to read my articles, so a lot of white space and lack of distracting elements would help a lot with that.&lt;/p&gt;

&lt;h1&gt;
  
  
  The tools
&lt;/h1&gt;

&lt;p&gt;I've been a huge fan of &lt;a href="https://www.11ty.dev/"&gt;Eleventy&lt;/a&gt; for over a year now, so it was a given that I'd use that to make my website. It's a very lightweight and flexible static site generator that doesn't depend on any JavaScript. It's closer to Jekyll than Gatsby, as you create your pages using markdown files while using nunjucks for templating.&lt;/p&gt;

&lt;p&gt;So I'd at least already decided on that. Since I didn't have a lot of time to make this, I had to make a few shortcuts along the way.&lt;/p&gt;

&lt;p&gt;I wanted to give the website the feeling that it is a single-page web application by making page transitions. The history API was the answer to this. However, after doing some research, I've found that the history API doesn't come without its caveats and edge-case problems. Instead of taking the time to further research and write code for all of that, I decided to use an already existing plugin, Swup. Not only does &lt;a href="https://swup.js.org/"&gt;Swup&lt;/a&gt; deal with page transitions, but it also captures pages in advance when you hover over the links using its "preload plugin". Excellent!&lt;/p&gt;

&lt;p&gt;The other plugin I've used is &lt;a href="https://grsmto.github.io/simplebar/"&gt;SimpleBar&lt;/a&gt;. It's a lightweight plugin that adds cross-browser scrollbars. I simply wanted to make sure the scrollbar looked great on any browser, as the default scrollbar would break the look of these little windows.&lt;/p&gt;

&lt;p&gt;These two already saved me enough time that I could code everything else on my own. The themes are saved in LocalStorage. The site also checks in SessionStorage whether you've already visited the homepage in your current session. That way you wouldn't have to go through the entire terminal-like experience again.&lt;/p&gt;

&lt;h1&gt;
  
  
  The blog
&lt;/h1&gt;

&lt;p&gt;This blog is my space for anything I'd like to share. This means that not only will I talk about dev itself, I may also talk about productivity and career life. Since I'm also into illustration, I'd like to add little drawings to my articles whenever they help convey the message.&lt;/p&gt;

&lt;p&gt;The content on dev.to and on this website will be slightly different. Dev.to gets only dev and career-related articles and this website gets the full package. Makes sense huh?&lt;/p&gt;

&lt;h1&gt;
  
  
  What's next?
&lt;/h1&gt;

&lt;p&gt;There's still a lot that needs to be done on this website. I couldn't do most of these just yet out of time constraints.&lt;/p&gt;

&lt;p&gt;Here are some things I plan to do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Making the interactive timeline page&lt;/li&gt;
&lt;li&gt;Tackling accessibility&lt;/li&gt;
&lt;li&gt;Adding some extra pages such as my work progress&lt;/li&gt;
&lt;li&gt;Ability to filter the blog by tag&lt;/li&gt;
&lt;li&gt;Adding RSS (it's still relevant, folks!)&lt;/li&gt;
&lt;li&gt;Get a newsletter where I share not only my own posts but anything else dev or design-related I've found on the internet&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My next posts will mainly consist of tutorials related to things I've made for this website. It's still a bit of a mystery of what I'll be doing after that, but I can say for sure I've got a lot of exciting stuff to talk about.&lt;/p&gt;

&lt;p&gt;So, until next time!&lt;/p&gt;

&lt;p&gt;Oh, and have a pat pat gif of my bot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VNj008hu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzuiz2j58f5sfyg9f0jv.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VNj008hu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzuiz2j58f5sfyg9f0jv.gif" alt="d00ebb60-98b7-44a4-aecf-bb5c381bcc86-withbg" width="500" height="500"&gt;&lt;/a&gt; &lt;/p&gt;




&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ciETrbsg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sa0hfs0886uf0g7c0b7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ciETrbsg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sa0hfs0886uf0g7c0b7e.png" alt="Thalita logo" width="50" height="50"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/thalitadev"&gt;Twitter&lt;/a&gt; | &lt;a href="https://thalita.dev"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devjournal</category>
    </item>
  </channel>
</rss>
