Leading Ampersands for modifiers in Sass: An anti-pattern

For several years now, I’ve been loving a Sass authoring pattern that looks like this:

.class-name {
  ...
  &--modifier {
  // styles
  }
}

Which would compile to:

.class-name { ... }
.class-name--modifier { // styles }

This was great! I loved it because:

  • It was terse
  • It compiled to single class selectors, which kept specificity at bay

Read More1 Comment

Link: Jonathan Snook: “CSS Concerns”

Wow! There’s a lot of good posts going out this week. Jonathan Snook offers up his list of concerns when authoring CSS:

  1. Consistency: How can I maintain consistency in my design and development?
  2. Clarity: How can I make it easier for people to understand what I’ve developed?
  3. Efficiency: How can I speed up development?
  4. Change: How can I make it easier to make changes?
  5. UX: How can I improve the user experience?

It would be worth some time examining your concerns when developing. I hope to take some time to reflect and share mine in a future post.

Link: Ethan Marcotte “On Container Queries”

Ethan Marcotte, coiner of the term “Responsive Design“, weighs in on the need of container queries.

I hope that Ethan lending his prominent voice will revive interest in this topic, and get some movement on getting browser vendors to sign on. There was a lot of interest in the topic a little while ago – including a great A List Apart article by Mat Marquis. However, it doesn’t seem like much has happened since.

It’s 2017 – let’s get this ball rolling!