From c06f7ee0a40255214c477e13d9b956a7e07c2900 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 14 Oct 2023 15:05:55 +0800 Subject: postcss,(plugins): nanocss, postcss-preset-env --- node_modules/css-tree/lib/syntax/node/Selector.js | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 node_modules/css-tree/lib/syntax/node/Selector.js (limited to 'node_modules/css-tree/lib/syntax/node/Selector.js') diff --git a/node_modules/css-tree/lib/syntax/node/Selector.js b/node_modules/css-tree/lib/syntax/node/Selector.js new file mode 100644 index 00000000..3ef44718 --- /dev/null +++ b/node_modules/css-tree/lib/syntax/node/Selector.js @@ -0,0 +1,32 @@ +export const name = 'Selector'; +export const structure = { + children: [[ + 'TypeSelector', + 'IdSelector', + 'ClassSelector', + 'AttributeSelector', + 'PseudoClassSelector', + 'PseudoElementSelector', + 'Combinator', + 'WhiteSpace' + ]] +}; + +export function parse() { + const children = this.readSequence(this.scope.Selector); + + // nothing were consumed + if (this.getFirstListNode(children) === null) { + this.error('Selector is expected'); + } + + return { + type: 'Selector', + loc: this.getLocationFromList(children), + children + }; +} + +export function generate(node) { + this.children(node); +} -- cgit v1.2.3