- Mastering PostCSS for Web Design
- Alex Libby
- 165字
- 2021-07-14 11:12:23
Adding variable support to PostCSS
The beauty of PostCSS plugins is that most (if not all) can be installed using the same method as PostCSS itself, we can use the package manager of Node.js to handle the process.
We'll start with postcss-css-variables
, which we will use to handle variable support; the source for this plugin is available from https://github.com/MadLittleMods/postcss-css-variables. Let's get it installed:
- Fire up a NodeJS command prompt, then change the working directory to our project area.
- At the command prompt, enter the following command, then press Enter:
npm install --save-dev postcss-css-variables
- If all is well, we should see the results of the installation appear, as shown in this screenshot:
At this point, Node will have also added an entry to the package.json
file for the new plugin. Perfect—we can now put it to good use and switch to using the plugin in place of using SASS. Let's take a look at how to achieve this, as part of the upcoming exercise.
推薦閱讀
- Learning NServiceBus(Second Edition)
- Modular Programming with Python
- DevOps for Networking
- 深入淺出Prometheus:原理、應(yīng)用、源碼與拓展詳解
- Raspberry Pi for Secret Agents(Third Edition)
- OpenCV for Secret Agents
- Java程序員面試算法寶典
- 手把手教你學(xué)C語言
- C語言程序設(shè)計上機(jī)指導(dǎo)與習(xí)題解答(第2版)
- Mastering ROS for Robotics Programming
- 深度學(xué)習(xí):Java語言實現(xiàn)
- Python Data Structures and Algorithms
- 從零開始:C語言快速入門教程
- Java從入門到精通(視頻實戰(zhàn)版)
- Python全棧開發(fā):數(shù)據(jù)分析