postcss-syntax

0.0.1 • Public • Published

postcss-syntax

====

NPM version Travis Codecov David

PostCSS auto syntax switch tool

Getting Started

First thing's first, install the module:

npm install postcss-syntax --save-dev

If you want support SCSS/SASS/LESS/SugarSS syntax, you need to install the corresponding module.

Use Cases

const postcss = require('postcss');
const syntax = require('postcss-syntax')({
    processors: [
        {
            test: /\.(?:[sx]?html?|[sx]ht|vue|ux|php)$/i,
            split: 'html',
        },
        {
            test: /\.(?:markdown|md)$/i,
            split: 'markdown',
        },
        {
            test: /\.(?:m?[jt]sx?|es\d*|pac)$/i,
			split: 'styled',
        },
    ],
    css: postcss,
	sass: require('postcss-sass')
	scss: require('postcss-scss')
	less: require('postcss-less')
	sugarss: require('sugarss')
});
postcss(plugins).process(source, { syntax: syntax }).then(function (result) {
	// An alias for the result.css property. Use it with syntaxes that generate non-CSS output.
	result.content
});

Package Sidebar

Install

npm i postcss-syntax@0.0.1

Version

0.0.1

License

MIT

Unpacked Size

13 kB

Total Files

12

Last publish

Collaborators

  • ai
  • gucong