notes/coc/extensions/node_modules/coc-prettier/node_modules/postcss-html
2021-09-25 02:14:00 -07:00
..
lib added nvim coc config files minus node modules 2021-09-25 02:14:00 -07:00
.npmignore added nvim coc config files minus node modules 2021-09-25 02:14:00 -07:00
LICENSE added nvim coc config files minus node modules 2021-09-25 02:14:00 -07:00
package.json added nvim coc config files minus node modules 2021-09-25 02:14:00 -07:00
README.md added nvim coc config files minus node modules 2021-09-25 02:14:00 -07:00

PostCSS HTML Syntax

NPM version Travis Codecov

PostCSS Syntax for parsing HTML / Markdown / Vue component

Getting Started

First thing's first, install the module:

npm install postcss-html --save-dev

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

Use Cases

var syntax = require('postcss-html');
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
});

Style Transformations

The main use case of this plugin is to apply PostCSS transformations to HTML / Markdown / Vue component. For example, if you need to lint SCSS in *.vue with Stylelint; or you need add vendor prefixes to CSS in *.html with Autoprefixer.

Syntax Infer for Stylesheet Files

When passing a stylesheet file, syntaxe can automatically be inferred from the following file extensions: .less, .sass, .scss and .sss, others will be inferred as CSS.

Custom unknown syntax

var syntax = require('postcss-html');
postcss(plugins).process(html, {
	syntax: syntax({
		stylus: require('postcss-stylus')
	})
}).then(function (result) {
	result.content
});