<?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: Omar Bourhaouta</title>
    <description>The latest articles on DEV Community by Omar Bourhaouta (@bourhaouta).</description>
    <link>https://dev.to/bourhaouta</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F105572%2F6a75dd5b-2e3f-4834-a1a4-14ec9e02adc6.png</url>
      <title>DEV Community: Omar Bourhaouta</title>
      <link>https://dev.to/bourhaouta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bourhaouta"/>
    <language>en</language>
    <item>
      <title>Tailwind color palettes the AI way!</title>
      <dc:creator>Omar Bourhaouta</dc:creator>
      <pubDate>Thu, 01 Oct 2026 00:00:00 +0000</pubDate>
      <link>https://dev.to/bourhaouta/tailwind-color-palettes-the-ai-way-37b1</link>
      <guid>https://dev.to/bourhaouta/tailwind-color-palettes-the-ai-way-37b1</guid>
      <description>&lt;p&gt;AI agents write a lot of our CSS now, but they still guess Tailwind colors. So I gave them the same tool I use: real palettes, from any color.&lt;/p&gt;

&lt;p&gt;In the &lt;a href="https://www.bourhaouta.com/blog/tailwind-color-palettes-the-fast-way/" rel="noopener noreferrer"&gt;last post&lt;/a&gt; I said: no need to ask the AI for a Tailwind palette, one shortcut in your editor does it. That's still true. But more and more, it's not me typing the CSS. It's the agent.&lt;/p&gt;

&lt;p&gt;So I tried it. I asked an agent: "Add a brand color &lt;code&gt;#db4d53&lt;/code&gt; to my theme". It added one line:&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="nt"&gt;--color-brand&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;#db4d53&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;One color, no shades. So &lt;code&gt;bg-brand-500&lt;/code&gt; and &lt;code&gt;hover:bg-brand-600&lt;/code&gt; don't exist. And when agents do write the shades, they guess them.&lt;/p&gt;

&lt;p&gt;So &lt;a href="https://tailwindshades.bourhaouta.com" rel="noopener noreferrer"&gt;Tailwind Shades&lt;/a&gt; is now more than a VS Code extension. The same engine is also an MCP server for AI agents, a CLI, and a website.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give it to your agent
&lt;/h2&gt;

&lt;p&gt;MCP is how AI agents like Claude Code, Cursor and VS Code use outside tools. The server runs online, so there's nothing to install. In Claude Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; http &lt;span class="nt"&gt;--scope&lt;/span&gt; user tailwindshades https://tailwindshades.bourhaouta.com/mcp

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

&lt;/div&gt;



&lt;p&gt;Or in Cursor's &lt;code&gt;~/.cursor/mcp.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"tailwindshades"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://tailwindshades.bourhaouta.com/mcp"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

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

&lt;/div&gt;



&lt;p&gt;Now ask the same thing again, and you get the full palette in your project's Tailwind format, with &lt;code&gt;#db4d53&lt;/code&gt; exactly at &lt;code&gt;brand-500&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="k"&gt;@theme&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--color-brand-50&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;97.1%&lt;/span&gt; &lt;span class="m"&gt;0.01&lt;/span&gt; &lt;span class="m"&gt;13.669&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="py"&gt;--color-brand-100&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;93.2%&lt;/span&gt; &lt;span class="m"&gt;0.024&lt;/span&gt; &lt;span class="m"&gt;14.006&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c"&gt;/* ... */&lt;/span&gt;
  &lt;span class="py"&gt;--color-brand-500&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;61.6%&lt;/span&gt; &lt;span class="m"&gt;0.177&lt;/span&gt; &lt;span class="m"&gt;21.62&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c"&gt;/* ... */&lt;/span&gt;
  &lt;span class="py"&gt;--color-brand-950&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;25.8%&lt;/span&gt; &lt;span class="m"&gt;0.069&lt;/span&gt; &lt;span class="m"&gt;22.331&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 agent gets two tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;generate_palette&lt;/code&gt;: the full palette from one color, for Tailwind v4, v3, v2 or v1.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;closest_tailwind_color&lt;/code&gt;: the closest Tailwind class to a color, and if the difference is visible. For &lt;code&gt;#db4d53&lt;/code&gt; it says &lt;code&gt;red-500&lt;/code&gt;, but the difference is visible, so a custom palette is better.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also warns the agent when a name would replace a Tailwind color. Without a name, the palette would be called &lt;code&gt;red&lt;/code&gt;, and every &lt;code&gt;red-*&lt;/code&gt; class in your app would change.&lt;/p&gt;

&lt;p&gt;Prefer it local? Run &lt;code&gt;npx -y tailwindshades-mcp&lt;/code&gt; instead. Then nothing leaves your machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  No editor? No agent?
&lt;/h2&gt;

&lt;p&gt;There's a website now: &lt;a href="https://tailwindshades.bourhaouta.com" rel="noopener noreferrer"&gt;tailwindshades.bourhaouta.com&lt;/a&gt;. Pick a color, see the palette next to the Tailwind color it follows, and copy the code. You can also share a palette with a link.&lt;/p&gt;

&lt;p&gt;And in the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx tailwindshades-cli &lt;span class="s2"&gt;"#db4d53"&lt;/span&gt; &lt;span class="nt"&gt;--name&lt;/span&gt; brand

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  A better fit
&lt;/h2&gt;

&lt;p&gt;If you read the last post, &lt;code&gt;#db4d53&lt;/code&gt; landed at &lt;code&gt;400&lt;/code&gt;. Now it's &lt;code&gt;500&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The engine used to pick the shade by chroma, how colorful your color is. Now it picks the shade with the closest lightness, so the whole palette follows Tailwind's light-to-dark steps more closely. Building the MCP server is how I found it: the closest Tailwind shade to &lt;code&gt;#db4d53&lt;/code&gt; is &lt;code&gt;red-500&lt;/code&gt;, but the palette put it at &lt;code&gt;400&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://tailwindshades.bourhaouta.com" rel="noopener noreferrer"&gt;Website&lt;/a&gt;, with the setup for each agent&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=bourhaouta.tailwindshades" rel="noopener noreferrer"&gt;VS Code Marketplace&lt;/a&gt; and &lt;a href="https://open-vsx.org/extension/bourhaouta/tailwindshades" rel="noopener noreferrer"&gt;Open VSX&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/tailwindshades-mcp" rel="noopener noreferrer"&gt;npm: tailwindshades-mcp&lt;/a&gt; and &lt;a href="https://www.npmjs.com/package/tailwindshades-cli" rel="noopener noreferrer"&gt;tailwindshades-cli&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bourhaouta/vscode-tailwindshades" rel="noopener noreferrer"&gt;Source on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your agent picks better colors now, a star on GitHub or a rating on the Marketplace helps other people find it.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>tailwindcss</category>
      <category>ai</category>
      <category>mcp</category>
    </item>
    <item>
      <title>Tailwind color palettes the fast way!</title>
      <dc:creator>Omar Bourhaouta</dc:creator>
      <pubDate>Wed, 30 Sep 2026 00:00:00 +0000</pubDate>
      <link>https://dev.to/bourhaouta/tailwind-color-palettes-the-fast-way-2n3l</link>
      <guid>https://dev.to/bourhaouta/tailwind-color-palettes-the-fast-way-2n3l</guid>
      <description>&lt;p&gt;You have one brand color and you need the full Tailwind palette, from 50 to 950. No need to ask the AI for it, one shortcut in your editor does it.&lt;/p&gt;

&lt;p&gt;When I start a new project, the first thing I do is set up the theme colors. Lately it's tempting to just ask the AI: "give me a Tailwind palette from &lt;code&gt;#db4d53&lt;/code&gt;". Then you wait for it to think, you spend tokens, and you get shades that are guessed. Sometimes your own color isn't even in there.&lt;/p&gt;

&lt;p&gt;So I made &lt;a href="https://marketplace.visualstudio.com/items?itemName=bourhaouta.tailwindshades" rel="noopener noreferrer"&gt;Tailwind CSS Shades&lt;/a&gt;, a small VS Code extension that does it instantly. No AI, no tokens, no waiting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgm3o037bo0968eo5sbvi.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgm3o037bo0968eo5sbvi.gif" alt="Put the cursor on #db4d53, press Ctrl+K Ctrl+G, name it brand, and a Tailwind v4 palette is written" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Put the cursor on a color: &lt;code&gt;#db4d53&lt;/code&gt;, &lt;code&gt;rgb(…)&lt;/code&gt;, &lt;code&gt;hsl(…)&lt;/code&gt;, &lt;code&gt;oklch(…)&lt;/code&gt; or a color name.&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl+K Ctrl+G&lt;/code&gt; (&lt;code&gt;Cmd+K Cmd+G&lt;/code&gt; on macOS).&lt;/li&gt;
&lt;li&gt;Name it, like &lt;code&gt;brand&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And you get your theme:&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;@theme&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--color-brand-50&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;97.1%&lt;/span&gt; &lt;span class="m"&gt;0.012&lt;/span&gt; &lt;span class="m"&gt;16.784&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="py"&gt;--color-brand-100&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;91.4%&lt;/span&gt; &lt;span class="m"&gt;0.03&lt;/span&gt; &lt;span class="m"&gt;17.121&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c"&gt;/* ... */&lt;/span&gt;
  &lt;span class="py"&gt;--color-brand-900&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;38.1%&lt;/span&gt; &lt;span class="m"&gt;0.131&lt;/span&gt; &lt;span class="m"&gt;25.127&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="py"&gt;--color-brand-950&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;25.8%&lt;/span&gt; &lt;span class="m"&gt;0.085&lt;/span&gt; &lt;span class="m"&gt;25.446&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;It reads your Tailwind version from the project, so on v3 you get a &lt;code&gt;tailwind.config.js&lt;/code&gt; object with hex colors instead. It works with v4, v3, v2 and v1.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shades look like Tailwind's
&lt;/h2&gt;

&lt;p&gt;It doesn't just mix your color with white and black. It finds the closest Tailwind color to yours and copies how that color changes from light to dark, in OKLCH. And your color stays exactly as it is, at the shade where it fits best.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=bourhaouta.tailwindshades" rel="noopener noreferrer"&gt;VS Code Marketplace&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://open-vsx.org/extension/bourhaouta/tailwindshades" rel="noopener noreferrer"&gt;Open VSX&lt;/a&gt; for Cursor, Windsurf and VSCodium&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bourhaouta/vscode-tailwindshades" rel="noopener noreferrer"&gt;Source on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If it saves you some time, a rating on the Marketplace or Open VSX helps other people find it.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>tailwindcss</category>
      <category>vscode</category>
      <category>css</category>
    </item>
    <item>
      <title>Tailwind `.container` the right way!</title>
      <dc:creator>Omar Bourhaouta</dc:creator>
      <pubDate>Sun, 12 Jul 2020 23:28:18 +0000</pubDate>
      <link>https://dev.to/bourhaouta/tailwind-container-the-right-way-5g77</link>
      <guid>https://dev.to/bourhaouta/tailwind-container-the-right-way-5g77</guid>
      <description>&lt;p&gt;&lt;em&gt;This article has been originally posted on my &lt;a href="https://bourhaouta.com/blog/tailwind-container-the-right-way/" rel="noopener noreferrer"&gt;blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The container is just a div you can style with CSS. You can give it a fixed width, paddings on the inline edges and center it with margins. and it comes by with Tailwind's default configuration.&lt;/p&gt;




&lt;p&gt;The &lt;code&gt;container&lt;/code&gt; is just a normal &lt;code&gt;div&lt;/code&gt; you can style with CSS. You can give it a fixed width, horizontal padding and center it with margin to allow for more sophisticated CSS styling.&lt;/p&gt;

&lt;p&gt;And it comes by with Tailwind's &lt;a href="https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js" rel="noopener noreferrer"&gt;default configuration&lt;/a&gt; as a component for fixing an element's width to the current breakpoint:&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;container&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;But it comes with no more than the fixed width, which makes the containers neither centered nor having horizontal padding as we used to know with previous CSS frameworks. But since Tailwind is a utility-first CSS framework we have to do something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container px-4 mx-auto"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- ... --&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;By using the previous example, you just had your container fixed in the center with some padding on each side. But what if you needed to change the &lt;code&gt;px-4&lt;/code&gt; to &lt;code&gt;px-6&lt;/code&gt; on your entire project, you will have to find every single container on your project and change manually.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customizing
&lt;/h2&gt;

&lt;p&gt;The ideal way to avoid this issue is by customizing the built-in options of the &lt;code&gt;container&lt;/code&gt; component:&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;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;theme&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="c1"&gt;// To center containers by default&lt;/span&gt;
      &lt;span class="na"&gt;center&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

      &lt;span class="c1"&gt;// To add horizontal padding by default&lt;/span&gt;
      &lt;span class="na"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;spacing.4&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To specify a different padding amount for each breakpoint, use an object to provide a &lt;code&gt;default&lt;/code&gt; value and any breakpoint-specific overrides:&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;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;theme&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="na"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;DEFAULT&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;spacing.4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="na"&gt;sm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;spacing.5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="na"&gt;lg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;spacing.6&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="na"&gt;xl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;spacing.8&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You either use &lt;code&gt;theme&lt;/code&gt; or pass specific values:&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;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;DEFAULT&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1rem&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;sm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2rem&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;lg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;4rem&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;xl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;5rem&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using &lt;code&gt;addComponents&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;For more flexibility with the container, you can just disable it by setting the &lt;code&gt;.container&lt;/code&gt; property to &lt;code&gt;false&lt;/code&gt; in the &lt;code&gt;corePlugins&lt;/code&gt; section of your config file:&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;corePlugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
    &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&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;And then create your custom component from scratch with the needed CSS, using &lt;code&gt;theme&lt;/code&gt; function to get the theme values:&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;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;addComponents&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;theme&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;addComponents&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.container&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="na"&gt;marginInline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;auto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;paddingInline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;spacing.4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="na"&gt;maxWidth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;screens.sm&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;

          &lt;span class="c1"&gt;// Breakpoints&lt;/span&gt;
          &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@screen sm&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="na"&gt;maxWidth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;screens.sm&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;@screen md&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="na"&gt;maxWidth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;screens.md&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;One more benefit you get out of this approach is setting a custom container &lt;code&gt;max-width&lt;/code&gt;, as you can see in my &lt;a href="https://bourhaouta.com/" rel="noopener noreferrer"&gt;personal website&lt;/a&gt; the &lt;code&gt;container&lt;/code&gt; is always small.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using &lt;code&gt;@apply&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;You can also use &lt;code&gt;@apply&lt;/code&gt; inside your components and this is how you can do it:&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;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;addComponents&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;theme&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;addComponents&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.container&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 px-4 mx-auto&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="na"&gt;maxWidth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;screens.sm&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>tutorial</category>
      <category>css</category>
    </item>
    <item>
      <title>I made a Dribbble shots generator</title>
      <dc:creator>Omar Bourhaouta</dc:creator>
      <pubDate>Tue, 26 May 2020 15:40:15 +0000</pubDate>
      <link>https://dev.to/bourhaouta/i-made-a-dribbble-shots-generator-15lm</link>
      <guid>https://dev.to/bourhaouta/i-made-a-dribbble-shots-generator-15lm</guid>
      <description>&lt;p&gt;&lt;a href="https://shooot.bourhaouta.com/" rel="noopener noreferrer"&gt;Shooot&lt;/a&gt; lets you upload your website screenshot to adjust it for a Dribbble shot with background color variants and other features: &lt;a href="https://shooot.bourhaouta.com/" rel="noopener noreferrer"&gt;https://shooot.bourhaouta.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your feedback is needed to get to 1.0.0 version.&lt;br&gt;
&lt;a href="https://github.com/bourhaouta/shot" rel="noopener noreferrer"&gt;Feel free to check the repo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>tailwindcss</category>
      <category>react</category>
      <category>design</category>
    </item>
  </channel>
</rss>
