Skip to main content

r/csshelp


Responsive font sizes
Responsive font sizes

I came across the below, when searching for the best way to make sure I get font sizes to be responsive. I always thought it better to use %'s because that would auto adjust. Have I got that right?

Consider Using em or rem Units

While px is perfectly fine and widely used, defining your breakpoints in em or rem (e.g., 48em instead of 768px) is excellent for accessibility. If a user increases their browser's default text size, em-based breakpoints will scale accordingly, preventing your layout from breaking.


Advertisement: All eyes on Wegovy® pill. Talk to your prescriber today.
All eyes on Wegovy® pill. Talk to your prescriber today.

See the following links for: Medication Guide & Safety Information

media poster


An opinionated, zero-runtime CSS setup built on @layer and custom properties
An opinionated, zero-runtime CSS setup built on @layer and custom properties

I kept hitting the same friction with CSS tooling on real projects - CSS-in-JS adds runtime, CSS Modules give you hashes but no cascade control, and utility-first gets painful once you have a genuinely custom UI. So I leaned into native CSS instead and tried to formalize the approach into something repeatable.

The whole thing is built on cascade layers. One declared order:

 base, utils, components, pages, component-overrides, user-overrides;

Higher layers always win, so overrides and theming stop being a specificity/!important fight. On top of that it's just:

  • styling via classes + CSS custom properties for dynamic values (no inline styles, so everything stays in the cascade).

  • co-located component CSS (tree-shakeable).

  • design tokens derived from a single base file.

  • a plain ComponentName--element naming convention. real class names, no generated hashes.

Wrote it up here if you want the details: https://cascadekit.io

it's my own project sharing for feedback, not trying to sell anything :]

upvotes comments