Skip to content

Instantly share code, notes, and snippets.

View earthnoob's full-sized avatar

Johnathan Le earthnoob

View GitHub Profile
@OliverJAsh
OliverJAsh / foo.md
Created December 8, 2017 11:29
Avoiding CSS overrides in responsive components

Avoiding CSS overrides in responsive components

I would like to demonstrate some of the benefits of scoped styles over mobile-first CSS with overrides for wider breakpoints. I'll start by explaining the two approaches, before listing the benefits.

Mobile-first with overrides for wider breakpoints

h2 {
  color: black;
 font-size: 2em;