.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / postcss-html / README.md
1 PostCSS HTML Syntax
2 ====
3
4 [![NPM version](https://img.shields.io/npm/v/postcss-html.svg?style=flat-square)](https://www.npmjs.com/package/postcss-html)
5 [![Travis](https://img.shields.io/travis/gucong3000/postcss-html.svg)](https://travis-ci.org/gucong3000/postcss-html)
6 [![Codecov](https://img.shields.io/codecov/c/github/gucong3000/postcss-html.svg)](https://codecov.io/gh/gucong3000/postcss-html)
7
8 <img align="right" width="95" height="95"
9         title="Philosopher’s stone, logo of PostCSS"
10         src="http://postcss.github.io/postcss/logo.svg">
11
12 [PostCSS](https://github.com/postcss/postcss) Syntax for parsing HTML / [Markdown](https://daringfireball.net/projects/markdown/syntax) / [Vue component](https://vue-loader.vuejs.org/)
13
14 ## Getting Started
15
16 First thing's first, install the module:
17
18 ```
19 npm install postcss-html --save-dev
20 ```
21
22 If you want support SCSS/SASS/LESS/SugarSS syntax, you need to install the corresponding module.
23
24 - SCSS: [PostCSS-SCSS](https://github.com/postcss/postcss-scss)
25 - SASS: [PostCSS-SASS](https://github.com/aleshaoleg/postcss-sass)
26 - LESS: [PostCSS-LESS](https://github.com/shellscape/postcss-less)
27 - SugarSS: [SugarSS](https://github.com/postcss/sugarss)
28
29 ## Use Cases
30
31 ```js
32 var syntax = require('postcss-html');
33 postcss(plugins).process(source, { syntax: syntax }).then(function (result) {
34         // An alias for the result.css property. Use it with syntaxes that generate non-CSS output.
35         result.content
36 });
37 ```
38
39 ### Style Transformations
40
41 The main use case of this plugin is to apply PostCSS transformations to HTML / [Markdown](https://daringfireball.net/projects/markdown/syntax) / [Vue component](https://vue-loader.vuejs.org/). For example, if you need to lint SCSS in `*.vue` with [Stylelint](http://stylelint.io/); or you need add vendor prefixes to CSS in `*.html` with [Autoprefixer](https://github.com/postcss/autoprefixer).
42
43 ### Syntax Infer for Stylesheet Files
44
45 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.
46
47 ### Custom unknown syntax
48
49 ```js
50 var syntax = require('postcss-html');
51 postcss(plugins).process(html, {
52         syntax: syntax({
53                 stylus: require('postcss-stylus')
54         })
55 }).then(function (result) {
56         result.content
57 });
58 ```