svgo
svgo copied to clipboard
Replace css-select with custom implementation
There are a few benefits of custom implementation
- csstree instead of css-what parser
- 9 less dependecies
- only standard features are supported (css-select has :parent from jquery)
- new implementation allows to get rid of parentNode
Supported features
- [x] Universal selector
- [x] Type selector
- [x] Class selector
- [x] ID selector
- [x]
[attr]
attribute selector - [x]
[attr=value]
attribute selector - [x]
[attr~=value]
attribute selector - [x]
[attr|=value]
attribute selector - [x]
[attr^=value]
attribute selector - [x]
[attr$=value]
attribute selector - [x]
[attr*=value]
attribute selector - [x] Selector list
- [x] Descendant combinator
- [x] Child combinator
- [x] General sibling combinator
- [x] Adjacent sibling combinator
- [ ]
:empty
pseudo class - [ ]
:nth-child
pseudo class - [ ]
:nth-last-child
pseudo class - [ ]
:first-child
pseudo class - [ ]
:last-child
pseudo class - [ ]
:only-child
pseudo class - [ ]
:nth-of-type
pseudo class - [ ]
:nth-last-of-type
pseudo class - [ ]
:first-of-type
pseudo class - [ ]
:last-of-type
pseudo class - [ ]
:only-of-type
pseudo class - [ ]
:has
pseudo class - [ ]
:not
pseudo class - [ ]
:is
and:where
pseudo classes - [ ] other pseudo classes (should be skipped)
- [ ] Pseudo elements (should be skipped)