<?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: Maxime</title>
    <description>The latest articles on DEV Community by Maxime (@maxime_daraize).</description>
    <link>https://dev.to/maxime_daraize</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%2F149958%2Fcbd80884-f603-405f-bf27-812baf170f29.jpeg</url>
      <title>DEV Community: Maxime</title>
      <link>https://dev.to/maxime_daraize</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maxime_daraize"/>
    <language>en</language>
    <item>
      <title>Easily structure your Sass</title>
      <dc:creator>Maxime</dc:creator>
      <pubDate>Mon, 11 Oct 2021 14:41:59 +0000</pubDate>
      <link>https://dev.to/maxime_daraize/generate-a-sass-structure-with-this-cli-1lgn</link>
      <guid>https://dev.to/maxime_daraize/generate-a-sass-structure-with-this-cli-1lgn</guid>
      <description>&lt;p&gt;Hello everyone 👋,&lt;/p&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;A year ago, I published an NPM package to generate a Sass file structure at the root of a project. &lt;/p&gt;

&lt;p&gt;The goal behind this idea was to help our dev team to have "one source of truth" regarding the way we organized our code. And it worked well at first. We all used it, to start a new project, and it became more maintainable.&lt;/p&gt;

&lt;p&gt;But there was one big issue that we could not solve with this package, it was not &lt;strong&gt;flexible&lt;/strong&gt; enough.&lt;/p&gt;

&lt;p&gt;Because not all projects are the same, having to use the same template for all our projects was not ideal. &lt;/p&gt;

&lt;p&gt;The solution: create a CLI to give more options to the devs, like choosing the path of installation, multiple templates, "helper" code, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  The CLI
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LNAl-1jw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/mdaraize/image/upload/v1633280171/create-scss-cli/cscli.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LNAl-1jw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/mdaraize/image/upload/v1633280171/create-scss-cli/cscli.png" alt="create-scss-cli setup example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The CLI generates a Sass file structure based on the 7-1 pattern. You can choose where you want to install it into your project. It comes with (variables, mixins, functions, and maps to generate helper CSS classes). &lt;/p&gt;

&lt;p&gt;If you only want to file structure, but without any code, you can select the "clean" template. It will generate all the files, without any starter code.&lt;/p&gt;

&lt;p&gt;Otherwise, you also have the option to remove the specific folder from the structure. Don't need a vendor or theme folder, no problem, simply select which folder you want to discard from the original structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scss
    │
    ├── abstracts
    │   ├── colors
    │   ├── fonts
    │   ├── index
    │   ├── mixins
    │   ├── spacing
    │   └── helper
    │
    ├── base
    │   ├── global.scss
    │   ├── shame.scss
    │   └── typography.scss
    │
    ├── components
    │   ├── alert.scss
    │   ├── banner.scss
    │   ├── buttons.scss
    │   ├── card.scss
    │   ├── forms.scss
    │   ├── icons.scss
    │   ├── menu.scss
    │   ├── modal.scss
    │   ├── progress.scss
    │   └── table.scss
    │
    ├── layout
    │   ├── footer.scss
    │   ├── grid.scss
    │   ├── header.scss
    │   ├── navigation.scss
    │   └── sidebar.scss
    │
    ├── pages
    │   └── home.scss
    │
    ├── themes
    │   └── dark.scss
    │
    ├── vendor
    │   └── normalize.scss
    │
    └── main.scss
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nodejs.org/en/"&gt;Node 14&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com"&gt;Npm&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can install the package globally or execute it right away with npx.&lt;/p&gt;

&lt;h3&gt;
  
  
  Global install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i &lt;span class="nt"&gt;-g&lt;/span&gt; create-scss-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, you'll be able to use the create-scss-cli command in your project like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cs-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  NPX
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-scss-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Documentation
&lt;/h2&gt;

&lt;p&gt;👉 &lt;a href="https://www.createscss.com/"&gt;https://www.createscss.com/&lt;/a&gt; &lt;br&gt;&lt;br&gt;
👉 &lt;a href="https://github.com/maximedaraize/create-scss-cli"&gt;https://github.com/maximedaraize/create-scss-cli&lt;/a&gt; &lt;br&gt;&lt;br&gt;
👉 &lt;a href="https://www.npmjs.com/package/create-scss-cli"&gt;https://www.npmjs.com/package/create-scss-cli&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;I would really appreciate any feedback. This is a side-project but I have the intention to keep working on it. &lt;a href="https://github.com/maximedaraize/create-scss-cli/issues"&gt;Contribution is welcome&lt;/a&gt; 🤙&lt;/p&gt;

&lt;p&gt;Thanks for reading,&lt;/p&gt;

&lt;p&gt;Max&lt;/p&gt;

</description>
      <category>sass</category>
      <category>scss</category>
      <category>css</category>
      <category>cli</category>
    </item>
    <item>
      <title>📦 npm package that help you organize your sass </title>
      <dc:creator>Maxime</dc:creator>
      <pubDate>Wed, 17 Jun 2020 21:34:26 +0000</pubDate>
      <link>https://dev.to/maxime_daraize/npm-package-that-help-you-organize-your-sass-5edd</link>
      <guid>https://dev.to/maxime_daraize/npm-package-that-help-you-organize-your-sass-5edd</guid>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;I recently publish a &lt;a href="https://www.createscss.com/"&gt;npm package&lt;/a&gt; that create a scss directory structure into your repo.&lt;/p&gt;

&lt;p&gt;It can be helpful when you start a new project and you don't want to spend too much time making folders and files to organize your styles.&lt;/p&gt;

&lt;h2&gt;
  
  
  🗂 Structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;     scss
        │
        ├── abstracts
        │   ├── functions.scss
        │   ├── helpers.scss
        │   ├── mixins.scss
        │   └── variables.scss
        │
        ├── base
        │   ├── global.scss
        │   ├── reset.scss
        │   ├── shame.scss
        │   └── typography.scss
        │
        ├── components
        │   ├── alert.scss
        │   ├── banner.scss
        │   ├── buttons.scss
        │   ├── card.scss
        │   ├── forms.scss
        │   ├── icons.scss
        │   ├── menu.scss
        │   ├── modal.scss
        │   ├── progress.scss
        │   └── table.scss
        │
        ├── layout
        │   ├── footer.scss
        │   ├── grid.scss
        │   ├── header.scss
        │   ├── navigation.scss
        │   └── sidebar.scss
        │
        ├── pages
        │   └── home.scss
        │
        ├── themes
        │   └── theme.scss
        │
        ├── vendor
        │
        └── main.scss

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  ✨ Installation
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;node js&lt;/code&gt; is required -&amp;gt; &lt;a href="https://nodejs.org/en/"&gt;download&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install the package&lt;/span&gt;
npm i create-scss-cli

&lt;span class="c"&gt;#execute the command with&lt;/span&gt;
cs-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Documentation
&lt;/h2&gt;

&lt;p&gt;👉 &lt;a href="https://www.createscss.com/"&gt;https://www.createscss.com/&lt;/a&gt;&lt;br&gt;
👉 &lt;a href="https://github.com/maximedaraize/create-scss-cli"&gt;https://github.com/maximedaraize/create-scss-cli&lt;/a&gt;&lt;br&gt;
👉 &lt;a href="https://www.npmjs.com/package/create-scss-cli"&gt;https://www.npmjs.com/package/create-scss-cli&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;I would really apreciate any feedback. This is a side-projcet but I have the intention to keep working on it. Any help is welcome 🙂 &lt;br&gt;Hope someone will find this useful 🤷‍♂️&lt;/p&gt;

&lt;p&gt;Thanks for reading,&lt;/p&gt;

&lt;p&gt;Max&lt;/p&gt;

</description>
      <category>css</category>
      <category>sass</category>
      <category>npm</category>
      <category>cli</category>
    </item>
    <item>
      <title>CSS + Pokemon</title>
      <dc:creator>Maxime</dc:creator>
      <pubDate>Fri, 15 May 2020 17:23:01 +0000</pubDate>
      <link>https://dev.to/maxime_daraize/css-pokemon-4bii</link>
      <guid>https://dev.to/maxime_daraize/css-pokemon-4bii</guid>
      <description>&lt;p&gt;I wanted to make some pokemon with CSS based on the original image from Pokemon Yellow (yep! nostalgia... 👾). &lt;/p&gt;

&lt;h2&gt;
  
  
  Here's how I did it!
&lt;/h2&gt;

&lt;p&gt;First I collected all &lt;a href="https://github.com/maximedaraize/pokemon-pixel/tree/master/img" rel="noopener noreferrer"&gt;pokemon images&lt;/a&gt; from the game.&lt;br&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%2Foks08uefampx6nnfg9cq.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%2Foks08uefampx6nnfg9cq.png" alt="151 pokemons"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you zoom on the images you start to see every pixel that composes the Pokemon. The goal was to replicate that pixel grid in html and css.&lt;br&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%2Fr0mx1klphbmyll5kkzc2.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%2Fr0mx1klphbmyll5kkzc2.png" alt="Pikachu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some drawings are bigger than other, but the average is 40px by 40px. &lt;/p&gt;

&lt;p&gt;So I made a grid containing 1600 empty  &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;... 😅&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;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"canvas"&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;"pixel"&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&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"pixel"&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&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"pixel"&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;You could also create the &lt;code&gt;&amp;lt;div class="pixel"&amp;gt;&lt;/code&gt; with javascript or jQuery if you dont want to add 1600 line of html in your development process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//create 1600 div with "pixel" className&lt;/span&gt;
&lt;span class="cm"&gt;/* You could also simply write 1600 divs in
the HTML section with the class .pixel inside
the .canvas container */&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;step&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;step&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1600&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;step&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;//create a div&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;pixel&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;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;div&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;//select the container with canvas Class&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;canvas&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="s2"&gt;.canvas&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;//append the div to the container&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="s2"&gt;.canvas&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pixel&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;//add a class to the div&lt;/span&gt;
  &lt;span class="nx"&gt;pixel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;class&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pixel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, just add a little bit of &lt;code&gt;CSS&lt;/code&gt; to see the grid.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/*grid container made of 40 columns and 40 rows. 
  Each of them the create a square of 12px*/&lt;/span&gt;
&lt;span class="nc"&gt;.canvas&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;grid-template-columns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;repeat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;12px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="py"&gt;grid-template-rows&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;repeat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;12px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.pixel&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;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;fuchsia&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0.2&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;&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%2Fk8qq238u16rizgenqeqb.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%2Fk8qq238u16rizgenqeqb.png" alt="grid"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After this step you only need to "color-pick" the color of that pokemon and start filling the &lt;code&gt;&amp;lt;div class="pixel"&amp;gt;&lt;/code&gt; with it.&lt;/p&gt;

&lt;p&gt;Squirtle is compose of 3 color:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;black (#000000)&lt;/li&gt;
&lt;li&gt;a light blue (#D6E6FF)&lt;/li&gt;
&lt;li&gt;a dark blue (#3AC5E6)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;note that I did not fill the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; with the color white&lt;/em&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%2Fi%2Fgs8liz7zxzjh5f466kul.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%2Fgs8liz7zxzjh5f466kul.png" alt="squirtle"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The idea is to select a &lt;code&gt;&amp;lt;div class="pixel"&amp;gt;&lt;/code&gt; with CSS based on its position. &lt;br&gt;
For example the &lt;strong&gt;top left&lt;/strong&gt; &lt;code&gt;&amp;lt;div class="pixel"&amp;gt;&lt;/code&gt; is &lt;code&gt;.pixel:nth-child(1)&lt;/code&gt; and the next one to its left is &lt;code&gt;.pixel:nth-child(2)&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="nt"&gt;snippet&lt;/span&gt; &lt;span class="nt"&gt;example&lt;/span&gt;
&lt;span class="nc"&gt;.pixel&lt;/span&gt;&lt;span class="nd"&gt;:nth-child&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;171&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="nc"&gt;.pixel&lt;/span&gt;&lt;span class="nd"&gt;:nth-child&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;210&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="nc"&gt;.pixel&lt;/span&gt;&lt;span class="nd"&gt;:nth-child&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;178&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="nc"&gt;.pixel&lt;/span&gt;&lt;span class="nd"&gt;:nth-child&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;220&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="nc"&gt;.pixel&lt;/span&gt;&lt;span class="nd"&gt;:nth-child&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;302&lt;/span&gt;&lt;span class="o"&gt;)&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="m"&gt;#3AC5E6&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;Because there are 40 elements on each row and each column you can count it. But there is an easier way.&lt;/p&gt;

&lt;p&gt;I made a small snippet that count the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; position for me&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.canvas&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;children&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.pixel&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;hover&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;index&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&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;When you pass your cursor hover a &lt;code&gt;&amp;lt;div class="pixel"&amp;gt;&lt;/code&gt;, it will output in the console its position number, so you can use it and color it based on the images yo have.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/collection/XJzqvm?cursor=ZD0wJm89MSZwPTEmdj0yNjM5MTE5" rel="noopener noreferrer"&gt;Here's&lt;/a&gt; the Codepen collection of pokemon I made so far 🙆‍♂️&lt;/p&gt;

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