<?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: Ayman Abdi Mohamed</title>
    <description>The latest articles on DEV Community by Ayman Abdi Mohamed (@aymanabdimohamed).</description>
    <link>https://dev.to/aymanabdimohamed</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%2F3721226%2F45e3eaa3-069e-412e-9180-a33d69509d82.jpeg</url>
      <title>DEV Community: Ayman Abdi Mohamed</title>
      <link>https://dev.to/aymanabdimohamed</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aymanabdimohamed"/>
    <language>en</language>
    <item>
      <title>I Built a Tailwind CSS Bloat Scanner — Here's What I Found in My Own Code</title>
      <dc:creator>Ayman Abdi Mohamed</dc:creator>
      <pubDate>Mon, 15 Jun 2026 18:43:08 +0000</pubDate>
      <link>https://dev.to/aymanabdimohamed/i-built-a-tailwind-css-bloat-scanner-heres-what-i-found-in-my-own-code-2fck</link>
      <guid>https://dev.to/aymanabdimohamed/i-built-a-tailwind-css-bloat-scanner-heres-what-i-found-in-my-own-code-2fck</guid>
      <description>&lt;h2&gt;
  
  
  The problem nobody talks about
&lt;/h2&gt;

&lt;p&gt;I was refactoring a client project last week and realized something uncomfortable: I had &lt;strong&gt;47 arbitrary values&lt;/strong&gt; scattered across my components. Things like &lt;code&gt;w-[312px]&lt;/code&gt;, &lt;code&gt;bg-[#fdfdfd]&lt;/code&gt;, &lt;code&gt;text-[14px]&lt;/code&gt;, &lt;code&gt;mt-[12px]&lt;/code&gt; — hardcoded values that should have been theme tokens from the start.&lt;/p&gt;

&lt;p&gt;Every one of those generates a unique CSS rule in production. They don't get deduplicated. They don't benefit from Tailwind's design system. They just silently bloat your bundle.&lt;/p&gt;

&lt;p&gt;So I built a tool to catch them automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  What TailwindTrimmer does
&lt;/h2&gt;

&lt;p&gt;You paste your JSX, TSX, or HTML into the scanner. It:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Extracts&lt;/strong&gt; every Tailwind class from your &lt;code&gt;className&lt;/code&gt; and &lt;code&gt;class&lt;/code&gt; attributes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flags&lt;/strong&gt; arbitrary bracket values that should be theme tokens&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scores&lt;/strong&gt; your overall CSS health (0-100%)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recommends&lt;/strong&gt; specific replacements — not vague advice, actual class swaps like "replace &lt;code&gt;w-[312px]&lt;/code&gt; with &lt;code&gt;w-80&lt;/code&gt;"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The whole thing runs in under a second.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I found in my own code
&lt;/h2&gt;

&lt;p&gt;I pasted one of my dashboard components and scored &lt;strong&gt;38%&lt;/strong&gt;. Five arbitrary values flagged in a single component. The tool caught things I'd been visually skipping for weeks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;w-[312px]&lt;/code&gt; → should be &lt;code&gt;w-80&lt;/code&gt; (320px, close enough and on-scale)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bg-[#fdfdfd]&lt;/code&gt; → should be &lt;code&gt;bg-white&lt;/code&gt; or &lt;code&gt;bg-neutral-50&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;text-[14px]&lt;/code&gt; → should be &lt;code&gt;text-sm&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;text-[#111111]&lt;/code&gt; → should be &lt;code&gt;text-gray-900&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mt-[12px]&lt;/code&gt; → should be &lt;code&gt;mt-3&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these were intentional design decisions. They were lazy one-off values from moving fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack (for the curious)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend:&lt;/strong&gt; FastAPI with regex-based class extraction and scoring&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend:&lt;/strong&gt; React + TypeScript + Tailwind v4 (yes, it eats its own dog food)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hosting:&lt;/strong&gt; Ubuntu VPS with Nginx reverse proxy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No AI, no LLM calls, no external APIs. Pure parsing. That's why it's fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;2 free scans, no signup required:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://tailwindtrimmer.veltro.co.ke" rel="noopener noreferrer"&gt;https://tailwindtrimmer.veltro.co.ke&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;$16 for unlimited if you find it useful.&lt;/p&gt;

&lt;p&gt;I'm actively building this out — next up is duplicate class detection and file upload support. What other checks would save you time? Let me know in the comments.&lt;/p&gt;

</description>
      <category>tailwindcss</category>
      <category>react</category>
      <category>webdev</category>
      <category>css</category>
    </item>
  </channel>
</rss>
