PostCSS Advanced Variables 项目教程
postcss-advanced-variables项目地址:https://gitcode.com/gh_mirrors/po/postcss-advanced-variables
1. 项目的目录结构及介绍
postcss-advanced-variables/
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── index.js
├── lib/
│ ├── on-comment.js
│ ├── on-variable.js
│ ├── on-atrule.js
│ ├── on-decl.js
│ ├── on-rule.js
│ ├── postcss-advanced-variables.js
│ └── postcss-plugin-utilities.js
├── package.json
└── test/
├── basic.css
├── basic.expect.css
├── basic.import.css
├── basic.import.expect.css
├── basic.js
├── basic.variables.css
├── basic.variables.expect.css
├── basic.variables.import.css
├── basic.variables.import.expect.css
├── basic.variables.js
├── basic.variables.plugin.js
├── basic.variables.plugin.expect.css
├── basic.variables.plugin.import.css
├── basic.variables.plugin.import.expect.css
├── basic.variables.plugin.js
└── basic.variables.plugin.js
目录结构介绍
CHANGELOG.md
: 记录项目的更新日志。CONTRIBUTING.md
: 贡献指南,指导如何为项目贡献代码。LICENSE.md
: 项目的许可证信息。README.md
: 项目的主文档,包含项目的基本信息和使用说明。index.js
: 项目的入口文件。lib/
: 包含项目的主要功能实现文件。on-comment.js
: 处理注释的模块。on-variable.js
: 处理变量的模块。on-atrule.js
: 处理 at-rule 的模块。on-decl.js
: 处理声明的模块。on-rule.js
: 处理规则的模块。postcss-advanced-variables.js
: 主模块,整合其他模块的功能。postcss-plugin-utilities.js
: 插件工具模块。
package.json
: 项目的配置文件,包含依赖、脚本等信息。test/
: 包含项目的测试文件和测试用例。
2. 项目的启动文件介绍
项目的启动文件是 index.js
,它导入了 lib/postcss-advanced-variables.js
模块,并将其作为 PostCSS 插件使用。
'use strict';
const postcssAdvancedVariables = require('./lib/postcss-advanced-variables');
module.exports = postcssAdvancedVariables;
启动文件功能
- 导入
postcss-advanced-variables
模块。 - 将该模块作为 PostCSS 插件导出。
3. 项目的配置文件介绍
项目的配置文件是 package.json
,它包含了项目的基本信息、依赖、脚本等。
{
"name": "postcss-advanced-variables",
"version": "3.0.0",
"description": "Use Sass-like variables, conditionals, and iterators in CSS",
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
"license": "CC0-1.0",
"repository": "jonathantneal/postcss-advanced-variables",
"homepage": "https://github.com/jonathantneal/postcss-advanced-variables#readme",
"bugs": "https://github.com/jonathantneal/postcss-advanced-variables/issues",
"main": "index.js",
"files": [
"index.js",
"lib"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"postcss": "^7.0.14",
"postcss-value-parser": "^3.3.1"
},
"devDependencies": {
"eslint": "^5.15.1",
"eslint-config-dev": "^2.0.0"
},
"
postcss-advanced-variables项目地址:https://gitcode.com/gh_mirrors/po/postcss-advanced-variables