No, Utility Classes Aren’t the Same As Inline Styles | frontstuff

This is supposed to be a defence of utility classes …but it’s actually a great explanation of why classes in general are a great mechanism for styling.

I don’t think anyone has ever seriously suggested using inline styles—the actual disagreement is about how ludicrously rigid and wasteful the class names dictated by something like Tailwind are. When people criticise those classes they aren’t advocating for inline styles—they’re advocating for better class names and making more use of the power of the class selector in CSS, not less.

Anyway, if you removed every instance of the word “utility” from this article, it would still work.

No, Utility Classes Aren’t the Same As Inline Styles | frontstuff

Tagged with

Responses

Baldur Bjarnason

“Adactio: Links—No, Utility Classes Aren’t the Same As Inline Styles - frontstuff” “Anyway, if you removed every instance of the word “utility” from this article, it would still work.” adactio.com/links/18141

Juan

Agree with this. When I see a long line of utility classes in the HTML, my eyes and brain hurts almost as much as when I see a long line of inline styles in that same HTML. adactio.com/links/18141

# Posted by Juan on Thursday, May 27th, 2021 at 7:54am

Related links

New CSS that can actually be used in 2024 | Thomasorus

Logical properties, container queries, :has, :is, :where, min(), max(), clamp(), nesting, cascade layers, subgrid, and more.

Tagged with

Introducing TODS – a typographic and OpenType default stylesheet | Clagnut by Richard Rutter

This is a very handy piece of work by Rich:

The idea is to set sensible typographic defaults for use on prose (a column of text), making particular use of the font features provided by OpenType. The main principle is that it can be used as starting point for all projects, so doesn’t include design-specific aspects such as font choice, type scale or layout (including how you might like to set the line-length).

Tagged with

Printing music with CSS grid

Laying out sheet music with CSS grid—sounds extreme until you see it abstracted into a web component.

We need fluid and responsive music rendering for the web!

Tagged with

How would you build Wordle with just HTML and CSS? | Scott Jehl, Web Designer/Developer

This is a great thought exercise in progressive enhancement …that Scott then turns into a real exercise!

Tagged with

Can you feel the rhythm‽ · 13 March 2024

Adam makes a very good point here: the term “vertical rhythm” is quite chauvanistic, unconciously defaulting to top-to-bottom writing modes; the term “logical rhythm” is more universal (and scalable).

Tagged with

Related posts

Displaying HTML web components

You might want to use `display: contents` …maybe.

Making the Patterns Day website

The joy of getting hands-on with HTML and CSS.

Assumption

Separate your concerns.

Control

Trying to understand a different mindset to mine.

Talking about style

The transcript of a talk.