How to use the postcss-selector-parser.tag function in postcss-selector-parser

To help you get started, we’ve selected a few postcss-selector-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tivac / modular-css / packages / processor / plugins / values-replace.js View on Github external
selectors.walkTags((tag) => {
            if(!values[tag.value]) {
                return;
            }

            tag.replaceWith(selector.tag(values[tag.value]));
        })
    );
github salesforce / lwc / packages / postcss-plugin-lwc / src / index.js View on Github external
function hostPlaceholder() {
    return selectorParser.tag({ value: HOST_SELECTOR_PLACEHOLDER });
}
github atom / atom / src / style-manager.js View on Github external
selectors.each(selector => {
          const firstNode = selector.nodes[0];
          if (
            context === 'atom-text-editor' &&
            firstNode.type === 'pseudo' &&
            firstNode.value === ':host'
          ) {
            const atomTextEditorElementNode = selectorParser.tag({
              value: 'atom-text-editor'
            });
            firstNode.replaceWith(atomTextEditorElementNode);
          }

          let previousNodeIsAtomTextEditor = false;
          let targetsAtomTextEditorShadow = context === 'atom-text-editor';
          let previousNode;
          selector.each(node => {
            if (targetsAtomTextEditorShadow && node.type === 'class') {
              if (DEPRECATED_SYNTAX_SELECTORS.has(node.value)) {
                node.value = `syntax--${node.value}`;
              }
            } else {
              if (
                previousNodeIsAtomTextEditor &&