Comment

Comment by interstice

For a very long time now I've avoided anything other than 1 class per div with style overrides and written with modular rules and 1-2 degrees of separation between label and rules.

Something like

.title {

  @include type-heading;

  &.LARGE {
    @include font-size-large;
  }

  @include onMobile {
    ...something
  }
}

This has the advantage of being naturally rule based and amazingly succinct to write and understand. Needless to say I'm an odd duck, since I almost never see css written this way.

(edit: I forgot how to format code on HN)

parent interstice 3 months ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton