Skip to content

Instantly share code, notes, and snippets.

@andreortiz82
Last active March 20, 2021 21:25
Show Gist options
  • Save andreortiz82/d0b20cb33f45ee06251521739d8cfa0e to your computer and use it in GitHub Desktop.
Save andreortiz82/d0b20cb33f45ee06251521739d8cfa0e to your computer and use it in GitHub Desktop.
// Atomic CSS
// Small, immutable and explicitly named utility classes.
.bg-red5 { backgound: $red5; }
.text-align-center { text-align: center; }
.padding-bottom-xl { padding-bottom: #{$size-xl}px; }
// Block Element Modifier
// Highly verbose and explicitly named classes.
.o-my-widget {
backgound: $red5;
padding-bottom: #{$size-xl}px;
&__title {
text-align: center;
}
}
// Object Oriented CSS
// Single responsibility and inheritance. Should reflect the shape of the DOM.
.my-widget {
backgound: $red5;
padding-bottom: #{$size-xl}px;
h2 {
text-align: center;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment