PostCSS WP
PostCSS WP is a PostCSS plugin that allows you to generate WordPress PHP files from CSS files.
This plugin is in a very experimental state.
Source CSS:
@/** * Template Name: Search Results (hard-coded) * * @package JDRF 2015 * @since 0.1.0 */ } } @ } } }} @}
Output PHP:
Welcome to CSS # Processed PHP from footer.scss
Usage
You just need to follow these two steps to use PostCSS WP:
- Add PostCSS to your build tool.
- Add PostCSS WP as a PostCSS process.
npm install postcss-wp --save-dev
Node
Require PostCSS WP directly in your script, being certain to enable Safe Mode.
;
Grunt
Install Grunt PostCSS:
npm install postcss-wp --save-dev
Require PostCSS WP directly in your Gruntfile, being certain to enable Safe Mode:
grunt; grunt;
Options
dest (string): path to the file generated by CSS.
dest: 'foo.php' // output to foo.php