Skip to content

Instantly share code, notes, and snippets.

@karlhorky
Created August 31, 2012 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karlhorky/3559191 to your computer and use it in GitHub Desktop.
Save karlhorky/3559191 to your computer and use it in GitHub Desktop.
CSS Priority Guide
.component {
@include background(linear-gradient(top, #fff 0%, #ddd 100%)); /* Mixins */
border: none; /* Overriding boilerplate */
margin-top: 20px; /* Affecting layout in relation to previous elements */
background: red; /* Most important styles to visual appearance */
display: inline-block; /* ... to ... */
padding: 2px; /* Least important */
margin-bottom: 10px; /* Relevant to following components */
position: relative; /* Relevant to children */
border: 1px solid rgba(#000, .3); /* Relevant to IE override */
html.lt-ie10 & {
border: 1px solid #ddd; /* IE override */
}
&:pseudoclass {
position: absolute; /* Needs the position: relative above */
}
.component_subcomponent {
&.-extend {} /* Avoid extending subcomponents if possible - extend the main component instead */
}
&.-extend {}
@media (query) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment