Open LeaVerou opened 4 years ago
Also, html
or html body
at the beginning of a selector, to just bump it up a little.
Algorithm:
Walk selectors, and count:
html
or :root
as the first one.:not(#id)
. This is meaningless in terms of selector logic, so it has to be a specificity hack. /^(?=.+--|.+__)[a-z0-9-]+(__[\w-]+)?(--[\w-]+)?$/i
) or descendants and such classes
By specificity hacks I mean selector rewritings or additions with the sole purpose of increasing or decreasing specificity. Things like:
[id=foo]
.foo.foo.foo
:not(#nonexistent) .actual-selector
etcI suppose BEM could also be considered a specificity hack.