{\itshape Please use only this documented API when working with the parser. Methods not documented here are subject to change at any point.}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22083}{}\doxysection{$<$tt$>$parser$<$/tt$>$ function}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22083}
This is the module\textquotesingle{}s main entry point.


\begin{DoxyCode}{0}
\DoxyCodeLine{const parser = require('postcss-\/selector-\/parser'); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22084}{}\doxysubsection{$<$tt$>$parser(\mbox{[}transform\mbox{]}, \mbox{[}options\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22084}
Creates a new {\ttfamily processor} instance


\begin{DoxyCode}{0}
\DoxyCodeLine{const processor = parser(); }

\end{DoxyCode}


Or, with optional transform function


\begin{DoxyCode}{0}
\DoxyCodeLine{const transform = selectors => \{}
\DoxyCodeLine{    selectors.walkUniversals(selector => \{}
\DoxyCodeLine{        selector.remove();}
\DoxyCodeLine{    \});}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{const processor = parser(transform)}
\DoxyCodeLine{}
\DoxyCodeLine{// Example}
\DoxyCodeLine{const result = processor.processSync('*.class');}
\DoxyCodeLine{// => .class }

\end{DoxyCode}


\href{\#processor}{\texttt{ See processor documentation}}

Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily transform (function)}\+: Provide a function to work with the parsed AST.
\item {\ttfamily options (object)}\+: Provide default options for all calls on the returned {\ttfamily Processor}.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22085}{}\doxysubsection{$<$tt$>$parser.\+attribute(\mbox{[}props\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22085}
Creates a new attribute selector.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.attribute(\{attribute: 'href'\});}
\DoxyCodeLine{// => [href] }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily props (object)}\+: The new node\textquotesingle{}s properties.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22086}{}\doxysubsection{$<$tt$>$parser.\+class\+Name(\mbox{[}props\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22086}
Creates a new class selector.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.className(\{value: 'button'\});}
\DoxyCodeLine{// => .button }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily props (object)}\+: The new node\textquotesingle{}s properties.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22087}{}\doxysubsection{$<$tt$>$parser.\+combinator(\mbox{[}props\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22087}
Creates a new selector combinator.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.combinator(\{value: '+'\});}
\DoxyCodeLine{// => + }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily props (object)}\+: The new node\textquotesingle{}s properties.
\end{DoxyItemize}

Notes\+:
\begin{DoxyItemize}
\item {\bfseries{Descendant Combinators}} The value of descendant combinators created by the parser always just a single space ({\ttfamily \char`\"{} \char`\"{}}). For descendant selectors with no comments, additional space is now stored in {\ttfamily node.\+spaces.\+before}. Depending on the location of comments, additional spaces may be stored in {\ttfamily node.\+raws.\+spaces.\+before}, {\ttfamily node.\+raws.\+spaces.\+after}, or {\ttfamily node.\+raws.\+value}.
\item {\bfseries{Named Combinators}} Although, nonstandard and unlikely to ever become a standard, named combinators like {\ttfamily /deep/} and {\ttfamily /for/} are parsed as combinators. The {\ttfamily node.\+value} is name after being unescaped and normalized as lowercase. The original value for the combinator name is stored in {\ttfamily node.\+raws.\+value}.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22088}{}\doxysubsection{$<$tt$>$parser.\+comment(\mbox{[}props\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22088}
Creates a new comment.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.comment(\{value: '/* Affirmative, Dave. I read you. */'\});}
\DoxyCodeLine{// => /* Affirmative, Dave. I read you. */ }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily props (object)}\+: The new node\textquotesingle{}s properties.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22089}{}\doxysubsection{$<$tt$>$parser.\+id(\mbox{[}props\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22089}
Creates a new id selector.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.id(\{value: 'search'\});}
\DoxyCodeLine{// => \#search }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily props (object)}\+: The new node\textquotesingle{}s properties.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22090}{}\doxysubsection{$<$tt$>$parser.\+nesting(\mbox{[}props\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22090}
Creates a new nesting selector.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.nesting();}
\DoxyCodeLine{// => \& }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily props (object)}\+: The new node\textquotesingle{}s properties.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22091}{}\doxysubsection{$<$tt$>$parser.\+pseudo(\mbox{[}props\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22091}
Creates a new pseudo selector.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.pseudo(\{value: '::before'\});}
\DoxyCodeLine{// => ::before }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily props (object)}\+: The new node\textquotesingle{}s properties.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22092}{}\doxysubsection{$<$tt$>$parser.\+root(\mbox{[}props\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22092}
Creates a new root node.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.root();}
\DoxyCodeLine{// => (empty) }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily props (object)}\+: The new node\textquotesingle{}s properties.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22093}{}\doxysubsection{$<$tt$>$parser.\+selector(\mbox{[}props\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22093}
Creates a new selector node.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.selector();}
\DoxyCodeLine{// => (empty) }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily props (object)}\+: The new node\textquotesingle{}s properties.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22094}{}\doxysubsection{$<$tt$>$parser.\+string(\mbox{[}props\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22094}
Creates a new string node.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.string();}
\DoxyCodeLine{// => (empty) }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily props (object)}\+: The new node\textquotesingle{}s properties.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22095}{}\doxysubsection{$<$tt$>$parser.\+tag(\mbox{[}props\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22095}
Creates a new tag selector.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.tag(\{value: 'button'\});}
\DoxyCodeLine{// => button }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily props (object)}\+: The new node\textquotesingle{}s properties.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22096}{}\doxysubsection{$<$tt$>$parser.\+universal(\mbox{[}props\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22096}
Creates a new universal selector.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.universal();}
\DoxyCodeLine{// => * }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily props (object)}\+: The new node\textquotesingle{}s properties.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22097}{}\doxysection{Node types}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22097}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22098}{}\doxysubsection{$<$tt$>$node.\+type$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22098}
A string representation of the selector type. It can be one of the following; {\ttfamily attribute}, {\ttfamily class}, {\ttfamily combinator}, {\ttfamily comment}, {\ttfamily id}, {\ttfamily nesting}, {\ttfamily pseudo}, {\ttfamily root}, {\ttfamily selector}, {\ttfamily string}, {\ttfamily tag}, or {\ttfamily universal}. Note that for convenience, these constants are exposed on the main {\ttfamily parser} as uppercased keys. So for example you can get {\ttfamily id} by querying {\ttfamily parser.\+ID}.


\begin{DoxyCode}{0}
\DoxyCodeLine{parser.attribute(\{attribute: 'href'\}).type;}
\DoxyCodeLine{// => 'attribute' }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22099}{}\doxysubsection{$<$tt$>$node.\+parent$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22099}
Returns the parent node.


\begin{DoxyCode}{0}
\DoxyCodeLine{root.nodes[0].parent === root; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22100}{}\doxysubsection{$<$tt$>$node.\+to\+String()$<$/tt$>$, $<$tt$>$\+String(node)$<$/tt$>$, or ‘’\textquotesingle{} + node\`{}}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22100}
Returns a string representation of the node.


\begin{DoxyCode}{0}
\DoxyCodeLine{const id = parser.id(\{value: 'search'\});}
\DoxyCodeLine{console.log(String(id));}
\DoxyCodeLine{// => \#search }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22101}{}\doxysubsection{$<$tt$>$node.\+next()$<$/tt$>$ \& $<$tt$>$node.\+prev()$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22101}
Returns the next/previous child of the parent node.


\begin{DoxyCode}{0}
\DoxyCodeLine{const next = id.next();}
\DoxyCodeLine{if (next \&\& next.type !== 'combinator') \{}
\DoxyCodeLine{    throw new Error('Qualified IDs are not allowed!');}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22102}{}\doxysubsection{$<$tt$>$node.\+replace\+With(node)$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22102}
Replace a node with another.


\begin{DoxyCode}{0}
\DoxyCodeLine{const attr = selectors.first.first;}
\DoxyCodeLine{const className = parser.className(\{value: 'test'\});}
\DoxyCodeLine{attr.replaceWith(className); }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily node}\+: The node to substitute the original with.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22103}{}\doxysubsection{$<$tt$>$node.\+remove()$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22103}
Removes the node from its parent node.


\begin{DoxyCode}{0}
\DoxyCodeLine{if (node.type === 'id') \{}
\DoxyCodeLine{    node.remove();}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22104}{}\doxysubsection{$<$tt$>$node.\+clone()$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22104}
Returns a copy of a node, detached from any parent containers that the original might have had.


\begin{DoxyCode}{0}
\DoxyCodeLine{const cloned = parser.id(\{value: 'search'\});}
\DoxyCodeLine{String(cloned);}
\DoxyCodeLine{}
\DoxyCodeLine{// => \#search }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22105}{}\doxysubsection{$<$tt$>$node.\+is\+At\+Position(line, column)$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22105}
Return a {\ttfamily boolean} indicating whether this node includes the character at the position of the given line and column. Returns {\ttfamily undefined} if the nodes lack sufficient source metadata to determine the position.

Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily line}\+: 1-\/index based line number relative to the start of the selector.
\item {\ttfamily column}\+: 1-\/index based column number relative to the start of the selector.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22106}{}\doxysubsection{$<$tt$>$node.\+spaces$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22106}
Extra whitespaces around the node will be moved into {\ttfamily node.\+spaces.\+before} and {\ttfamily node.\+spaces.\+after}. So for example, these spaces will be moved as they have no semantic meaning\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{h1     ,     h2   \{\} }

\end{DoxyCode}


For descendent selectors, the value is always a single space.


\begin{DoxyCode}{0}
\DoxyCodeLine{h1        h2 \{\} }

\end{DoxyCode}


Additional whitespace is found in either the {\ttfamily node.\+spaces.\+before} and {\ttfamily node.\+spaces.\+after} depending on the presence of comments or other whitespace characters. If the actual whitespace does not start or end with a single space, the node\textquotesingle{}s raw value is set to the actual space(s) found in the source.\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22107}{}\doxysubsection{$<$tt$>$node.\+source$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22107}
An object describing the node\textquotesingle{}s start/end, line/column source position.

Within the following CSS, the {\ttfamily .bar} class node ...


\begin{DoxyCode}{0}
\DoxyCodeLine{.foo,}
\DoxyCodeLine{  .bar \{\} }

\end{DoxyCode}


... will contain the following {\ttfamily source} object.


\begin{DoxyCode}{0}
\DoxyCodeLine{source: \{}
\DoxyCodeLine{    start: \{}
\DoxyCodeLine{        line: 2,}
\DoxyCodeLine{        column: 3}
\DoxyCodeLine{    \},}
\DoxyCodeLine{    end: \{}
\DoxyCodeLine{        line: 2,}
\DoxyCodeLine{        column: 6}
\DoxyCodeLine{    \}}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22108}{}\doxysubsection{$<$tt$>$node.\+source\+Index$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22108}
The zero-\/based index of the node within the original source string.

Within the following CSS, the {\ttfamily .baz} class node will have a {\ttfamily source\+Index} of {\ttfamily 12}.


\begin{DoxyCode}{0}
\DoxyCodeLine{.foo, .bar, .baz \{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22109}{}\doxysection{Container types}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22109}
The {\ttfamily root}, {\ttfamily selector}, and {\ttfamily pseudo} nodes have some helper methods for working with their children.\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22110}{}\doxysubsection{$<$tt$>$container.\+nodes$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22110}
An array of the container\textquotesingle{}s children.


\begin{DoxyCode}{0}
\DoxyCodeLine{// Input: h1 h2}
\DoxyCodeLine{selectors.at(0).nodes.length   // => 3}
\DoxyCodeLine{selectors.at(0).nodes[0].value // => 'h1'}
\DoxyCodeLine{selectors.at(0).nodes[1].value // => ' ' }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22111}{}\doxysubsection{$<$tt$>$container.\+first$<$/tt$>$ \& $<$tt$>$container.\+last$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22111}
The first/last child of the container.


\begin{DoxyCode}{0}
\DoxyCodeLine{selector.first === selector.nodes[0];}
\DoxyCodeLine{selector.last === selector.nodes[selector.nodes.length -\/ 1]; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22112}{}\doxysubsection{$<$tt$>$container.\+at(index)$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22112}
Returns the node at position {\ttfamily index}.


\begin{DoxyCode}{0}
\DoxyCodeLine{selector.at(0) === selector.first;}
\DoxyCodeLine{selector.at(0) === selector.nodes[0]; }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily index}\+: The index of the node to return.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22113}{}\doxysubsection{$<$tt$>$container.\+at\+Position(line, column)$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22113}
Returns the node at the source position {\ttfamily index}.


\begin{DoxyCode}{0}
\DoxyCodeLine{selector.at(0) === selector.first;}
\DoxyCodeLine{selector.at(0) === selector.nodes[0]; }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily index}\+: The index of the node to return.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22114}{}\doxysubsection{$<$tt$>$container.\+index(node)$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22114}
Return the index of the node within its container.


\begin{DoxyCode}{0}
\DoxyCodeLine{selector.index(selector.nodes[2]) // => 2 }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily node}\+: A node within the current container.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22115}{}\doxysubsection{$<$tt$>$container.\+length$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22115}
Proxy to the length of the container\textquotesingle{}s nodes.


\begin{DoxyCode}{0}
\DoxyCodeLine{container.length === container.nodes.length }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22116}{}\doxysubsection{$<$tt$>$container$<$/tt$>$ Array iterators}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22116}
The container class provides proxies to certain Array methods; these are\+:


\begin{DoxyItemize}
\item {\ttfamily container.\+map === container.\+nodes.\+map}
\item {\ttfamily container.\+reduce === container.\+nodes.\+reduce}
\item {\ttfamily container.\+every === container.\+nodes.\+every}
\item {\ttfamily container.\+some === container.\+nodes.\+some}
\item {\ttfamily container.\+filter === container.\+nodes.\+filter}
\item {\ttfamily container.\+sort === container.\+nodes.\+sort}
\end{DoxyItemize}

Note that these methods only work on a container\textquotesingle{}s immediate children; recursive iteration is provided by {\ttfamily container.\+walk}.\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22117}{}\doxysubsection{$<$tt$>$container.\+each(callback)$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22117}
Iterate the container\textquotesingle{}s immediate children, calling {\ttfamily callback} for each child. You may return {\ttfamily false} within the callback to break the iteration.


\begin{DoxyCode}{0}
\DoxyCodeLine{let className;}
\DoxyCodeLine{selectors.each((selector, index) => \{}
\DoxyCodeLine{    if (selector.type === 'class') \{}
\DoxyCodeLine{        className = selector.value;}
\DoxyCodeLine{        return false;}
\DoxyCodeLine{    \}}
\DoxyCodeLine{\}); }

\end{DoxyCode}


Note that unlike {\ttfamily Array\#for\+Each()}, this iterator is safe to use whilst adding or removing nodes from the container.

Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily callback (function)}\+: A function to call for each node, which receives {\ttfamily node} and {\ttfamily index} arguments.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22118}{}\doxysubsection{$<$tt$>$container.\+walk(callback)$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22118}
Like {\ttfamily container\#each}, but will also iterate child nodes as long as they are {\ttfamily container} types.


\begin{DoxyCode}{0}
\DoxyCodeLine{selectors.walk((selector, index) => \{}
\DoxyCodeLine{    // all nodes}
\DoxyCodeLine{\}); }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily callback (function)}\+: A function to call for each node, which receives {\ttfamily node} and {\ttfamily index} arguments.
\end{DoxyItemize}

This iterator is safe to use whilst mutating {\ttfamily container.\+nodes}, like {\ttfamily container\#each}.\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22119}{}\doxysubsection{$<$tt$>$container.\+walk$<$/tt$>$ proxies}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22119}
The container class provides proxy methods for iterating over types of nodes, so that it is easier to write modules that target specific selectors. Those methods are\+:


\begin{DoxyItemize}
\item {\ttfamily container.\+walk\+Attributes}
\item {\ttfamily container.\+walk\+Classes}
\item {\ttfamily container.\+walk\+Combinators}
\item {\ttfamily container.\+walk\+Comments}
\item {\ttfamily container.\+walk\+Ids}
\item {\ttfamily container.\+walk\+Nesting}
\item {\ttfamily container.\+walk\+Pseudos}
\item {\ttfamily container.\+walk\+Tags}
\item {\ttfamily container.\+walk\+Universals}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22120}{}\doxysubsection{$<$tt$>$container.\+split(callback)$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22120}
This method allows you to split a group of nodes by returning {\ttfamily true} from a callback. It returns an array of arrays, where each inner array corresponds to the groups that you created via the callback.


\begin{DoxyCode}{0}
\DoxyCodeLine{// (input) => h1 h2>>h3}
\DoxyCodeLine{const list = selectors.first.split(selector => \{}
\DoxyCodeLine{    return selector.type === 'combinator';}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{// (node values) => [['h1', ' '], ['h2', '>>'], ['h3']] }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily callback (function)}\+: A function to call for each node, which receives {\ttfamily node} as an argument.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22121}{}\doxysubsection{$<$tt$>$container.\+prepend(node)$<$/tt$>$ \& $<$tt$>$container.\+append(node)$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22121}
Add a node to the start/end of the container. Note that doing so will set the parent property of the node to this container.


\begin{DoxyCode}{0}
\DoxyCodeLine{const id = parser.id(\{value: 'search'\});}
\DoxyCodeLine{selector.append(id); }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily node}\+: The node to add.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22122}{}\doxysubsection{$<$tt$>$container.\+insert\+Before(old, new)$<$/tt$>$ \& $<$tt$>$container.\+insert\+After(old, new)$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22122}
Add a node before or after an existing node in a container\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{selectors.walk(selector => \{}
\DoxyCodeLine{    if (selector.type !== 'class') \{}
\DoxyCodeLine{        const className = parser.className(\{value: 'theme-\/name'\});}
\DoxyCodeLine{        selector.parent.insertAfter(selector, className);}
\DoxyCodeLine{    \}}
\DoxyCodeLine{\}); }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily old}\+: The existing node in the container.
\item {\ttfamily new}\+: The new node to add before/after the existing node.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22123}{}\doxysubsection{$<$tt$>$container.\+remove\+Child(node)$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22123}
Remove the node from the container. Note that you can also use {\ttfamily node.\+remove()} if you would like to remove just a single node.


\begin{DoxyCode}{0}
\DoxyCodeLine{selector.length // => 2}
\DoxyCodeLine{selector.remove(id)}
\DoxyCodeLine{selector.length // => 1;}
\DoxyCodeLine{id.parent       // undefined }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily node}\+: The node to remove.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22124}{}\doxysubsection{$<$tt$>$container.\+remove\+All()$<$/tt$>$ or $<$tt$>$container.\+empty()$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22124}
Remove all children from the container.


\begin{DoxyCode}{0}
\DoxyCodeLine{selector.removeAll();}
\DoxyCodeLine{selector.length // => 0 }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22125}{}\doxysection{Root nodes}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22125}
A root node represents a comma separated list of selectors. Indeed, all a root\textquotesingle{}s {\ttfamily to\+String()} method does is join its selector children with a \textquotesingle{},\textquotesingle{}. Other than this, it has no special functionality and acts like a container.\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22126}{}\doxysubsection{$<$tt$>$root.\+trailing\+Comma$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22126}
This will be set to {\ttfamily true} if the input has a trailing comma, in order to support parsing of legacy CSS hacks.\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22127}{}\doxysection{Selector nodes}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22127}
A selector node represents a single complex selector. For example, this selector string {\ttfamily h1 h2 h3, \mbox{[}href\mbox{]} $>$ p}, is represented as two selector nodes. It has no special functionality of its own.\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22128}{}\doxysection{Pseudo nodes}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22128}
A pseudo selector extends a container node; if it has any parameters of its own (such as {\ttfamily h1\+:not(h2, h3)}), they will be its children. Note that the pseudo {\ttfamily value} will always contain the colons preceding the pseudo identifier. This is so that both {\ttfamily \+:before} and {\ttfamily \+::before} are properly represented in the AST.\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22129}{}\doxysection{Attribute nodes}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22129}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22130}{}\doxysubsection{$<$tt$>$attribute.\+quoted$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22130}
Returns {\ttfamily true} if the attribute\textquotesingle{}s value is wrapped in quotation marks, false if it is not. Remains {\ttfamily undefined} if there is no attribute value.


\begin{DoxyCode}{0}
\DoxyCodeLine{[href=foo] /* false */}
\DoxyCodeLine{[href='foo'] /* true */}
\DoxyCodeLine{[href="{}foo"{}] /* true */}
\DoxyCodeLine{[href] /* undefined */ }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22131}{}\doxysubsection{$<$tt$>$attribute.\+qualified\+Attribute$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22131}
Returns the attribute name qualified with the namespace if one is given.\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22132}{}\doxysubsection{$<$tt$>$attribute.\+offset\+Of(part)$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22132}
Returns the offset of the attribute part specified relative to the start of the node of the output string. This is useful in raising error messages about a specific part of the attribute, especially in combination with {\ttfamily attribute.\+source\+Index}.

Returns {\ttfamily -\/1} if the name is invalid or the value doesn\textquotesingle{}t exist in this attribute.

The legal values for {\ttfamily part} are\+:


\begin{DoxyItemize}
\item {\ttfamily \char`\"{}ns\char`\"{}} -\/ alias for \char`\"{}namespace\char`\"{}
\item {\ttfamily \char`\"{}namespace\char`\"{}} -\/ the namespace if it exists.
\item {\ttfamily \char`\"{}attribute\char`\"{}} -\/ the attribute name
\item {\ttfamily \char`\"{}attribute\+NS\char`\"{}} -\/ the start of the attribute or its namespace
\item {\ttfamily \char`\"{}operator\char`\"{}} -\/ the match operator of the attribute
\item {\ttfamily \char`\"{}value\char`\"{}} -\/ The value (string or identifier)
\item {\ttfamily \char`\"{}insensitive\char`\"{}} -\/ the case insensitivity flag
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22133}{}\doxysubsection{$<$tt$>$attribute.\+raws.\+unquoted$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22133}
Returns the unquoted content of the attribute\textquotesingle{}s value. Remains {\ttfamily undefined} if there is no attribute value.


\begin{DoxyCode}{0}
\DoxyCodeLine{[href=foo] /* foo */}
\DoxyCodeLine{[href='foo'] /* foo */}
\DoxyCodeLine{[href="{}foo"{}] /* foo */}
\DoxyCodeLine{[href] /* undefined */ }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22134}{}\doxysubsection{$<$tt$>$attribute.\+spaces$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22134}
Like {\ttfamily node.\+spaces} with the {\ttfamily before} and {\ttfamily after} values containing the spaces around the element, the parts of the attribute can also have spaces before and after them. The for each of {\ttfamily attribute}, {\ttfamily operator}, {\ttfamily value} and {\ttfamily insensitive} there is corresponding property of the same nam in {\ttfamily node.\+spaces} that has an optional {\ttfamily before} or {\ttfamily after} string containing only whitespace.

Note that corresponding values in {\ttfamily attributes.\+raws.\+spaces} contain values including any comments. If set, these values will override the {\ttfamily attribute.\+spaces} value. Take care to remove them if changing {\ttfamily attribute.\+spaces}.\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22135}{}\doxysubsection{$<$tt$>$attribute.\+raws$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22135}
The raws object stores comments and other information necessary to re-\/render the node exactly as it was in the source.

If a comment is embedded within the identifiers for the {\ttfamily namespace}, {\ttfamily attribute} or {\ttfamily value} then a property is placed in the raws for that value containing the full source of the propery including comments.

If a comment is embedded within the space between parts of the attribute then the raw for that space is set accordingly.

Setting an attribute\textquotesingle{}s property {\ttfamily raws} value to be deleted.

For now, changing the spaces required also updating or removing any of the raws values that override them.

Example\+: {\ttfamily \mbox{[} /$\ast$before$\ast$/ href /$\ast$ after-\/attr $\ast$/ = /$\ast$ after-\/operator $\ast$/ te/$\ast$inside-\/value$\ast$/st/$\ast$ wow $\ast$/ /$\ast$omg$\ast$/i/$\ast$bbq$\ast$/ /$\ast$whodoesthis$\ast$/\mbox{]}} would parse as\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\{}
\DoxyCodeLine{  attribute: "{}href"{},}
\DoxyCodeLine{  operator: "{}="{},}
\DoxyCodeLine{  value: "{}test"{},}
\DoxyCodeLine{  spaces: \{}
\DoxyCodeLine{    before: '',}
\DoxyCodeLine{    after: '',}
\DoxyCodeLine{    attribute: \{ before: '  ', after: '  ' \},}
\DoxyCodeLine{    operator: \{ after: '  ' \},}
\DoxyCodeLine{    value: \{ after: ' ' \},}
\DoxyCodeLine{    insensitive: \{ after: ' ' \}}
\DoxyCodeLine{  \},}
\DoxyCodeLine{  raws: \{}
\DoxyCodeLine{    spaces: \{}
\DoxyCodeLine{      attribute: \{ before: ' /*before*/ ', after: ' /* after-\/attr */ ' \},}
\DoxyCodeLine{      operator: \{ after: ' /* after-\/operator */ ' \},}
\DoxyCodeLine{      value: \{ after: '/* wow */ /*omg*/' \},}
\DoxyCodeLine{      insensitive: \{ after: '/*bbq*/ /*whodoesthis*/' \}}
\DoxyCodeLine{    \},}
\DoxyCodeLine{    unquoted: 'test',}
\DoxyCodeLine{    value: 'te/*inside-\/value*/st'}
\DoxyCodeLine{  \}}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22136}{}\doxysection{$<$tt$>$\+Processor$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22136}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22137}{}\doxysubsection{$<$tt$>$\+Processor\+Options$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22137}

\begin{DoxyItemize}
\item {\ttfamily lossless} -\/ When {\ttfamily true}, whitespace is preserved. Defaults to {\ttfamily true}.
\item {\ttfamily update\+Selector} -\/ When {\ttfamily true}, if any processor methods are passed a postcss {\ttfamily Rule} node instead of a string, then that Rule\textquotesingle{}s selector is updated with the results of the processing. Defaults to {\ttfamily true}.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22138}{}\doxysubsection{$<$tt$>$process$\vert$process\+Sync(selectors, \mbox{[}options\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22138}
Processes the {\ttfamily selectors}, returning a string from the result of processing.

Note\+: when the {\ttfamily update\+Selector} option is set, the rule\textquotesingle{}s selector will be updated with the resulting string.

{\bfseries{Example\+:}}


\begin{DoxyCode}{0}
\DoxyCodeLine{const parser = require("{}postcss-\/selector-\/parser"{});}
\DoxyCodeLine{const processor = parser();}
\DoxyCodeLine{}
\DoxyCodeLine{let result = processor.processSync(' .class');}
\DoxyCodeLine{console.log(result);}
\DoxyCodeLine{// =>  .class}
\DoxyCodeLine{}
\DoxyCodeLine{// Asynchronous operation}
\DoxyCodeLine{let promise = processor.process(' .class').then(result => \{}
\DoxyCodeLine{    console.log(result)}
\DoxyCodeLine{    // => .class}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{// To have the parser normalize whitespace values, utilize the options}
\DoxyCodeLine{result = processor.processSync('  .class  ', \{lossless: false\});}
\DoxyCodeLine{console.log(result);}
\DoxyCodeLine{// => .class}
\DoxyCodeLine{}
\DoxyCodeLine{// For better syntax errors, pass a PostCSS Rule node.}
\DoxyCodeLine{const postcss = require('postcss');}
\DoxyCodeLine{rule = postcss.rule(\{selector: ' \#foo    > a,  .class  '\});}
\DoxyCodeLine{processor.process(rule, \{lossless: false, updateSelector: true\}).then(result => \{}
\DoxyCodeLine{    console.log(result);}
\DoxyCodeLine{    // => \#foo>a,.class}
\DoxyCodeLine{    console.log("{}rule:"{}, rule.selector);}
\DoxyCodeLine{    // => rule: \#foo>a,.class}
\DoxyCodeLine{\}) }

\end{DoxyCode}


Arguments\+:


\begin{DoxyItemize}
\item {\ttfamily selectors (string$\vert$postcss.Rule)}\+: Either a selector string or a Post\+CSS Rule node.
\item {\ttfamily \mbox{[}options\mbox{]} (object)}\+: Process options
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22139}{}\doxysubsection{$<$tt$>$ast$\vert$ast\+Sync(selectors, \mbox{[}options\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22139}
Like {\ttfamily process()} and {\ttfamily process\+Sync()} but after processing the {\ttfamily selectors} these methods return the {\ttfamily Root} node of the result instead of a string.

Note\+: when the {\ttfamily update\+Selector} option is set, the rule\textquotesingle{}s selector will be updated with the resulting string.\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22140}{}\doxysubsection{$<$tt$>$transform$\vert$transform\+Sync(selectors, \mbox{[}options\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22140}
Like {\ttfamily process()} and {\ttfamily process\+Sync()} but after processing the {\ttfamily selectors} these methods return the value returned by the processor callback.

Note\+: when the {\ttfamily update\+Selector} option is set, the rule\textquotesingle{}s selector will be updated with the resulting string.\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22141}{}\doxysubsection{Error Handling Within Selector Processors}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22141}
The root node passed to the selector processor callback has a method {\ttfamily error(message, options)} that returns an error object. This method should always be used to raise errors relating to the syntax of selectors. The options to this method are passed to postcss\textquotesingle{}s error constructor (\href{http://api.postcss.org/Container.html\#error}{\texttt{ documentation}}).\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22142}{}\doxysubsubsection{Async Error Example}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22142}

\begin{DoxyCode}{0}
\DoxyCodeLine{let processor = (root) => \{}
\DoxyCodeLine{    return new Promise((resolve, reject) => \{}
\DoxyCodeLine{        root.walkClasses((classNode) => \{}
\DoxyCodeLine{            if (/\string^(.*)[-\/\_]/.test(classNode.value)) \{}
\DoxyCodeLine{                let msg = "{}classes may not have underscores or dashes in them"{};}
\DoxyCodeLine{                reject(root.error(msg, \{}
\DoxyCodeLine{                    index: classNode.sourceIndex + RegExp.\$1.length + 1,}
\DoxyCodeLine{                    word: classNode.value}
\DoxyCodeLine{                \}));}
\DoxyCodeLine{            \}}
\DoxyCodeLine{        \});}
\DoxyCodeLine{        resolve();}
\DoxyCodeLine{    \});}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{const postcss = require("{}postcss"{});}
\DoxyCodeLine{const parser = require("{}postcss-\/selector-\/parser"{});}
\DoxyCodeLine{const selectorProcessor = parser(processor);}
\DoxyCodeLine{const plugin = postcss.plugin('classValidator', (options) => \{}
\DoxyCodeLine{    return (root) => \{}
\DoxyCodeLine{        let promises = [];}
\DoxyCodeLine{        root.walkRules(rule => \{}
\DoxyCodeLine{            promises.push(selectorProcessor.process(rule));}
\DoxyCodeLine{        \});}
\DoxyCodeLine{        return Promise.all(promises);}
\DoxyCodeLine{    \};}
\DoxyCodeLine{\});}
\DoxyCodeLine{postcss(plugin()).process(`}
\DoxyCodeLine{.foo-\/bar \{}
\DoxyCodeLine{  color: red;}
\DoxyCodeLine{\}}
\DoxyCodeLine{`.trim(), \{from: 'test.css'\}).catch((e) => console.error(e.toString()));}
\DoxyCodeLine{}
\DoxyCodeLine{// CssSyntaxError: classValidator: ./test.css:1:5: classes may not have underscores or dashes in them}
\DoxyCodeLine{//}
\DoxyCodeLine{// > 1 | .foo-\/bar \{}
\DoxyCodeLine{//     |     \string^}
\DoxyCodeLine{//   2 |   color: red;}
\DoxyCodeLine{//   3 | \} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22143}{}\doxysubsubsection{Synchronous Error Example}\label{md_sfcode_node_modules_postcss_selector_parser_API_autotoc_md22143}

\begin{DoxyCode}{0}
\DoxyCodeLine{let processor = (root) => \{}
\DoxyCodeLine{    root.walkClasses((classNode) => \{}
\DoxyCodeLine{        if (/.*[-\/\_]/.test(classNode.value)) \{}
\DoxyCodeLine{            let msg = "{}classes may not have underscores or dashes in them"{};}
\DoxyCodeLine{            throw root.error(msg, \{}
\DoxyCodeLine{                index: classNode.sourceIndex,}
\DoxyCodeLine{                word: classNode.value}
\DoxyCodeLine{            \});}
\DoxyCodeLine{        \}}
\DoxyCodeLine{    \});}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{const postcss = require("{}postcss"{});}
\DoxyCodeLine{const parser = require("{}postcss-\/selector-\/parser"{});}
\DoxyCodeLine{const selectorProcessor = parser(processor);}
\DoxyCodeLine{const plugin = postcss.plugin('classValidator', (options) => \{}
\DoxyCodeLine{    return (root) => \{}
\DoxyCodeLine{        root.walkRules(rule => \{}
\DoxyCodeLine{            selectorProcessor.processSync(rule);}
\DoxyCodeLine{        \});}
\DoxyCodeLine{    \};}
\DoxyCodeLine{\});}
\DoxyCodeLine{postcss(plugin()).process(`}
\DoxyCodeLine{.foo-\/bar \{}
\DoxyCodeLine{  color: red;}
\DoxyCodeLine{\}}
\DoxyCodeLine{`.trim(), \{from: 'test.css'\}).catch((e) => console.error(e.toString()));}
\DoxyCodeLine{}
\DoxyCodeLine{// CssSyntaxError: classValidator: ./test.css:1:5: classes may not have underscores or dashes in them}
\DoxyCodeLine{//}
\DoxyCodeLine{// > 1 | .foo-\/bar \{}
\DoxyCodeLine{//     |     \string^}
\DoxyCodeLine{//   2 |   color: red;}
\DoxyCodeLine{//   3 | \} }

\end{DoxyCode}
 