The CSS I actually use

Douglas Pereira

I do not have a CSS personality. I have a short list, most of it now in the language instead of in a preprocessor.

Layout

Flex and grid. gap instead of margin collapse tricks. Subgrid when a child must share tracks with a parent — MDN: subgrid is finally the thing we faked with inner grids.

Container queries (@container) for components that should not care about the viewport. A card in a sidebar is not a card on a marketing breakpoint.

Cascade without a fight

@layer for reset, base, components. Utilities last. I stopped playing specificity war. If a component needs a one-off, the one-off lives next to the component.

This site uses Tailwind v4 @theme for tokens and a thin globals.css for code blocks. That split is the same idea as layers: tokens and primitives vs one-off chrome.

Color and type

light-dark() and color-mix() where native is enough. prefers-color-scheme as the default switch; no third theme until someone pays for it. text-wrap: balance on headings, pretty on long body when the engine supports it (CSS Text 4).

h1, h2, h3, h4 { text-wrap: balance; }
a, button {
  cursor: pointer;
  transition: color 200ms ease, text-decoration-color 200ms ease;
}

Focus styles stay visible. outline is not a decoration you delete in the reset.

References