Cascade Layer Name Parser
Usage
Add Cascade Layer Name Parser to your project:
npm install @csstools/cascade-layer-name-parser @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev
Cascade Layer Name Parser depends on our CSS tokenizer and parser algorithms.
It must be used together with @csstools/css-tokenizer
and @csstools/css-parser-algorithms
.
import { parse } from '@csstools/cascade-layer-name-parser';
const layerNames = parse('layer-name, foo.bar');
layerNames.forEach((layerName) => {
console.log(layerName.name())
console.log(layerName.segments())
});