assetgraph
Version:
An auto discovery dependency graph based optimization framework for web pages and applications
46 lines (44 loc) • 897 B
JavaScript
const pseudoClasses = [
// pseudo-classes: https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes
'active',
'any',
'checked',
'default',
// 'dir()',
// 'disabled',
'empty',
'enabled',
// 'first',
// 'first-child',
// 'first-of-type',
'fullscreen',
'focus',
'hover',
'indeterminate',
'in-range',
'invalid',
// 'lang()',
// 'last-child',
// 'last-of-type',
// 'left',
'link',
// 'not()',
// 'nth-child()',
// 'nth-last-child()',
// 'nth-last-of-type()',
// 'nth-of-type()',
// 'only-child',
// 'only-of-type',
'optional',
'out-of-range',
'read-only',
'read-write',
// 'required',
// 'right',
// 'root', // It's not practical to treat :root as a pseudo class as it always matches the root element
'scope',
'target',
'valid',
'visited'
];
module.exports = new RegExp(`:(?:${pseudoClasses.join('|')})`, 'gi');