> All in One 586

Ads

Wednesday, February 18, 2026

Distinguishing “Components” and “Utilities” in Tailwind

Here’s a really quick tip. You can think of Tailwind utilities as components — because you can literally make a card “component” out of Tailwind utilities.

@utility card {
  border: 1px solid black;
  padding: 1rlh;
}
<div class="card"> ... </div>
A plain white rectangular box with a black border.

This blurs the line between “Components” and “Utilities” so we need to better define those terms.

The Great Divide — and The Great Unification

CSS developers often define Components and Utilities like this:

  1. Component = A group of styles
  2. Utility = A single rule

This collective thinking has emerged from the terminologies we have gathered over many years. Unfortunately, they’re not really the right terminologies.

So, let’s take a step back and consider the actual meaning behind these words.

Component means: A thing that’s a part of a larger whole.

1640s, "constituent part or element" (earlier "one of a group of persons," 1560s), from Latin componentem (nominative componens), present participle of componere to put together, to collect a whole from several parts, from com with, together (see com-) + ponere to place (see position (n.)). Related: Componential. Meaning mechanical part of a bicycle, automobile, etc. is from 1896. As an adjective, constituent, entering into the composition of, from 1660s.

Utility means: It’s useful.

late 14th century., utilite, 'fact or character of being useful,' from Old French utilite 'usefulness' (13th century, Modern French utilite), earlier utilitet (12th century.), from Latin utilitatem (nominative utilitas) 'usefulness, serviceableness, profit,' from utilis 'usable,' from uti 'make use of, profit by, take advantage of.'

So…

  • Utilities are Components because they’re still part of a larger whole.
  • Components are Utilities because they’re useful.

The division between Components and Utilities is really more of a marketing effort designed to sell those utility frameworks — nothing more than that.

It. Really. Doesn’t. Matter.

The meaningful divide?

Perhaps the only meaningful divide between Components and Utilities (in the way they’re commonly defined so far) is that we often want to overwrite component styles.

It kinda maps this way:

  • Components: Groups of styles
  • Utilities: Styles used to overwrite component styles.

Personally, I think that’s a very narrow way to define something that actually means “useful.”

Just overwrite the dang style

Tailwind provides us with an incredible feature that allows us to overwrite component styles. To use this feature, you would have to:

  • Write your component styles in a components layer.
  • Overwrite the styles via a Tailwind utility.
@layer components {
  .card {
    border: 1px solid black;
    padding: 1rlh;
  }
}
<div class="card border-blue-500"> ... </div>
A simple rectangular box with a blue border.

But this is a tedious way of doing things. Imagine writing @layer components in all of your component files. There are two problems with that:

  1. You lose the ability to use Tailwind utilities as components
  2. You gotta litter your files with many @layer component declarations — which is one extra indentation and makes the whole CSS a little more difficult to read.

There’s a better way of doing this — we can switch up the way we use CSS layers by writing utilities as components.

@utility card {
  padding: 1rlh; 
  border: 1px solid black;
}

Then, we can overwrite styles with another utility using Tailwind’s !important modifier directly in the HTML:

<div class="card !border-blue-500"> ... </div>

I put together an example over at the Tailwind Playground.

Unorthodox Tailwind

This article comes straight from my course, Unorthodox Tailwind, where you’ll learn to use CSS and Tailwind in a synergistic way. If you liked this, there’s a lot more inside: practical ways to think about and use Tailwind + CSS that you won’t find in tutorials or docs.


Distinguishing “Components” and “Utilities” in Tailwind originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.



from CSS-Tricks https://ift.tt/BHlRXqr
via IFTTT

Tuesday, February 17, 2026

Clear/Wind today!



With a high of F and a low of 24F. Currently, it's 37F and Clear outside.

Current wind speeds: 15 from the West

Pollen: 0

Sunrise: February 17, 2026 at 07:40PM

Sunset: February 18, 2026 at 06:30AM

UV index: 0

Humidity: 34%

via https://ift.tt/T2hUsAI

February 18, 2026 at 10:02AM

Interop 2026

Monday, February 16, 2026

Partly Cloudy today!



With a high of F and a low of 41F. Currently, it's 50F and Clear outside.

Current wind speeds: 10 from the South

Pollen: 0

Sunrise: February 16, 2026 at 07:42PM

Sunset: February 17, 2026 at 06:29AM

UV index: 0

Humidity: 43%

via https://ift.tt/g1Webf9

February 17, 2026 at 10:02AM

Sunday, February 15, 2026

Partly Cloudy today!



With a high of F and a low of 30F. Currently, it's 42F and Clear outside.

Current wind speeds: 9 from the Southwest

Pollen: 0

Sunrise: February 15, 2026 at 07:43PM

Sunset: February 16, 2026 at 06:28AM

UV index: 0

Humidity: 55%

via https://ift.tt/tvDzSjP

February 16, 2026 at 10:02AM

Saturday, February 14, 2026

Clear today!



With a high of F and a low of 26F. Currently, it's 32F and Clear outside.

Current wind speeds: 5 from the Northwest

Pollen: 0

Sunrise: February 14, 2026 at 07:44PM

Sunset: February 15, 2026 at 06:27AM

UV index: 0

Humidity: 45%

via https://ift.tt/1xPrILu

February 15, 2026 at 10:02AM

Friday, February 13, 2026

Showers today!



With a high of F and a low of 36F. Currently, it's 45F and Cloudy outside.

Current wind speeds: 3 from the Southwest

Pollen: 0

Sunrise: February 13, 2026 at 07:45PM

Sunset: February 14, 2026 at 06:26AM

UV index: 0

Humidity: 62%

via https://ift.tt/pcg4h3e

February 14, 2026 at 10:02AM

Distinguishing “Components” and “Utilities” in Tailwind

Here’s a really quick tip. You can think of Tailwind utilities as components — because you can literally make a card “component” out of Ta...