Skip to content

Instantly share code, notes, and snippets.

@daleyjem
Last active August 29, 2015 14:11
Show Gist options
  • Save daleyjem/c82e8a6ed725260aa97c to your computer and use it in GitHub Desktop.
Save daleyjem/c82e8a6ed725260aa97c to your computer and use it in GitHub Desktop.
CSS Lint RegEx Search
ID or Class selectors with capital letter(s):
(\.|#)[^A-Z^\{^\s^/]*[A-Z]+[^\{^\s]*
Hard-coded hex values (3 or more characters):
#[A-Fa-f0-9]{3,}
Hard-coded @media query viewport numbers (i.e. 768px), instead of $variable
@media[^\{]+[0-9]+px[^\{]+\{
No space after colon in "attr:val;"
:\S+;
No extra line break after closing curly brace
(;|\})\n(\.|#)*[^\}^\{^\n]+(\{|(?=\,\n))
Selector embedded inside of a @media query
@media[^\{]+\{[^\}]+(?=\{\s*\n)
ID selectors
#[^\{]+\{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment