CSS manipulations built on \href{https://github.com/reworkcss/css}{\texttt{ {\ttfamily css}}}, allowing you to automate vendor prefixing, create your own properties, inline images, anything you can imagine!

Please refer to \href{https://github.com/reworkcss/css}{\texttt{ {\ttfamily css}}} for AST documentation and to report parser/stringifier issues.\hypertarget{md_sfcode_node_modules_rework_Readme_autotoc_md24903}{}\doxysection{Installation}\label{md_sfcode_node_modules_rework_Readme_autotoc_md24903}
\begin{DoxyVerb}$ npm install rework
\end{DoxyVerb}
 \hypertarget{md_sfcode_node_modules_rework_Readme_autotoc_md24904}{}\doxysection{Usage}\label{md_sfcode_node_modules_rework_Readme_autotoc_md24904}

\begin{DoxyCode}{0}
\DoxyCodeLine{var rework = require('rework');}
\DoxyCodeLine{var pluginA = require('pluginA');}
\DoxyCodeLine{var pluginB = require('pluginB');}
\DoxyCodeLine{}
\DoxyCodeLine{rework('body \{ font-\/size: 12px; \}', \{ source: 'source.css' \})}
\DoxyCodeLine{  .use(pluginA)}
\DoxyCodeLine{  .use(pluginB)}
\DoxyCodeLine{  .toString(\{ sourcemap: true \}) }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_rework_Readme_autotoc_md24905}{}\doxysection{API}\label{md_sfcode_node_modules_rework_Readme_autotoc_md24905}
\hypertarget{md_sfcode_node_modules_rework_Readme_autotoc_md24906}{}\doxysubsection{rework(code, \mbox{[}options\mbox{]})}\label{md_sfcode_node_modules_rework_Readme_autotoc_md24906}
Accepts a CSS string and returns a new {\ttfamily Rework} instance. The {\ttfamily options} are passed directly to {\ttfamily css.\+parse}.\hypertarget{md_sfcode_node_modules_rework_Readme_autotoc_md24907}{}\doxysubsection{Rework\#use(fn)}\label{md_sfcode_node_modules_rework_Readme_autotoc_md24907}
Use the given plugin {\ttfamily fn}. A rework \char`\"{}plugin\char`\"{} is simply a function accepting the stylesheet root node and the {\ttfamily Rework} instance.\hypertarget{md_sfcode_node_modules_rework_Readme_autotoc_md24908}{}\doxysubsection{Rework\#to\+String(\mbox{[}options\mbox{]})}\label{md_sfcode_node_modules_rework_Readme_autotoc_md24908}
Returns the string representation of the manipulated CSS. The {\ttfamily options} are passed directly to {\ttfamily css.\+stringify}.

Unlike {\ttfamily css.\+stringify}, if you pass {\ttfamily sourcemap\+: true} a string will still be returned, with the source map inlined. Also use {\ttfamily sourcemap\+As\+Object\+: true} if you want the {\ttfamily css.\+stringify} return value.\hypertarget{md_sfcode_node_modules_rework_Readme_autotoc_md24909}{}\doxysection{Plugins}\label{md_sfcode_node_modules_rework_Readme_autotoc_md24909}
Rework has a rich collection of plugins and mixins. Browse all the \href{https://www.npmjs.org/search?q=rework}{\texttt{ Rework plugins}} available on npm.

Plugins of particular note\+:


\begin{DoxyItemize}
\item \href{https://github.com/reworkcss/rework-plugin-at2x/}{\texttt{ at2x}} – serve high resolution images
\item \href{https://github.com/reworkcss/rework-calc}{\texttt{ calc}} – resolve simple {\ttfamily calc()} expressions
\item \href{https://github.com/reworkcss/rework-plugin-colors/}{\texttt{ colors}} – color helpers like {\ttfamily rgba(\#fc0, .5)}
\item \href{https://github.com/reworkcss/rework-plugin-ease/}{\texttt{ ease}} – several additional easing functions
\item \href{https://github.com/reworkcss/rework-inherit/}{\texttt{ extend}} – {\ttfamily extend\+: selector} support
\item \href{https://github.com/reworkcss/rework-plugin-function/}{\texttt{ function}} – user-\/defined CSS functions
\item \href{https://github.com/reworkcss/rework-import}{\texttt{ import}} – read and inline CSS via {\ttfamily @import}
\item \href{https://github.com/reworkcss/rework-plugin-inline}{\texttt{ inline}} – inline assets as data URIs
\item \href{https://github.com/reworkcss/rework-plugin-mixin/}{\texttt{ mixin}} – custom property logic with mixins
\item \href{https://github.com/reworkcss/rework-npm}{\texttt{ npm}} -\/ inline CSS via {\ttfamily @import} using node\textquotesingle{}s module resolver
\item \href{https://github.com/reworkcss/rework-plugin-references/}{\texttt{ references}} – property references like {\ttfamily height\+: @width}
\item \href{https://github.com/reworkcss/rework-plugin-url/}{\texttt{ url}} – rewrite {\ttfamily url()}s with a given function
\item \href{https://github.com/reworkcss/rework-vars/}{\texttt{ variables}} – W3\+C-\/style variables
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_rework_Readme_autotoc_md24910}{}\doxysection{Built with rework}\label{md_sfcode_node_modules_rework_Readme_autotoc_md24910}

\begin{DoxyItemize}
\item \href{https://github.com/visionmedia/styl}{\texttt{ styl}}
\item \href{https://github.com/ianstormtaylor/rework-pure-css}{\texttt{ rework-\/pure-\/css}}
\item \href{https://github.com/suitcss/rework-suit}{\texttt{ rework-\/suit}}
\item \href{https://github.com/topcoat/resin}{\texttt{ resin}}
\item \href{https://github.com/segmentio/myth}{\texttt{ Myth}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_rework_Readme_autotoc_md24911}{}\doxysection{License}\label{md_sfcode_node_modules_rework_Readme_autotoc_md24911}
(The MIT License)

Copyright (c) 2012–2013 TJ Holowaychuk \href{mailto:tj@vision-media.ca}{\texttt{ tj@vision-\/media.\+ca}}

Copyright (c) 2014 Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \textquotesingle{}Software\textquotesingle{}), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions\+:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED \textquotesingle{}AS IS\textquotesingle{}, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 