<?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>Forem: codedgar</title>
    <description>The latest articles on Forem by codedgar (@codedgar).</description>
    <link>https://forem.com/codedgar</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%2F177738%2Ff0cb77d3-762e-4222-8004-832d3cc35974.png</url>
      <title>Forem: codedgar</title>
      <link>https://forem.com/codedgar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/codedgar"/>
    <language>en</language>
    <item>
      <title>How to create a dark theme system in 5 minutes or less with vanilla JS.</title>
      <dc:creator>codedgar</dc:creator>
      <pubDate>Sat, 17 Oct 2020 05:56:01 +0000</pubDate>
      <link>https://forem.com/codedgar/how-to-create-a-dark-theme-system-in-5-minutes-or-less-with-vanilla-js-2922</link>
      <guid>https://forem.com/codedgar/how-to-create-a-dark-theme-system-in-5-minutes-or-less-with-vanilla-js-2922</guid>
      <description>&lt;p&gt;A long time ago, in my old blog, I wrote an article called "How to create a dark theme system with jQuery". And I think this is the perfect moment to create a &lt;strong&gt;simpler, cleaner and better dark system, free of jQuery&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I use this same system (But expanded) &lt;strong&gt;&lt;a href="https://codedgar.me/" rel="noopener noreferrer"&gt;on my own website&lt;/a&gt;!&lt;/strong&gt; You can find all the code in &lt;a href="https://github.com/codedgar/darkmode-in-5-minutes" rel="noopener noreferrer"&gt;this GitHub repo.&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/codedgar" rel="noopener noreferrer"&gt;
        codedgar
      &lt;/a&gt; / &lt;a href="https://github.com/codedgar/darkmode-in-5-minutes" rel="noopener noreferrer"&gt;
        darkmode-in-5-minutes
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Tutorial of darkmode with vanilla JS and vanilla CSS
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;To make the article simpler to read, I've cut up the article in chunks, check this out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Intro - CSS variables.&lt;/li&gt;
&lt;li&gt;The basics - Toggling classes.&lt;/li&gt;
&lt;li&gt;Summing it up - Saving and retrieving the setting.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Intro - CSS variables
&lt;/h2&gt;

&lt;p&gt;CSS Variables are exactly what they sound like, variables, and this comes very handy for our system. It means that we can define &lt;strong&gt;all the colors in one CSS class&lt;/strong&gt;, instead of nesting the colors that we are going to use all across our website.&lt;/p&gt;

&lt;p&gt;Wrong&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.dark_mode&amp;gt;body{
    background: #000;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Nice&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.dark_mode{
    --body_bg: #000;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Using CSS variables prevents you from having to use child selectors, but rather use a class. This makes it easier to have even several themes and helps to have all of your colors defined in just one class.&lt;/p&gt;

&lt;p&gt;This also means that you now will have to defined colors this way:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:root{
    --text-color: #000;
    --body-bg: #fff;
}
body{
    color: var(--text-color);
    background: var(--body-bg);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;So, go ahead and find &lt;strong&gt;every color you want to change in your CSS&lt;/strong&gt;, and do it this way. This is the perfect moment to open up the developer tools and &lt;strong&gt;select the colors you want your website to have in dark mode and defined into a class called "dark_mode"&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You just did the intro, hooray!&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The basics - Toggling classes.
&lt;/h2&gt;

&lt;p&gt;Now that you have your CSS redefined, it's time to get into JS territory, are you ready? &lt;strong&gt;&lt;em&gt;Let's do it&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The main thing we need to do is create a button, and  retrieve it element, we can do that by just using a simple:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.querySelector('#theme_toggler');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Now that we have the element, we have to define it in order to add an event listener:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let theme_toggler = document.querySelector('#theme_toggler');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Ok, so what do we do on our friend the theme_toggler? We need to add an event listener that toggles the class on our body tag, and that's pretty easy, we do it like so:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

let theme_toggler = document.querySelector('#theme_toggler');

theme_toggler.addEventListener('click', function(){ 
    document.body.classList.toggle('dark_mode');
});


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

&lt;/div&gt;
&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/Codedgar/embed/bGebbqj?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;As you can see in the example, is working kinda nicely!&lt;/p&gt;

&lt;p&gt;"&lt;em&gt;Cool, it is ready? Can I leave? Could you let go my arm?&lt;/em&gt;" Sadly the answer is &lt;em&gt;sort of, no and  no&lt;/em&gt;... You see, it toggles the class, but if your user recharges the website or leaves and comeback, there's nothing telling the browser to store it, so you would have to click again... And again, and again. &lt;strong&gt;Which takes us to our last step&lt;/strong&gt;!&lt;/p&gt;
&lt;h2&gt;
  
  
  Summing it up - Saving and retrieving the setting.
&lt;/h2&gt;

&lt;p&gt;Ok, now that we are toggling the class, we have just one step left, and that's saving the setting with our good buddy and pal, &lt;strong&gt;localStorage&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;localStorage comes perfect in this kind of situations because it's simple to use. We just need to do &lt;strong&gt;3 main things&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save the setting&lt;/li&gt;
&lt;li&gt;Retrieving the setting&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BONUS&lt;/strong&gt;: Adding an event listener to the localStorage event&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Saving the setting
&lt;/h3&gt;

&lt;p&gt;Let's start with saving the setting, and this is very simple:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;localStorage.setItem('website_theme' , 'dark_mode');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Here we're are setting the dark_mode, but not disabling it, to toggle the dark_mode on and off we need to do the following:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if(document.body.classList.contains('dark_mode')){
    localStorage.setItem('website_theme','dark_mode');
}else{
    localStorage.setItem('website_theme','default');
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;This checks if the body element has the &lt;strong&gt;dark_mode class&lt;/strong&gt;. If it doesn't it sets it to a &lt;strong&gt;default class&lt;/strong&gt; theme.&lt;/p&gt;
&lt;h3&gt;
  
  
  Retrieving the class
&lt;/h3&gt;

&lt;p&gt;This is even simpler, we first need to verify if the item of the localStorage exists, and if it does we just apply the class that we saved on the localStorage, being &lt;strong&gt;default&lt;/strong&gt; or &lt;strong&gt;dark_mode&lt;/strong&gt;, then we call it as a function.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function retrieve_theme(){
    var theme = localStorage.getItem('website_theme');
    if(theme != null){
        document.body.classList.remove('default', 'dark_mode'); 
        document.body.classList.add(theme);
    }
}
retrieve_theme();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;And that's pretty much it! If you reload the page, the theme will be saved! &lt;strong&gt;&lt;em&gt;Now just a bonus, because you deserve it&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  BONUS: Adding an event listener to the localStorage event.
&lt;/h3&gt;

&lt;p&gt;Surprisingly enough, adding an event listener to the localStorage is fairly simple. And what does this do? This makes all of the tabs open of your page synchronized, &lt;strong&gt;TLDR: Change it on one tab, and it's gonna change in all of them&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Ok and how do we do that? Simple, we do it like this:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;window.addEventListener("storage",function(){
    retrieve_theme();
},false);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Piece of cake? Am i rite? That's all you need to know! And this is our final result:&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/Codedgar/embed/yLJBzMZ?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/codedgar" rel="noopener noreferrer"&gt;
        codedgar
      &lt;/a&gt; / &lt;a href="https://github.com/codedgar/darkmode-in-5-minutes" rel="noopener noreferrer"&gt;
        darkmode-in-5-minutes
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Tutorial of darkmode with vanilla JS and vanilla CSS
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With dark themes becoming more and more popular, creating dark better dark themes with less code is great, and I hope you can add your amazing theme and make your website super cool. See ya around!&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why should you create your own framework. - Presenting Puppertino!</title>
      <dc:creator>codedgar</dc:creator>
      <pubDate>Sat, 27 Jun 2020 18:04:27 +0000</pubDate>
      <link>https://forem.com/codedgar/why-should-you-create-your-own-framework-presenting-puppertino-31ib</link>
      <guid>https://forem.com/codedgar/why-should-you-create-your-own-framework-presenting-puppertino-31ib</guid>
      <description>&lt;p&gt;OK, I know you don't know what &lt;a href="https://github.com/codedgar/Puppertino" rel="noopener noreferrer"&gt;Puppertino&lt;/a&gt; is, and in short, it's a CSS framework created by me! What makes it special? And why should &lt;em&gt;you&lt;/em&gt; create your own framework? Keep reading to know!&lt;/p&gt;

&lt;p&gt;Hi! I'm Codedgar and today I'm gonna talk about Puppertino and why you should consider creating your own framework!&lt;/p&gt;

&lt;h1&gt;
  
  
  First: "But why?"
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F46s31o7sydvtto6xwfst.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F46s31o7sydvtto6xwfst.gif" alt="But Why gif" width="498" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some people might say "Ugh, another CSS framework, why?", and I understand that there are a lot of CSS and JS frameworks around nowadays, but the main reason why I'm developing Puppertino is...&lt;/p&gt;

&lt;h1&gt;
  
  
  KNOWLEDGE
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fu6u902zt5gontlva4q8m.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fu6u902zt5gontlva4q8m.gif" alt="Knowledge Gif" width="498" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I love to say that coding knowledge is a never-ending mountain, the more you climb, the more you realize that the top isn't near. And that's the main reason why I'm creating Puppertino. But let's dive inside why I think you also should create your own framework!&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;1- Knowledge&lt;br&gt;
2- Use it yourself&lt;br&gt;
3- Give something to the community&lt;/p&gt;

&lt;h2&gt;
  
  
  1- Knowledge
&lt;/h2&gt;

&lt;p&gt;I already said this, but I wanna emphasize a little bit more about it.&lt;br&gt;
By having an open project, people can see what you have created, allowing them to modify and suggest changes to make your code faster, more appealing, and maybe teach you something you didn't know.&lt;/p&gt;

&lt;p&gt;You might find also a lot of challenges across the way, and crossing them will increase your knowledge!&lt;/p&gt;

&lt;h2&gt;
  
  
  2- Use it yourself
&lt;/h2&gt;

&lt;p&gt;Maybe this isn't the case for everybody, and I get that. But for me, sometimes I find myself doing the same things or adding the same styles, that's why I'm using Puppertino also as a platform to create elements for my own projects and upcoming things. And if you can benefit from it, maybe someone else can too! Which takes me to my next point...&lt;/p&gt;

&lt;h2&gt;
  
  
  3- Give something to the community
&lt;/h2&gt;

&lt;p&gt;Let's keep this a secret, but whenever I create something for the community, like a tutorial, a codepen, or anything, I come back to it and copy the code from it. And if you use it, maybe someone else will use it too, and you will be helping people to get the results they want more easily and faster.&lt;/p&gt;

&lt;p&gt;"Okay that's cool, that's cool, but what about Puppertino?" That's an amazing question! Let's talk about it!&lt;/p&gt;

&lt;h1&gt;
  
  
  What About Puppertino?
&lt;/h1&gt;

&lt;p&gt;1- What is it?&lt;br&gt;
2- Ok, so an Apple-like framework?&lt;br&gt;
3- Is it ready to use?&lt;br&gt;
4- How can I contribute to it?&lt;/p&gt;

&lt;h2&gt;
  
  
  1- What is Puppertino
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/codedgar/Puppertino" rel="noopener noreferrer"&gt;Puppertino&lt;/a&gt; is a CSS framework. Its name comes from Puppy and Cupertino. Which I find to be a funny mix of words. It's supposed to take elements and inspiration from the Human Guidelines and other design fundamentals to create a robust framework of elements that you can use on your apps or websites.&lt;/p&gt;

&lt;h2&gt;
  
  
  2- Ok, so an Apple-like framework?
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;NOPE&lt;/em&gt;, it's not an Apple-like framework. Not all the elements of the macOS and iOS IUs will be created into Puppertino, it will not be an exact copy with the exact colors and exact elements. Some of the components will be excluded, and non-existing components will also be added if I find them useful!&lt;/p&gt;

&lt;h2&gt;
  
  
  3- Is it ready to use?
&lt;/h2&gt;

&lt;p&gt;I don't think so, there's a lot of things to add yet, but maybe if you wanted to use it in a landing page or something like that, it might work for you, for now, you'll have to wait a bit :)&lt;/p&gt;

&lt;h2&gt;
  
  
  4- How can I contribute?
&lt;/h2&gt;

&lt;p&gt;You can always check the code and suggest any modifications! If you are feeling generous you can even create your own Puppertino Components and I'll review them and add them!&lt;/p&gt;

&lt;p&gt;If you desire to contribute monetary way, there's currently no way of doing it (I also think that Puppertino currently does not deserve it), but if in the future I add some, I'll publish an article about it!&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion!
&lt;/h1&gt;

&lt;p&gt;While there are a lot of frameworks outside, don't let this put you down. By creating a CSS framework you will not only be learning more but also you will be contributing to the community! So go ahead and create amazing things C:&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Step up your native HTML form validation with these 3 simple CSS classes!</title>
      <dc:creator>codedgar</dc:creator>
      <pubDate>Tue, 12 May 2020 00:11:25 +0000</pubDate>
      <link>https://forem.com/codedgar/step-up-your-native-html-form-validation-with-these-3-simple-css-classes-4n3p</link>
      <guid>https://forem.com/codedgar/step-up-your-native-html-form-validation-with-these-3-simple-css-classes-4n3p</guid>
      <description>&lt;p&gt;Form validation most of the time is done with Native HTML (Using the type attribute) or with JavaScript. And if you want to add fancy effects when the user has done a mistake, you most probably would choose JavaScript, but lemme change that for you.&lt;/p&gt;

&lt;p&gt;Hi! My name is Codedgar and today, I'm going to present you 3 CSS selectors that will change the way you look at form and input validation with native HTML! Let's get to it!&lt;/p&gt;

&lt;p&gt;During the development of the Input Forms for &lt;a href="https://codedgar.github.io/Puppertino/" rel="noopener noreferrer"&gt;Puppertino&lt;/a&gt;, my own CSS framework, I came across a problem, I wanted to have native validation inputs, but creating a JS would be more work, not only for me but for people who would like to use the framework. So I investigated and found these lovely CSS Selectors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using "type" attribute.
&lt;/h2&gt;

&lt;p&gt;By now you might be familiar with the "type" attribute in input elements, this helps the browser to know if the user has inserted valid information on the input and/or limit the type of information the user can insert (i.e Number Inputs).&lt;/p&gt;

&lt;p&gt;The problem with these is that if you want to add a certain styles when the input is invalid or valid you would have to create a JS for that... Or do you?&lt;/p&gt;

&lt;p&gt;This is something I would have loved to know before, so without further do, let's meet these 3 CSS selectors!&lt;/p&gt;

&lt;h1&gt;
  
  
  Introducing the :invalid Selector
&lt;/h1&gt;

&lt;p&gt;The invalid selector, is a very powerful one, the styles in it will be applied to an invalid input, allowing you to add styles like another border-color or background to the element that has an invalid input based on attributes like "type", "max", "maxlength", "pattern" and so on. And it's used like so:&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%2Fi%2Fi1ix2la4sd4nqotkleqw.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%2Fi%2Fi1ix2la4sd4nqotkleqw.png" alt="Usage of the :invalid Selector .p-form-text:invalid{}"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;"Ok Edgar but that's just a tiny tiny bit of validation, what else do you got?" Glad you asked! Let's meet our other friend, the :valid selector!&lt;/p&gt;

&lt;h1&gt;
  
  
  The :valid Selector
&lt;/h1&gt;

&lt;p&gt;The valid selector works as you would expect, if the input meets the criteria of the attributes, it will apply the styles of it. Simple right? And you can use it like so:&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%2Fi%2Fu41p0p5ofn8lh3192bhq.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%2Fi%2Fu41p0p5ofn8lh3192bhq.png" alt="Usage of the valid selector .p-form-text:valid{}"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;"Nice Edgar" I hear you say "But now my input is either red or green, how do I fix that?" And that's because if the input is empty, it doesn't technically meet the criteria of the attribute, but fear not! Let's open the doors for our last selector, the :placeholder-shown!&lt;/p&gt;

&lt;h1&gt;
  
  
  The :placeholder-shown Selector
&lt;/h1&gt;

&lt;p&gt;Last but not least, the :placeholder-shown Selector it's going to help us to maintain a neutral style if the input is empty, but keep in mind, this selector works only when, as the name implies, the placeholder is shown, so if there's no placeholder, the input will get the styles of the :invalid selector. Remember that! And the placeholder selector is as easy as:&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%2Fi%2Fhu9r5c7n5qvnz9iu8qu5.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%2Fi%2Fhu9r5c7n5qvnz9iu8qu5.png" alt="Usage of the :placeholder-shown Selector .p-form-text:placeholder-shown{}"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OK now that we have 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%2Fi%2F1bmuqm3ytgd5f734e55w.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%2Fi%2F1bmuqm3ytgd5f734e55w.png" alt="Usage of :valid :invalid and :placeholder-shown selectors"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And it looks like 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%2Fi%2Fgdvdxfule3yefxa539b4.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%2Fi%2Fgdvdxfule3yefxa539b4.png" alt="Usage of :valid :invalid and :placeholder-shown selectors used in buttons"&gt;&lt;/a&gt;&lt;br&gt;
Want to play with this? Check it out in &lt;a href="https://codepen.io/Codedgar/pen/rNOKyEw" rel="noopener noreferrer"&gt;Codepen&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Beautiful. Now, let's talk about the pros and cons of using this and compatibility!&lt;/p&gt;

&lt;h1&gt;
  
  
  The compatibility
&lt;/h1&gt;

&lt;p&gt;Great enough, the compatibility is pretty strong and all the modern browser support it without any type of problems! Check this amazing capture of CanIUse:  &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%2Fi%2Fkrm0y7gfem3set4aq2m7.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%2Fi%2Fkrm0y7gfem3set4aq2m7.png" alt="Compatibility of the Selectors"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Pros
&lt;/h1&gt;

&lt;p&gt;Using these selector implies no use of JS, so you can forget of adding and deleting classes after parsing the text of the input (Which I used to do).&lt;/p&gt;

&lt;p&gt;Once, I created an app which validated the inputs on keypress (It was 4 years ago don't judge me haha), but this meant that you would have to press a key and delete it to validate the inputs, and this was particularly annoying when you where going to login, because if you had the information saved, it would throw an error, so everybody used to tell me how awful that was. But with this, you are free of that judgement.&lt;/p&gt;

&lt;h1&gt;
  
  
  Cons
&lt;/h1&gt;

&lt;p&gt;This applies for simple input types such as "number", "tel", "email" and so on, and if you are trying to create something more complex you might have to resort to adding and deleting class back and forth. But for simple things, simple answers :) .&lt;/p&gt;

&lt;h2&gt;
  
  
  Further reading
&lt;/h2&gt;

&lt;p&gt;If you want to expand further this functionality you can always check this &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation#Using_built-in_form_validation" rel="noopener noreferrer"&gt;MDN article&lt;/a&gt; and create great and custom forms using the pattern, max-length, min-length and others.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;If it wasn't for &lt;a href="https://codedgar.github.io/Puppertino/" rel="noopener noreferrer"&gt;Puppertino&lt;/a&gt; I maybe wouldn't be searching on how to validate information of inputs with just CSS, but now that I know that, I'm pretty confident that I'm going to start using this in all my next projects. What are you thoughts on this amazing CSS selectors? Let me know down in the comments!&lt;/p&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>showdev</category>
      <category>html</category>
    </item>
    <item>
      <title>What is like to be a developer in a third world country.</title>
      <dc:creator>codedgar</dc:creator>
      <pubDate>Fri, 06 Mar 2020 17:48:03 +0000</pubDate>
      <link>https://forem.com/codedgar/what-is-like-to-be-a-developer-in-a-third-world-country-34ge</link>
      <guid>https://forem.com/codedgar/what-is-like-to-be-a-developer-in-a-third-world-country-34ge</guid>
      <description>&lt;p&gt;Being a developer is considered a great career in most places around the world. But how true is this in a third world country?&lt;/p&gt;

&lt;p&gt;Hi, my name is Codedgar and today I wanted to talk about how is like to be a developer in a third world country, and show how is life for a developer in the country I live in.&lt;/p&gt;

&lt;p&gt;(Funnily enough I'm writing this article during a blackout, which are have become very common)&lt;/p&gt;

&lt;h3&gt;
  
  
  Before we start
&lt;/h3&gt;

&lt;p&gt;Please don't make this a political thing, it doesn't matter what your position on the political compass is, the crisis cannot be hidden.&lt;/p&gt;

&lt;h1&gt;
  
  
  Where am I from?
&lt;/h1&gt;

&lt;p&gt;I'm from Venezuela, you may have heard from it in the news, it has been mentioned several times on TV and news, talking about how destroyed the country is. Lack of electricity, gasoline or any type of basic service to live normally.&lt;/p&gt;

&lt;p&gt;So how Venezuela's crisis has impacted on the world of developers?&lt;br&gt;
I want to break this article in several parts to illustrate you better:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Work.&lt;/li&gt;
&lt;li&gt;Salaries.&lt;/li&gt;
&lt;li&gt;Hardware.&lt;/li&gt;
&lt;li&gt;Basic services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you think I missed something ask it in the comments! I will answer you and if the question is great I will add it to the post.&lt;/p&gt;

&lt;h2&gt;
  
  
  Work
&lt;/h2&gt;

&lt;p&gt;I wanted to start with the hardest thing, work. Because the truth is most developer works you can find here suck. It doesn't matter if you are working for someone here or someone outside of the country, being Venezuelan you are lucky to land a great job.&lt;/p&gt;

&lt;p&gt;People in the country will search for an all doing person, designer, fullstack developer, but try to pay you almost nothing.&lt;/p&gt;

&lt;p&gt;So you can either get someone who wants to exploit you (for a so-so amount of money), a stupidly low salary or both if you have bad luck. Which takes me to my next point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Salaries
&lt;/h2&gt;

&lt;p&gt;When I was looking for a job outside, I contacted several companies in the USA, and some of them offered me 1$/hour claiming that "It was a lot in Venezuela" which, obviously, is not...&lt;/p&gt;

&lt;p&gt;Works inside the country vary, but I've seen people looking for developers as low at 35$ per &lt;em&gt;month&lt;/em&gt;. Obviously you can't use this to afford anything so you will have rely on "matar tigritos" (Do small freelance jobs) to live some form of a 'normal' life.&lt;/p&gt;

&lt;p&gt;"Ok Codedgar, but how much do you get a month?" I can't tell you because I could become a target of kidnap, but I can assure you is a very very low amount.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware.
&lt;/h2&gt;

&lt;p&gt;If you are a developer, you will need something powerful to keep your computer from interrupting you or adding extra time to development. But you can't find this in Venezuela, most computers will be high on price just because of the brand, and people will sell you broken parts for what the actual normal hardware would cost (i.e 90$ for a busted monitor). I've seen prices of a dual core with 1GB Vram and 8GBs of RAM as high 600$. And this in other countries would be considered just an office computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic services
&lt;/h2&gt;

&lt;p&gt;The basic services are the main things a developer needs, such as:&lt;/p&gt;

&lt;h3&gt;
  
  
  Internet
&lt;/h3&gt;

&lt;p&gt;Internet on Venezuela sucks, and not only that but it's extremely pricey. I've tried to add a private internet to my house, but you need an antenna (100$) and the maximum speed I've seen where I live, is 8MBps (Shared between other 8 clients) for 80$ a month. You can also pay mainstream providers, but most of the time you will have to pay under the table to get an almost decent speed.&lt;/p&gt;

&lt;p&gt;This doesn't means that it will be a constant though, you can go from 5MB to 50KB in a matter of seconds, making it almost impossible to talk to clients via Skype or Whatsapp.&lt;/p&gt;

&lt;h3&gt;
  
  
  Electricity
&lt;/h3&gt;

&lt;p&gt;1 year ago Venezuela suffered the biggest blackout on it's history, 5 days of pure blackness, and then 2 days more. Since then, the electrical system hasn't worked properly and everyday (In almost every state) there are blackouts up to 12 hours. This is to avoid the capital from having blackouts, but there have been multiple blackouts recently that feature all of the entire country.&lt;/p&gt;

&lt;p&gt;You can also rent an office with a power plant or in places where there are no blackouts, but is really expensive just because of that.&lt;/p&gt;

&lt;p&gt;Electricity also suffers from low and high current spikes, so if you have bad luck, you computer can fry or your disk can corrupt (Last one happened to me once).&lt;/p&gt;

&lt;h3&gt;
  
  
  Security
&lt;/h3&gt;

&lt;p&gt;Is non-existent, you are out by yourself and no one can do anything for you. I personally have seen cases of the military and police being the ones who steal people.&lt;/p&gt;

&lt;p&gt;This means you shouldn't carry your phone around and have to be very careful where you are and be alert of people around you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transport
&lt;/h3&gt;

&lt;p&gt;Transport is really hard to find where I live. And taxis are really expensive. Most buses will work from 7am to 6pm. Meaning that you can't do night shifts without calling a cab to your house.&lt;/p&gt;

&lt;h3&gt;
  
  
  Education
&lt;/h3&gt;

&lt;p&gt;One of the hardest things to find in Venezuela is good local education. There are no bootcamps, and no good courses. People is not so familiarized with technology, so they just get misinformed. Once I heard that "Blogspot was the BEST platform to start a blog", so yeah...&lt;/p&gt;

&lt;p&gt;And our credit cards will not work to purchase any online course, making it harder to get online courses to expand our knowledge.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;I believe that Venezuelans developers, do it because they just love to code. But really this is not only applicable to developer, this is the same for any type of creative and freelance job.&lt;/p&gt;

&lt;p&gt;It's important that we talk about this because I always see in the media people talking about how Venezuela is destroyed, but I haven't seen a person come out and talk openly about how this crisis affects real people and real jobs.&lt;/p&gt;

&lt;p&gt;I think that this illustrates more in a person factor, instead of a number factor how hard it is to have a normal job and be a developer here.&lt;/p&gt;

&lt;p&gt;I've been thinking on creating some type of community to help people in Venezuela to land better jobs, find better courses and overrall try to fix some of the problems that we always have to go through... But that remains being an idea for now and I will make an update if it becomes a reality.&lt;/p&gt;

&lt;p&gt;Anyways, if you liked it, or have any questions feel free to ask them, I will respond to all of them :)&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>career</category>
    </item>
    <item>
      <title>The 5 golden rules for becoming a better leader.</title>
      <dc:creator>codedgar</dc:creator>
      <pubDate>Mon, 10 Feb 2020 17:34:47 +0000</pubDate>
      <link>https://forem.com/codedgar/the-5-golden-rules-for-becoming-a-better-leader-2ejb</link>
      <guid>https://forem.com/codedgar/the-5-golden-rules-for-becoming-a-better-leader-2ejb</guid>
      <description>&lt;p&gt;Leadership is hard. We always want to become better leaders and try to get the best of our team members, wether is on a programming team or any other thing. But only by having strong bases you can become a better leader that can impulse and guide a team of people to get the best out of them.&lt;/p&gt;

&lt;p&gt;Hi, I'm Codedgar and today I wanted to talk about Leadership, and the 5 five rules of leadership you can start using today to become a better leader.&lt;/p&gt;

&lt;p&gt;All of these tips that I'm going to give, come from my experience being in several programming teams and my experience leading my team for almost 4 months now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before we start.
&lt;/h2&gt;

&lt;p&gt;Keep the following in mind: I'm not saying that these are the &lt;em&gt;only&lt;/em&gt; rules that exist, but having these rules in mind can make a whole difference in the way that you manage people and they perceive you.&lt;/p&gt;

&lt;p&gt;Also, consider following me on twitter at &lt;a href="https://twitter.com/codedgar_dev" rel="noopener noreferrer"&gt;@codedgar_dev&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  5 - Be careful with your words.
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Think twice, talk once&lt;/strong&gt; is one of the most common things I say to this. I see a lot of managers and team leaders going "You're stupid", "You should know this by now", "How can you do this". And it always strikes me that they should be more careful with what they say, and how to say it. Remember to always treat people with respect, no matter who they are or what have they done.&lt;/p&gt;

&lt;p&gt;And this is also true if you are delegating tasks. If you don't make a good work at explaining what it needs to be achieved, you will have people failing or misunderstanding what you said. So no matter how many times you have to explain it, or how, you will save more time if everybody knows exactly what to do.&lt;/p&gt;

&lt;h1&gt;
  
  
  4 - Be transparent.
&lt;/h1&gt;

&lt;p&gt;One of the main problems I had with someone I worked for, is the fact that they didn't tell me what was going on. I didn't know if the client liked the interface, if it needed anything else, I just got tasks and that was all. And I feel like I could do a better job if they told me what could I improve, get better at or what mistakes I've made.&lt;/p&gt;

&lt;p&gt;If you are transparent with your team, they will feel like really a part of it. Not only that, but they will help you with ideas and get a sense of responsibility, they will know what to do more, what to do less, and what to improve.&lt;/p&gt;

&lt;h1&gt;
  
  
  3 - Be open to proposals and listen.
&lt;/h1&gt;

&lt;p&gt;The difference of opinions and how to approach problems are inevitable in every team. how you tackle them is the real difference. If you put your vision over everybody else and don't listen to anyone, you will surely get something wrong, forcing everyone to rethink a strategy.&lt;/p&gt;

&lt;p&gt;Even so, if you are having problems making a decision, draw a table, and put in perspective what you think are the pros and cons of any decision, and listen to cons and pros that your team suggests and suggestions of what to do.&lt;/p&gt;

&lt;p&gt;Imagine that someone on your team has the answer to your dilemma, but they will keep it to themselves because they fear a harsh "No". This is why you should keep an open mind.&lt;/p&gt;

&lt;h1&gt;
  
  
  2 - Make your team work with you, instead of working for you.
&lt;/h1&gt;

&lt;p&gt;Every time I talk about this people ask me "What's the difference? Isn't it the same?" and the answer is no. A person who works with you, is interested in how the project is going, how to make it better, gives ideas and proposes new things. While someone who works for you, is only interested in the paycheck.&lt;/p&gt;

&lt;p&gt;Having the team motivated and interested in the project is one of the key factors of being a good leader.&lt;/p&gt;

&lt;h1&gt;
  
  
  1 - Be careful with your team member's health.
&lt;/h1&gt;

&lt;p&gt;Health is ultra important for every member of your team. And I constantly see leaders of teams just pushing and pushing on how to make team members more "productive" to the point of sleeping in the office almost all the time. And this is not healthy, not only for every member but for the ambient of the office. People will become most hostile and it can be less probable for them to work correctly together.&lt;/p&gt;

&lt;p&gt;Instead of that, try to understand them more. &lt;a href="https://twitter.com/intent/tweet?text=It%20is%20better%20to%20have%20a%20motivated%20team%20that%20works%20less,%20that%20sleepless%20zombies%20that%20work%20all%20day%20via%20@codedgar_dev" rel="noopener noreferrer"&gt;It is better to have a motivated team that works less, that sleepless zombies that work all day&lt;/a&gt;  (Hey that rhymed! Click open in a new tab to tweet it :) ). So next time someone tells you that they got a headache, just let them leave.&lt;/p&gt;

&lt;h1&gt;
  
  
  BONUS: Be friends with your team!
&lt;/h1&gt;

&lt;p&gt;"But I have 50 team members!" Cool! Now you will have 50 new friends!! Ha, just kidding. What I mean by this, is care about other people. If you see them somewhat sad, ask them what's going on, ask them how was their day, and how do they think that everything is going in the team. From my experience, talking and caring for your team can make a big difference in how they see you and how they see the projects you are doing.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;If you scan this article you will realize that almost every aspect of it comes down to have great communication and working correctly with your team. And that's really what it essentially is, if you have great communication with your team and understand them, that's it!&lt;/p&gt;

&lt;p&gt;I know that there's more, and it will be great if you could share it in the comments. But for me, these are the main things you should have in mind.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>watercooler</category>
    </item>
    <item>
      <title>Stop programming to become a better developer.</title>
      <dc:creator>codedgar</dc:creator>
      <pubDate>Tue, 14 Jan 2020 20:15:15 +0000</pubDate>
      <link>https://forem.com/codedgar/stop-programming-to-become-a-better-developer-43im</link>
      <guid>https://forem.com/codedgar/stop-programming-to-become-a-better-developer-43im</guid>
      <description>&lt;p&gt;Have you ever stayed up at night trying to fix a problem, just to realize the other day that it was just a simple mistake? Or do you feel that everything in your work gets more complex and complex everytime? Maybe it's time for you to stop programming.&lt;/p&gt;

&lt;p&gt;"What?! Like... Forever??" No! Not at all. What I'm trying to say, it's that is time for you to rest. Resting, will not only make you a better developer, but it will help you have your mind clear when you come back to code.&lt;/p&gt;

&lt;p&gt;Hi! I'm Codedgar and today I want to talk about resting, and how to stop programming for a while, which can make you a better developer.&lt;/p&gt;

&lt;p&gt;Do you know how many people say "To become the best, you should always practice, and never stop until you are the best"? For me, that's a big, big lie.&lt;/p&gt;

&lt;p&gt;Just think of the following: If you are doing exercise, and everyday you push your body to the limit, eventually, you will exhaust yourself, and maybe have to rest for a long time, making all the effort almost worthless. I did bboying for almost 2 years and I can tell you for sure that you need to find a balance between doing and resting, and it's the same for programming or any other thing you want to do.&lt;/p&gt;

&lt;p&gt;I'm going to break down this article in several parts, so it becomes easier to read. First, I'm going to talk about what problems can bring you bad resting, then, I'm going to talk about how to fix bad resting behaviors and health tips that will help you get better at programming by resting correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Disclaimer
&lt;/h2&gt;

&lt;p&gt;"Where does this information comes from? Are you a doctor?" No. This information comes from 2 courses (Prevention of accidents and Working security in industrial environments) that I made in 2016 and 2017, part of my technician degree in electronics, and my personal experience dealing with burnout.&lt;/p&gt;

&lt;h1&gt;
  
  
  What problems can bring you programming without proper rest
&lt;/h1&gt;

&lt;p&gt;You may have seen a lot of memes out there being like "Haha we programmers don't sleep", and I think this is one of the main problems with us, sleeping is one of the key factors to keep your mind clear and work correctly, but if you don't sleep and keep yourself stressed, you can have &lt;em&gt;permanent&lt;/em&gt; problems, such as:&lt;/p&gt;

&lt;h2&gt;
  
  
  Burnout
&lt;/h2&gt;

&lt;p&gt;Burnout is one of the most harmful problems you can find and I think it often goes unnoticed. In a nutshell (Jumping some details), burnout can bring you &lt;em&gt;permanent&lt;/em&gt; problems if it's not treated in time, burnout in people can manifest itself in several ways, including extreme stress and tiredness. If you suffer from Burnout for a long period of time, it can lead to heart diseases and circulatory problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  General irritation
&lt;/h2&gt;

&lt;p&gt;This one really can mess up your social connections. I used to work on a place that led me to a lot of stress and general irritation, I got home to be angry with everyone and no one could talk to me without me expressing just angriness. People around you may not have the fault of how work is going, but if you are stressed all the time people will notice, and maybe will leave you alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Loss of passion
&lt;/h2&gt;

&lt;p&gt;Passion is really important for programming, but if you are constantly stressed, you may start to think "Is this really for me?". And I've heard people that had abandon completely programming just because of this. The end result of your work can also be affected by this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Loss of productivity
&lt;/h2&gt;

&lt;p&gt;If your stress is building up, not only you, your friends, family, and work can be affected, but your productivity too. The work you did in one day or a few weeks can transform in months. Leading to general demotivation.&lt;/p&gt;

&lt;p&gt;Now, we know that we as people, our friends, our family, our work and productivity can be affected. What can we do about this? It starts with noticing and stopping behaviors that affect our rest, which leads me to my next point.&lt;/p&gt;

&lt;h1&gt;
  
  
  Bad habits that get in the way of resting.
&lt;/h1&gt;

&lt;p&gt;We often unknowingly get in the way of our rest, and even if you don't know it, you may do some of the things from the next points, and I'll help you fix them.&lt;/p&gt;

&lt;h2&gt;
  
  
  I had a dream of the fix! I'm gonna go and code it!
&lt;/h2&gt;

&lt;p&gt;Don't do this. In your dream maybe it worked perfectly, but you may have to spend a few hours implementing this and therefore interrupting your sleeping, or whatever you were doing.&lt;/p&gt;

&lt;h3&gt;
  
  
  What can we do?
&lt;/h3&gt;

&lt;p&gt;My dad actually suffer from this. And my mother used to hide the computer cable so he couldn't turn it on after they went to sleep, he complained and my mom told him "Just write it down, and do it tomorrow". She told me this after seeing me waking up in the middle of the night to code something I dreamt about that would fix my bug. And if I'm out in the street, dream with it or anything, I just write it down, and later take a better look at it.&lt;/p&gt;

&lt;h2&gt;
  
  
  I'm not going off work or to sleep without finishing this
&lt;/h2&gt;

&lt;p&gt;While sometimes this may work for you, it will eventually lead you to rest incorrectly. Just think of this, the later it becomes, the less energy your brain has to actually think on how to finish what you are doing.&lt;/p&gt;

&lt;h3&gt;
  
  
  What can we do?
&lt;/h3&gt;

&lt;p&gt;Recopilate as much information as you can about what you are doing, write about it, think about it, but don't stay woke all night. If you wake up in the morning with your mind clear, it will take you less time and you won't sacrifice your rest :)&lt;/p&gt;

&lt;p&gt;These are just 2 examples to give you an idea, I'm pretty sure you can come up with other ways in which we sometimes neglect our rest. But just as there are bad habits, you can start building up good habits to keep your mind from overworking itself and rest correctly.&lt;/p&gt;

&lt;h1&gt;
  
  
  Good habits to rest correctly
&lt;/h1&gt;

&lt;p&gt;We touched 2 examples of bad resting, but I also want to talk about great habits to help you rest and don't overload your brain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can't figure the answer? Stand and walk for a second
&lt;/h2&gt;

&lt;p&gt;In all my time working as a developer, I cannot find something more relaxing after hours of coding without success than walking and taking a cup of cold water. Walking and standing for a while is great for your legs and circulation. But is also great to take a second to think about what were you doing and what other approaches you can try.&lt;/p&gt;

&lt;h2&gt;
  
  
  Take one day of the week to rest completely.
&lt;/h2&gt;

&lt;p&gt;This may be hard to achieve if you are working on several projects at the same time. But if you take one day for your brain to cool down completely you will start with the right feet the next day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do exercise!
&lt;/h2&gt;

&lt;p&gt;If you are all day sitting at your desk, most of your physical energy will be untouched, so at the end of the day, you might have problems sleeping. So what I recommend, is balancing the mental effort with physical effort. Do a sport, go to the gym, or bboying too!&lt;/p&gt;

&lt;h2&gt;
  
  
  Take your time
&lt;/h2&gt;

&lt;p&gt;Yeah, I know, deadlines are scary and all. But don't overwork yourself. Try to find a pacing that feels easy on you, this way you won't overload of work even if you have a ton of things to do.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Coding is great, but it requires a lot of mental effort. And if you add an extra layer of stress on top of it, it can become a nightmare easily. And these tips are meant to help you start your day full of energy and with zero stress, which will increase your productivity, passion and overall mood. Making you a better developer in the process :)&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>watercooler</category>
      <category>career</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Please, use modals wisely.</title>
      <dc:creator>codedgar</dc:creator>
      <pubDate>Thu, 26 Dec 2019 01:33:40 +0000</pubDate>
      <link>https://forem.com/codedgar/please-use-modals-wisely-1b4e</link>
      <guid>https://forem.com/codedgar/please-use-modals-wisely-1b4e</guid>
      <description>&lt;p&gt;The main thing I think whenever I see a modal taking all of my screen is: "What. What is so important that requires every possible space available on my screen". Is it a modal to sign me up into the website's "World Best Handbook of X"? Maybe it's a modal to tell me "How dare you using AdBlock, deactivate it, now!" or "Do you accept our cookies policy". And when I see these, I just think "Why.".&lt;/p&gt;

&lt;p&gt;Hi! I'm Codedgar, and today I want to talk of the cons of having a UI with a ton of modals and what can we do to stop this and give the user a more pleasant and fluid experience on our website.&lt;/p&gt;

&lt;p&gt;First, let's get 2 things straight:&lt;/p&gt;

&lt;h3&gt;
  
  
  1- Are modals bad?
&lt;/h3&gt;

&lt;p&gt;Nope. Modals are surely needed if the users are about to press a button that they might not be sure to press, so in cases of "You are about to delete your entire account!" or "You will delete this file and you can never access it again" are totally needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  2- Do I hate modals?
&lt;/h3&gt;

&lt;p&gt;I only hate the modals that interrupt the flow of the user without actually needing to, and I think that modals are being abused by marketers, and I can't stand some of the usages to they given them. Modals are very important, but the misuse of them lead to a lot of people hating modals no matter what they show.&lt;/p&gt;

&lt;p&gt;Now that we took that out of the way, let's talk about ways that modals are used incorrectly, and what can we do to replace them with something better. I've separated this article on two parts: How to know when to show information in modals and examples of modals used incorrectly and how to replace it with something more natural.&lt;/p&gt;

&lt;h1&gt;
  
  
  When should I display information on a modal?
&lt;/h1&gt;

&lt;p&gt;To know if you should display information on a modal, I would advise you to ask yourself these questions:&lt;/p&gt;

&lt;h2&gt;
  
  
  Could the action of the user be mistaken or dangerous?
&lt;/h2&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcqlfztz9kcyiu9ix6p1y.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcqlfztz9kcyiu9ix6p1y.png" alt="Use modals to prevent the user from executing dangerous actions by mistake"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the user clicked "I want to delete my account" or "I want to delete this forever" a modal is totally needed. Because it will stop the user to think about the action that will take place and check twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is the information that I'm showing urgent or really important?
&lt;/h2&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fy8hm4vtcl7oyad4qyh4m.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fy8hm4vtcl7oyad4qyh4m.png" alt="Use modals to tell information to the user that they should be aware of right away"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I say important, it doesn't mean "Hey I'm giving this book out". I mean things like "We are moving to another domain soon", "This article is old,  here's a new version" or "This is a beta of the app". This is information that can have an impact on what the user is seeing and how interacts with the content directly. And is something that needs to be said before the user continues the journey through the website.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do I need all the attention of the user?
&lt;/h2&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fuqft9uffldlehzcezj64.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fuqft9uffldlehzcezj64.png" alt="Don't use modals to tell a user something that they could read from the actual page itself"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There's a big con to modals and it's that modals take all the attention of the users out of whatever they were doing, so if you are interrupting whatever the user is doing, make it worth it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Examples of bad usage of modals.
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Email collecting modals
&lt;/h2&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fc58nx99jz2jlu4798zwa.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fc58nx99jz2jlu4798zwa.png" alt="Modal asking for information for a free e-book"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hate these. Don't get me wrong, sometimes email collecting is necessary but I do believe that this is a really "In your face" approach. And allow me to elaborate with an example:&lt;/p&gt;

&lt;p&gt;I'm reading an article that says "It is safe for cats to eat soup?" but that doesn't mean that I want to download the book/guide for "impressive cat training", and the moment I stop scrolling it gets all of my screen telling me if I want it. My cat just jumped on the table and took some soup, I just wanted to know if it was safe (No cats were harmed during this example). &lt;/p&gt;

&lt;p&gt;This approach of showing everybody that you are giving away a book/guide is really bad because you are just telling them that you are giving a free book/guide on the main topic of the website, but it might not have anything to do with the topic of the article.&lt;/p&gt;

&lt;h3&gt;
  
  
  What can we do instead?
&lt;/h3&gt;

&lt;p&gt;We can tell the user in a section of the article that the information we are telling also appears on our book/product or whatever, like so:&lt;/p&gt;

&lt;p&gt;"If your cat constantly eats your food, we have a section that talks about what your cat can eat in our free book 'Impressive cat training'". Now I know that if I put my email, I will have more information on the specific topic that I'm currently visiting, so if I'm looking to know more about this specific topic, this is nice. And this works great for segmentation of audiences.&lt;/p&gt;

&lt;p&gt;Also, this is a great moment to tell you that if you are liking this article you should totally follow me on Twitter ( &lt;a href="https://twitter.com/codedgar_dev" rel="noopener noreferrer"&gt;@Codedgar_dev&lt;/a&gt; ) because I will drop more articles on the topic "Please use wisely" and I will post them in Twitter when I publish them. (See? Way more subtle than a big modal, haha).&lt;/p&gt;

&lt;h2&gt;
  
  
  Login or Register modals
&lt;/h2&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fzy9of6wi32a76pz5mz0g.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fzy9of6wi32a76pz5mz0g.png" alt="Login modal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I once had the opportunity to work helping to create a frontend where the login, register, add a product, add a series of products, and everything was on modals. And this was horrible from a developer and user perspective since it required several steps to do anything, which meant several modals changing between them. If the user reloaded the website, the modal would close and he would have to open it again, so a user would be one click away from being where they were. Plus, if the user where to click outside of the modal, it would close, so he would have to open the first modal, and click next and next to reach the section of editing.&lt;/p&gt;

&lt;h3&gt;
  
  
  What can we do instead?
&lt;/h3&gt;

&lt;p&gt;Create a dedicated subpage for these things. Where the focus is only and completely the action that the user is currently doing, and if the user reloads the page, it will appear exactly where it was. You don't need your user to stay on the same page at all times.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Why are you using AdBlock?" modals
&lt;/h2&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fnify05zwobfbyajbej7a.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fnify05zwobfbyajbej7a.png" alt="Modal asking "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One thing I really believe is freedom of choice. I have entered websites that completely block you if you use AdBlock, and I evade them entirely. While opening new websites I tend to have Adblock enabled so I won't enter an ad-filled article or website. And if the number of blocked ads is really low, I deactivate AdBlock on that site. But if a user comes to your site and it's not allowed to see your website because it has an adblocker, your bounce rate may go up.&lt;/p&gt;

&lt;h3&gt;
  
  
  What can we do instead?
&lt;/h3&gt;

&lt;p&gt;I know that for some people the ad revenue is their primary source of income, but blocking users entirely from using your website just for that it's not cool. In some websites, I've seen banners that say "We run thanks to ads" and I find this nice, they tell you "It's okay that you use Adblock, but if you like our articles consider deactivating it" and in a lot of times I've found myself disabling Adblock in that website because I enjoyed the article and don't mind seeing others with ads.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Changed of focus" modal
&lt;/h2&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fh1i5acftjdp5eod0j0io.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fh1i5acftjdp5eod0j0io.png" alt="A bad of use of modals is making them appear when the user unfocus the website"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the one that I hate most of all. You go and change the song you are listening on Spotify, and come back to the website and a big modal telling you "BEFORE YOU LEAVE..." is there. This is very invasive and it cuts completely the flow of the website and journey of the user.&lt;/p&gt;

&lt;h3&gt;
  
  
  What can we do instead?
&lt;/h3&gt;

&lt;p&gt;If you are going to use this modal, please allow the users to click outside of it to close it, instead of having to search for a small "x".&lt;/p&gt;

&lt;h1&gt;
  
  
  But what if I have to use modals?
&lt;/h1&gt;

&lt;p&gt;If you need to use modals, try to follow these tips to make it less hard on your users:&lt;/p&gt;

&lt;h3&gt;
  
  
  1- Make the info as specific and short as you can:
&lt;/h3&gt;

&lt;p&gt;Don't try to over-explain everything in a modal. This applies even more if the content of the modal does not fill all the space. Keep it short and clean.&lt;/p&gt;

&lt;h3&gt;
  
  
  2- Don't make a modal open another modal:
&lt;/h3&gt;

&lt;p&gt;Think of this: If the user clicks outside of the modal and it has been 4 modals at this point, the user will have to reopen the first, then the second, the third one and so on.&lt;/p&gt;

&lt;h3&gt;
  
  
  3- Make modals close when you click outside of them:
&lt;/h3&gt;

&lt;p&gt;This an easy way of helping the users cancel an action fast if they didn't meant to click the button. And also in modals like "Download my book" or "Before you leave" it makes people that are not interested continue with their journey.&lt;/p&gt;

&lt;h3&gt;
  
  
  4- Make the close button accessible:
&lt;/h3&gt;

&lt;p&gt;One of the main issues I have with modals is that some of them have really really small close buttons, so I have to precisely put my mouse over it and close it, instead of going fast to the close button and clicking it simply.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F095tnfc5vz2z0a4f6w46.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F095tnfc5vz2z0a4f6w46.png" alt="Remember! Use Modals Wisely"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please remember and have in mind that modals are a powerful tool, that should not be used in everything. If we are going to interrupt a user, try to make it for something important and make it easy for the users to click outside of it if they are not interested in the information of the modal.&lt;/p&gt;

</description>
      <category>html</category>
      <category>ui</category>
      <category>ux</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Why I don't use Bootstrap anymore.</title>
      <dc:creator>codedgar</dc:creator>
      <pubDate>Fri, 20 Dec 2019 03:23:46 +0000</pubDate>
      <link>https://forem.com/codedgar/why-i-don-t-use-bootstrap-anymore-b8</link>
      <guid>https://forem.com/codedgar/why-i-don-t-use-bootstrap-anymore-b8</guid>
      <description>&lt;p&gt;For many web developers, Bootstrap is the way to go when you have to create a Website or App. But in the five years I have making websites, I have found things that made me change my decision of using Bootstrap at all, and I've changed the way I create websites almost completely.&lt;/p&gt;

&lt;p&gt;Hi! My name is Codedgar and today I wanted to talk of why I don't use Bootstrap anymore. Since it's a question that students, coworkers, and people, in general, have been asking me a lot recently: Why I don't use Bootstrap?&lt;/p&gt;

&lt;p&gt;Let's start with my history (I'm gonna be short, promise C: ) When I started working on frontend web development, the first thing I crossed upon was Bootstrap. And with that, I thought I had frontend developing mastered, it was easy, fast to use and it has a lot of components! Nice!&lt;/p&gt;

&lt;p&gt;But as my work progressed and the websites became more and more custom, I started to find Bootstrap a little bit unuseful, and that's when I came to a conclusion as to why I would not be using Bootstrap in my new works.&lt;/p&gt;

&lt;p&gt;For easier understanding, I have divided this post in the reasons of why I don't use it, enjoy:&lt;/p&gt;

&lt;p&gt;1- Weight&lt;br&gt;
2- Components and Utilities&lt;br&gt;
3- Styling&lt;/p&gt;

&lt;h2&gt;
  
  
  1- Weight:
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;"Weight? But Bootstrap is less than 500KB"&lt;/em&gt;. Yes, I'm aware of that. But let's take on consideration how much of Bootstrap we actually use. And using Bootstrap means that you have to use also jQuery, so if you were to create a landing page with Bootstrap, you would have to use jQuery, Bootstrap CSS, and Bootstrap JS. All of these resources will not be used even in half if you use Bootstrap. And that brings me to my next problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  2- Components:
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;"Lack of?"&lt;/em&gt; Nope, not at all, is actually the opposite. Bootstrap has so many components and utilities, that you are almost certain to never use even half of them. And you may argue that with NodeJS you can compile and use only the CSS that the website uses, but with plain HTML for a server with Cpanel, this is not possible (At least that I know). So there's this vast quantity of components that you will maybe not use and they will be there anyway.&lt;/p&gt;

&lt;p&gt;This is not a problem just of Bootstrap, but of many frameworks I've seen, like Materialize or UiKit, where there are components that most people wouldn't use and there are classes that can be broken down into only one style, like:&lt;/p&gt;

&lt;p&gt;.modal-top-left{top:5%;left:5%}&lt;/p&gt;

&lt;p&gt;And so on for modal-top-right, modal-bottom-left, modal-bottom-right. If you wanted to change the position of the modal you could totally do it with only one class, adding these classes is just dumb.&lt;/p&gt;

&lt;h2&gt;
  
  
  3- Styling:
&lt;/h2&gt;

&lt;p&gt;While Bootstrap is easy to use, it's not so easy to customize as you might think. Some components will require you to use !important several times, which is not ideal when creating CSS. And having to override the default styles of Bootstrap is just like having to create your own CSS from start.&lt;/p&gt;

&lt;h2&gt;
  
  
  What do I use then?
&lt;/h2&gt;

&lt;p&gt;Most people at this point just say &lt;em&gt;" So what? You make CSS from start and don't use any framework?"&lt;/em&gt; And well, I don't create my CSS from scratch, and I do use a framework, but only for managing the columns of the website. The framework I use is called Flexbox Grid and it justs comes with columns and rows, nothing more. And it only weights 1.9KB! So, on a website with 1 homepage and 4 subpages, the total CSS (including Flexbox Grid) is only 5KB. For me, that's amazingly fast!&lt;/p&gt;

&lt;h2&gt;
  
  
  And should I use Bootstrap?
&lt;/h2&gt;

&lt;p&gt;Well, there's something I can't deny and it's that if you need to develop something incredibly fast you can use Bootstrap. And if you are thinking if you should, or should not use Bootstrap, ask yourself:&lt;/p&gt;

&lt;p&gt;1- Will I use several components of Bootstrap?&lt;br&gt;
2- Am I in a rush to develop this frontend?&lt;br&gt;
3- Is the design important for this?&lt;/p&gt;

&lt;p&gt;If your answers are: Yes, yes, and no; Go ahead and use Bootstrap without shame.&lt;/p&gt;

&lt;h3&gt;
  
  
  Extra: Do I hate Bootstrap?
&lt;/h3&gt;

&lt;p&gt;Of course not. I think that is amazing to develop websites quicker and easier, but I just would not be using it anymore because I prefer to make my own components and craft almost everything by hand. I know that Bootstrap will live along a still be used by a lot of people, and that's totally fine :)&lt;/p&gt;

&lt;p&gt;What do you think? Do you use Bootstrap?&lt;/p&gt;

</description>
      <category>css</category>
      <category>bootstrap</category>
      <category>html</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Download button animation</title>
      <dc:creator>codedgar</dc:creator>
      <pubDate>Sat, 08 Jun 2019 13:19:42 +0000</pubDate>
      <link>https://forem.com/codedgar/download-button-animation-l33</link>
      <guid>https://forem.com/codedgar/download-button-animation-l33</guid>
      <description>&lt;p&gt;Everytime I see an animation or a microinteraction, I'm used to ask myself how much time would it take me to do something similar. So when I crossed myself with this GIF from the amazing &lt;a href="https://uxdesign.cc/@pablostanley" rel="noopener noreferrer"&gt;Pablo Stanley&lt;/a&gt;, couldn't help myself to think a lot on how I could archieve this effect.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FiTkCa6w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/1600/1%2AmHdzshog-HHTz61Msj2DkQ.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FiTkCa6w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/1600/1%2AmHdzshog-HHTz61Msj2DkQ.gif" alt="Pablo's Stanley button animation concept" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And I'm going to walk you through the creation process!&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Thinking to move concept to code.
&lt;/h2&gt;

&lt;p&gt;Alright, this was maybe the hardest part of everything, because I had to think in ways to, for example, moving the text cannot be acomplished with the normal text of a button, and how could I make the button smaller in height without affecting all the other components in a website? I didn't know.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The HTML.
&lt;/h2&gt;

&lt;p&gt;After all the answers where clear. I moved on to create the HTML for the button, I had in mind something simple, I didn't wanted empty divs o spans anywhere. So I came up with this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;            &amp;lt;div class="cool_holder"&amp;gt;
             &amp;lt;button class="coolass_button" id="coolbutton"&amp;gt;&amp;lt;/button&amp;gt;
            &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Not so interesting, right? That's because I wanted it to be real simple. And while the button doesn't have text, it as an explanation in...&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The CSS.
&lt;/h2&gt;

&lt;p&gt;Here's where things get a little bit messy, since this is an animation, I needed to have multiple classes to hold these states and work together, I would like to give and extend explanation of it, but the post would be huge!&lt;br&gt;
In short, I added the "Download" and "Success!" text using :before and :after .&lt;br&gt;
And for the height of the button, our friend cool_holder has a 100px height, so the button can be smaller but it won't affect the overrall composition of a website.  &lt;/p&gt;

&lt;p&gt;Note: I didn't add the CSS because it was too big for this small post haha.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. The javascript.
&lt;/h2&gt;

&lt;p&gt;This is the wrap up of everything, and in esence, it's just a bunch of SetTimeouts that keep adding after a certain time the other classes, maybe it's not the best, but I didn't thought of anything else at the time.&lt;/p&gt;
&lt;h1&gt;
  
  
  The result!
&lt;/h1&gt;

&lt;p&gt;After everything was done, I couldn't be happier with the result, and uses are limitless! Download pages, make it a "Post" or "Publish button"! And... Well, maybe not limitless, but I was happy to archieve a cool animation, and here it is:&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/Codedgar/embed/JVRbJK?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;And well, this is my first post! So I may have slipped here and there, but I wanted to show my small acomplishment to this great community, thanks for reading!&lt;/p&gt;

&lt;p&gt;If you wanna follow me on &lt;a href="https://www.instagram.com/codedgar/" rel="noopener noreferrer"&gt;Instagram&lt;/a&gt; you are completely welcomed! I post my advance on microinteractions there, along with some web posts C:&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>css</category>
      <category>codepen</category>
      <category>html</category>
    </item>
  </channel>
</rss>
