<?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: Jeferson J Amorim</title>
    <description>The latest articles on DEV Community by Jeferson J Amorim (@amorimjj).</description>
    <link>https://dev.to/amorimjj</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%2F1516427%2F4bc16ce6-fb17-4180-8249-b1125553b4de.jpeg</url>
      <title>DEV Community: Jeferson J Amorim</title>
      <link>https://dev.to/amorimjj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amorimjj"/>
    <language>en</language>
    <item>
      <title>Enhance Your Tailwind CSS Skills: Essential Tips and Tricks</title>
      <dc:creator>Jeferson J Amorim</dc:creator>
      <pubDate>Mon, 17 Jun 2024 23:19:26 +0000</pubDate>
      <link>https://dev.to/amorimjj/enhance-your-tailwind-css-skills-essential-tips-and-tricks-hp0</link>
      <guid>https://dev.to/amorimjj/enhance-your-tailwind-css-skills-essential-tips-and-tricks-hp0</guid>
      <description>&lt;p&gt;Hey folks,&lt;/p&gt;

&lt;p&gt;In my previous &lt;a href="https://dev.to/amorimjj/introducing-rocketicons-the-perfect-companion-for-react-and-tailwind-css-developers-417b"&gt;post&lt;/a&gt;, introducing the &lt;a href="https://rocketicons.io"&gt;Rocketicons&lt;/a&gt;, a powerful icon library designed to be used with &lt;a href="https://tailwindcss.com"&gt;Tailwind&lt;/a&gt;, I expressed my love for the framework, how amazing I think it is, and encouraged its use.&lt;/p&gt;

&lt;p&gt;A colleague shared an interesting insight that caught my attention.&lt;/p&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%2Fuploads%2Farticles%2Fz39tb1wg9xyfsb8er66s.png" 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%2Fuploads%2Farticles%2Fz39tb1wg9xyfsb8er66s.png" alt="Comment pointing few issues regarding the use of Tailwind" width="800" height="237"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On one hand, I don’t think this is a problem exclusive to Tailwind, but on the other, I can’t deny it’s a good point that deserves special care from developers. Tailwind is really easy to use and can invite you to just start doing things, but its indiscriminate use can generate problems.&lt;/p&gt;

&lt;p&gt;You've probably heard about clean code, good practices, and things like that. If you haven’t figured it out yet, those aren’t about creating code people admire or getting kudos. It’s about how easy it is to look at your code and understand what it does, because this way, you can continue your work. It’s about having a structure that is easy to extend, change, and maintain. Sometimes, even the creator, after some time, looks at the code and thinks, "What does this do? How does it work? How can I change it?" These are situations we must find ways to avoid.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you're trying to understand why good practices are important, take a look on &lt;a href="https://www.linkedin.com/pulse/understanding-code-quality-why-behind-best-practices-jeferson-amorim-gd5if"&gt;Understanding Code Quality: The Why Behind Best Practices&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I’m not here to dictate rules because I don’t believe there is a single right way of doing things. Therefore, this is not the ultimate guide for all Tailwind’s good practices, but perhaps with community collaboration, it can become one someday. The absence of a right way definitely does not exclude the possibility of a wrong way, because it does exist. Failing to follow a few principles in code writing will create a maintenance nightmare. By the way, once you create any code, keep in mind that someone will need to maintain it, and that someone could be you!&lt;/p&gt;

&lt;p&gt;I’m going to share tips and explanations to help you make great use of Tailwind, using the power of the tool on your side to create amazing experiences for your users.&lt;/p&gt;

&lt;h3&gt;
  
  
  Learn CSS
&lt;/h3&gt;

&lt;h4&gt;
  
  
  How can you style if you don’t know anything about styling?!
&lt;/h4&gt;

&lt;p&gt;Understanding the fundamentals of CSS is crucial before diving into Tailwind. In fact, that point is valid for any framework you are trying to learn. While Tailwind simplifies many styling tasks, a base knowledge of CSS is required to understand how styling works. It’s not just about understanding how Tailwind works under the hood, which helps you use it effectively, but also about seeing the big picture of what styling is. Besides, knowing CSS also empowers you to create custom utilities in Tailwind when the predefined ones don’t meet your needs.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;So, the first one is&lt;/em&gt;: &lt;strong&gt;Learn CSS!&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Dominate the tool
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Tailwind is powerful, but only if you know how to use it properly.
&lt;/h4&gt;

&lt;p&gt;Tailwind is powerful, but only if you know how to use it properly. Spend time reading the documentation, experimenting with different classes, and understanding how utility-first CSS works. Pay special attention to understanding configuration and how plugins work. This will help you master the tool and know when and how to use each feature. The documentation includes plenty of examples and explanations to get you started and help you become an expert on the framework.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Become a&lt;/em&gt; &lt;strong&gt;Master of the Tool!&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Use of the colors
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Tailwind offers a predefined palette of colors, but you can (and should) customize it to match your brand guidelines.
&lt;/h4&gt;

&lt;p&gt;The available options offered out of the box are amazing, inviting us to just use them, creating combinations and coloring everything. What’s the problem, right? I’m just using blue and slate variations all over the code, why is it a problem? But imagine you face a rebranding, and blue now becomes sky. How many places will require changes? How safe is it to just run a replace all? Define a set of colors in the Tailwind configuration file and stick to them. This ensures consistency across your application and makes it easier to manage changes globally.&lt;/p&gt;

&lt;p&gt;The documentation is very detailed, so I don’t think you will face any problems doing this. Just take a look at &lt;a href="https://tailwindcss.com/docs/customizing-colors#naming-your-colors"&gt;naming your colors&lt;/a&gt; to help you achieve it.&lt;/p&gt;

&lt;p&gt;My personal preference is for the &lt;a href="https://m3.material.io/styles/color/system/overview"&gt;Material Color System&lt;/a&gt; convention. I think it’s clear and suitable for most situations. The color names, such as primary, secondary, and surface, are descriptive and not connected to any specific brand, making them suitable for multiple applications. That’s why I choose it. But don’t be afraid to experiment with different options.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Just&lt;/em&gt; &lt;strong&gt;avoid hardcoding colors in your HTML.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Customize to match your needs*
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Sometimes you need something more specific for your project.
&lt;/h4&gt;

&lt;p&gt;Tailwind's default utilities cover a lot of ground, but don’t hesitate to create your own utilities. This can help keep your HTML clean and make your styling more manageable.&lt;/p&gt;

&lt;p&gt;For example, if you frequently use a specific combination of classes, like for text color where you use &lt;code&gt;text-primary dark:text-primary-700&lt;/code&gt;, consider creating a custom utility.&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;// tailwind.config.js&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;variants&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;addUtilities&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;addUtilities&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.text-default&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@apply text-primary dark:text-primary-700&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or using css syntax&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="k"&gt;@tailwind&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@tailwind&lt;/span&gt; &lt;span class="n"&gt;components&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@tailwind&lt;/span&gt; &lt;span class="n"&gt;utilities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;...&lt;/span&gt;

&lt;span class="k"&gt;@layer&lt;/span&gt; &lt;span class="n"&gt;utilities&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nc"&gt;.text-default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;@apply&lt;/span&gt; &lt;span class="err"&gt;text-primary&lt;/span&gt; &lt;span class="py"&gt;dark&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;text-primary-700&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same goes for variations, breakpoints, etc.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Do be afraid to&lt;/em&gt; &lt;strong&gt;create our own utilities!&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Reuse your code*
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Have you heard about DRY (Don’t Repeat Yourself)?
&lt;/h4&gt;

&lt;p&gt;It’s not just because repetition is ugly or wrong. How can code you wrote once nicely and runs well stop working or looking bad just because you copied it twice? The problem, once again, is regarding maintenance.&lt;/p&gt;

&lt;p&gt;Imagine you find an issue and need to update the routine for any reason. How many places will need an update? What are the odds you miss one spot and deploy code with a bug? That’s why the DRY principle is so important.&lt;/p&gt;

&lt;p&gt;If you’re repeating yourself using Tailwind, take a break and think about how to fix that. What is the best approach to solving that? A component, a loop, a utility, using &lt;code&gt;@apply&lt;/code&gt;? Learn how &lt;a href="https://tailwindcss.com/docs/reusing-styles"&gt;reusing styles&lt;/a&gt; can help you avoid this problem.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you think about&lt;/em&gt; &lt;strong&gt;copy and paste, just don’t!&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Do not run from the configuration complexity
&lt;/h3&gt;

&lt;h4&gt;
  
  
  For God’s sake, you are a developer! You’re built for that!
&lt;/h4&gt;

&lt;p&gt;Sass, SCSS, or even creating breaking points manually in simple CSS are not simple either. The sooner you embrace the complexity of those things, the stronger and more skilled you become. And, to be honest, &lt;a href="https://tailwindcss.com/docs/installation"&gt;getting started&lt;/a&gt; with Tailwind for learning purposes is really easy, and for most cases, just configuring your color scheme should be enough.&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid the Unnecessary Use of Markups
&lt;/h3&gt;

&lt;h4&gt;
  
  
  One of the principles of writing clean and maintainable code is to avoid the unnecessary use of markups.
&lt;/h4&gt;

&lt;p&gt;Tailwind encourages a utility-first approach, which means you can apply styles directly to your HTML elements without needing additional wrappers or extraneous elements. Keep in mind the number of style classes will increase a lot, so we must be smart regarding the markup structure. This not only keeps your HTML clean but also enhances readability and maintainability.&lt;/p&gt;

&lt;p&gt;Unnecessary markups can bloat your HTML, making it harder to read and maintain. By avoiding them, you can ensure your code remains streamlined and efficient. Here are a few tips to help you avoid unnecessary markups:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use Tailwind's Utility Classes&lt;/strong&gt;: Tailwind provides a comprehensive set of utility classes that can be applied directly to HTML elements. This eliminates the need for additional CSS classes or extra HTML elements.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- AVOID: Using extra divs just styling --&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;"p-4"&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;"bg-surface"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-center text-primary"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Hello, World!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- PREFER: Applying utilities directly to the element --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"p-4 bg-surface text-center text-primary"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Hello, World!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simplify Your Structure&lt;/strong&gt;: Evaluate your HTML structure and remove any elements that don’t serve a specific purpose. Each element should have a clear role, whether it’s for semantic structure or styling purposes.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- AVOID: Nested divs without a clear purpose --&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;"outer-wrapper"&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;"inner-wrapper"&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;"content"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-lg"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;This is a paragraph.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- PREFER: Simplified structure --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-lg"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;This is a paragraph.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use Tailwind’s Flex and Grid Utilities&lt;/strong&gt;: Tailwind's flex and grid utilities can often eliminate the need for additional containers. By using these utilities, you can create complex layouts with minimal markup.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- AVOID: Using extra containers for layout --&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;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"row"&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;"col"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Item 1&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&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;"col"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Item 2&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- PREFER: Using Tailwind's grid utilities and semantic markup --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;ul&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"grid grid-cols-2 gap-4"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Item 1&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Item 2&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By avoiding unnecessary markups, you can keep your codebase clean, reduce complexity, and make your project easier to maintain. This practice, combined with Tailwind's powerful utility-first approach, will enable you to create efficient and scalable designs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use the documentation
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Tailwind's documentation is one of its greatest strengths.
&lt;/h4&gt;

&lt;p&gt;It is comprehensive, well-organized, and full of examples. Make it a habit to consult the documentation regularly. Whether you’re looking for a specific utility, trying to understand how to customize the configuration, or searching for best practices, the documentation should be your go-to resource.&lt;/p&gt;

&lt;h3&gt;
  
  
  Think about global changes
&lt;/h3&gt;

&lt;h4&gt;
  
  
  It’s a good exercise to find the balance between writing code that is easy to maintain and not worrying about a future that may not come.
&lt;/h4&gt;

&lt;p&gt;Having that in mind, it’s up to you to decide what should be handled globally or not. For example, if you decide to update your brand colors or adjust the spacing scale, what changes will be required? Can you do it in one place, and the changes will propagate throughout your entire project? Tailwind makes it easy to apply global changes through its configuration file. Take advantage of this feature to maintain consistency and manage styles efficiently.&lt;/p&gt;

&lt;h4&gt;
  
  
  *Be careful on the use of the &lt;code&gt;@apply&lt;/code&gt;.
&lt;/h4&gt;

&lt;p&gt;Otherwise, we’ll just be writing CSS in a different way. That is not the purpose of Tailwind. The magic of this tool is keeping the view and style in the same place, making it easy to understand how it will behave and appear. The appeal of having all the variations, breakpoints, and pseudo-classes directly in HTML facilitates understanding what is going on, centralizing all the view core changes in one place. That is priceless! &lt;/p&gt;

&lt;p&gt;I know, I know… I’ve been talking about good practices and principles until now, and suddenly I’m talking about having the view and style in the same place.&lt;/p&gt;

&lt;p&gt;It might sound nonsensical, breaking the separation of concerns principle, but I’d like to propose a reflection here. Should we always follow the principles? Do they always make sense? What about when the paradigm changes? And about evolution? Are those principles still valid nowadays, for the current technologies?&lt;/p&gt;

&lt;p&gt;In my personal opinion, based on the code I’ve written, having all the aspects of the view in the same place is a good thing, especially because style doesn’t work without the view. It’s not like a data layer that works alone as a data provider and can be used for multiple applications. The only reason the styling exists is the view.&lt;/p&gt;

&lt;p&gt;Looking across CSS files to find which styles apply to the view and must be updated can be a tricky task. But for years, no better way of doing that was available, and keeping those separate was by far the best option. But using Tailwind, it’s not required anymore. I think, maybe, keeping those together can be the modern way.&lt;/p&gt;

&lt;p&gt;Anyway, I’m just a guy from Brazil, sharing a few thoughts… Let me know what you think about it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.freepik.com/free-ai-image/futurism-perspective-digital-nomads-lifestyle_138710890.htm#fromView=image_search_similar&amp;amp;page=1&amp;amp;position=1&amp;amp;uuid=f5292c00-86a3-43a2-882e-4418e0aebe7d"&gt;Cover Image by freepik&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>tailwindcss</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Introducing Rocketicons: The Perfect Companion for React and Tailwind CSS Developers</title>
      <dc:creator>Jeferson J Amorim</dc:creator>
      <pubDate>Fri, 24 May 2024 20:00:32 +0000</pubDate>
      <link>https://dev.to/amorimjj/introducing-rocketicons-the-perfect-companion-for-react-and-tailwind-css-developers-417b</link>
      <guid>https://dev.to/amorimjj/introducing-rocketicons-the-perfect-companion-for-react-and-tailwind-css-developers-417b</guid>
      <description>&lt;p&gt;Hey there,&lt;/p&gt;

&lt;p&gt;I'm thrilled to announce a project that's been in the works - Rocketicons! This project has been a collaborative effort with a talented friend of mine.&lt;/p&gt;

&lt;p&gt;Our journey with &lt;a href="https://rocketicons.io"&gt;Rocketicons&lt;/a&gt; started when we encountered the challenges of maintaining separate codebases for web and mobile platforms while developing a solution for sharing expenses via PIX, a Brazilian instant payment method. The duplication headaches were real, causing more inefficiencies than we cared to count. That's when we decided it was time for a change.&lt;/p&gt;

&lt;p&gt;Enter &lt;a href="https://react.dev"&gt;React&lt;/a&gt;, &lt;a href="https://reactnative.dev"&gt;React Native&lt;/a&gt;, and &lt;a href="https://expo.dev"&gt;Expo&lt;/a&gt;. By unifying our development stack, we streamlined our workflow considerably. Yet, one crucial piece was missing: a comprehensive library for essential tasks like icons and components. As we delved further into our development journey, we realized there were more gaps to fill, including robust boilerplates and other essential necessities.&lt;/p&gt;

&lt;p&gt;And thus, &lt;a href="https://rocketicons.io"&gt;Rocketicons&lt;/a&gt; was born. The first tool we’ve published to address these challenges. Rocketicons is an icon library designed specifically for &lt;a href="https://tailwindcss.com"&gt;Tailwind CSS&lt;/a&gt; and fully compatible with React Native. And it's just the beginning. Our mission is to empower developers like you to effortlessly share codebases across platforms, boosting productivity while ensuring consistency. We're also working on solutions for the other problems we've identified, so stay tuned for more tools to come!&lt;/p&gt;

&lt;h4&gt;
  
  
  Why Tailwind CSS?
&lt;/h4&gt;

&lt;p&gt;I have to admit, I never liked Bootstrap much, but I absolutely love Tailwind CSS! It might sound insane, but here’s why I think it’s a game-changer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Utility-First Approach&lt;/strong&gt;: Say goodbye to digging through endless CSS files. Tailwind's utility-first approach means styling directly within HTML, making development faster and code more maintainable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customization&lt;/strong&gt;: Tailwind is like a chameleon — it adapts to your design preferences. With its high configurability, we can tailor it to fit our exact needs, ensuring a sleek and cohesive user interface every time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: Small CSS bundles? Yes, please! By only including the styles we need, Tailwind keeps our applications lightning fast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Community Support&lt;/strong&gt;: It's not just a framework; it's a family. The vibrant Tailwind community offers a treasure trove of resources, plugins, and support, making troubleshooting a breeze and best practices a cinch to learn.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I can't see any reason not to use Tailwind CSS — it's truly revolutionized how we approach styling.&lt;/p&gt;

&lt;h4&gt;
  
  
  Now, let's talk &lt;a href="https://rocketicons.io"&gt;Rocketicons&lt;/a&gt; features:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tailwind CSS Integration&lt;/strong&gt;: Style your icons effortlessly with Tailwind's utility-first approach.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React Native Support&lt;/strong&gt;: Seamlessly use the same icons across web and mobile platforms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistent Design&lt;/strong&gt;: Keep your applications looking sharp and feeling cohesive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy to Use&lt;/strong&gt;: Use Tailwind classes to avoid mixing HTML attributes with styles, making the code easier to understand and style, you'll be up and running in no time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Still not convinced? Take a peek at just how simple it is to integrate Rocketicons into your projects:&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;// Example for a React project&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;RcRocketIcon&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rocketicons/rc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;RcRocketIcon&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;icon-rose-500 border border-slate-600 rounded-lg bg-slate-50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For React Native, no code changes are needed.&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;// Example for a React Native project&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;RcRocketIcon&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rocketicons/rc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;RcRocketIcon&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;icon-rose-500 border border-slate-600 rounded-lg bg-slate-50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;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/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1gea0e9m0tlpq6zaw1qb.png" 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%2Fuploads%2Farticles%2F1gea0e9m0tlpq6zaw1qb.png" alt="Sample Code Rendering" width="800" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ready to embark on this journey with us? We're beyond excited to share &lt;a href="https://rocketicons.io"&gt;Rocketicons&lt;/a&gt; with the developer community and can't wait to hear your feedback and contributions. &lt;/p&gt;

&lt;p&gt;Dive into our documentation or visit our &lt;a href="https://github.com/rocketclimb/rocketicons"&gt;GitHub repository&lt;/a&gt; for everything you need to get started, and let's make some coding magic happen!&lt;/p&gt;

&lt;p&gt;Dive into our &lt;a href="https://rocketicons.io/docs/usage"&gt;documentation&lt;/a&gt; or on &lt;a href="https://github.com/rocketclimb/rocketicons"&gt;GitHub repository&lt;/a&gt; for everything you need to get started and let's make some coding magic happen!&lt;/p&gt;

&lt;p&gt;Thank you for your consistent support, and let's keep writing countless lines of stellar code!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I've wrote a &lt;a href="https://www.linkedin.com/pulse/empower-your-learning-journey-why-personal-projects-matter-amorim-ctoof/?trackingId=lKT5%2BliUTQm%2B5Gv%2F0E%2FgHw%3D%3D"&gt;article on LinkedIn&lt;/a&gt; sharing how this project has improved me as a professional.&lt;/em&gt;&lt;/p&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%2Fuploads%2Farticles%2Fwhlshd14gu90cv4g0tvy.png" 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%2Fuploads%2Farticles%2Fwhlshd14gu90cv4g0tvy.png" alt="Take a look at how this project has improved me as a professional" width="800" height="785"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactnative</category>
      <category>tailwindcss</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
