POSTCSS Basic Usage

Source: Internet
Author: User

1. POSTCSS Related website

https://www.postcss.com.cn/

https://www.ibm.com/developerworks/cn/web/1604-postcss-css/

2. Introduction

The main function of POSTCSS is only two: the first one is the abstract syntax tree structure (abstract Syntax tree,ast), which parses the CSS into JavaScript, and the second is to invoke the plugin to process the AST and get the result.

POSTCSS is generally not used alone, but integrates with existing build tools . Postcss and mainstream building tools such as Webpack, Grunt, and Gulp can be integrated. After the integration is complete, select and configure the POSTCSS plug-in that meets the functional requirements.

Examples of using the Postcss plugin in Webpack:

 var  Path = require (' path '  = ' app '  './app '  ' bundle.js ' 
        
         /\.css$/
          "style -loader!css-loader!postcss-loader "}"}, Postcss:  function   { return  [Require (' Autoprefixer ' )]; }}
        

Postcss-loader is used to process. css files and add them after Style-loader and Css-loader. An additional Postcss method is used to return the required POSTCSS plug-in. The role of require (' autoprefixer ') is to load the Autoprefixer plugin.

3. Summary

Through the POSTCSS powerful plug-in System , the CSS can be a variety of different conversion and processing, so as far as possible to the tedious and complex work to the program to deal with, and to liberate the developers.

POSTCSS Basic Usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.