logoalt Hacker News

intersticetoday at 11:35 AM0 repliesview on HN

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)