\begin{quote}
Selector parser with built in methods for working with selector strings. \end{quote}
\hypertarget{md_sfcode_node_modules_stylehacks_node_modules_postcss_selector_parser_README_autotoc_md29338}{}\doxysection{Install}\label{md_sfcode_node_modules_stylehacks_node_modules_postcss_selector_parser_README_autotoc_md29338}
With \href{https://npmjs.com/package/postcss-selector-parser}{\texttt{ npm}} do\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{npm install postcss-\/selector-\/parser }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_stylehacks_node_modules_postcss_selector_parser_README_autotoc_md29339}{}\doxysection{Quick Start}\label{md_sfcode_node_modules_stylehacks_node_modules_postcss_selector_parser_README_autotoc_md29339}

\begin{DoxyCode}{0}
\DoxyCodeLine{const parser = require('postcss-\/selector-\/parser');}
\DoxyCodeLine{const transform = selectors => \{}
\DoxyCodeLine{    selectors.walk(selector => \{}
\DoxyCodeLine{        // do something with the selector}
\DoxyCodeLine{        console.log(String(selector))}
\DoxyCodeLine{    \});}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{const transformed = parser(transform).processSync('h1, h2, h3'); }

\end{DoxyCode}


To normalize selector whitespace\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{const parser = require('postcss-\/selector-\/parser');}
\DoxyCodeLine{const normalized = parser().processSync('h1, h2, h3', \{lossless: false\});}
\DoxyCodeLine{// -\/> h1,h2,h3 }

\end{DoxyCode}


Async support is provided through {\ttfamily parser.\+process} and will resolve a Promise with the resulting selector string.\hypertarget{md_sfcode_node_modules_stylehacks_node_modules_postcss_selector_parser_README_autotoc_md29340}{}\doxysection{API}\label{md_sfcode_node_modules_stylehacks_node_modules_postcss_selector_parser_README_autotoc_md29340}
Please see \mbox{\hyperlink{md_sfcode_node_modules_stylehacks_node_modules_postcss_selector_parser_API}{API.md}}.\hypertarget{md_sfcode_node_modules_stylehacks_node_modules_postcss_selector_parser_README_autotoc_md29341}{}\doxysection{Credits}\label{md_sfcode_node_modules_stylehacks_node_modules_postcss_selector_parser_README_autotoc_md29341}

\begin{DoxyItemize}
\item Huge thanks to Andrey Sitnik (@ai) for work on Post\+CSS which helped accelerate this module\textquotesingle{}s development.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_stylehacks_node_modules_postcss_selector_parser_README_autotoc_md29342}{}\doxysection{License}\label{md_sfcode_node_modules_stylehacks_node_modules_postcss_selector_parser_README_autotoc_md29342}
MIT 