mirror of
https://github.com/primer/css.git
synced 2025-01-01 18:53:34 +03:00
Better matching
This commit is contained in:
parent
c07e69ae91
commit
08afa167df
@ -9,7 +9,7 @@ const classRegex = /class="([^"]+)"/ig
|
||||
function uniqueSelectors(s) {
|
||||
return s.filter(s => {
|
||||
// remove any selectors with hover states
|
||||
return !s.includes(":") && !s.includes(".")
|
||||
return s.match(/^\.[a-z\-_\s\.]+$/ig)
|
||||
}).map(s => {
|
||||
// split multi-selectors into last class used .foo .bar .baz
|
||||
return s.split(" ").pop()
|
||||
|
Loading…
Reference in New Issue
Block a user