Skip to content

Instantly share code, notes, and snippets.

@nfiniteset
Created April 18, 2017 20:45
Show Gist options
  • Save nfiniteset/3dcaa5799639acaa169440d106407143 to your computer and use it in GitHub Desktop.
Save nfiniteset/3dcaa5799639acaa169440d106407143 to your computer and use it in GitHub Desktop.
Allowed CSS selectors
### ids
Noooooooooooooooo
### tag / element
Only in `base.scss` for resets. Sometimes one must break this rule in order to win specificty fights on form fields.
### class
Use this 98% of the time.
### child (>)
IF YOU MUST nest use this selector. You should need it very seldom if you're SMACSSing right.
### sibling (+)
Highly suspicious. Moving an element should NOT change it's appearance. We want rearraingable, recomposable modules. This goes directly against that principal.
### attribute ([whatever="something"])
You need this to style `input` tags. I'm sceptical of using it to style other things.
### pseudo (:whatever)
You need this in order to style states and pseudo elements. No choice here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment