@abcaustralia/postcss-to-camel-case 中文文档教程
postcss-to-camel-case
将所有 CSS 选择器转换为驼峰命名法。 用于将现有项目转换为使用驼峰式选择器以遵循默认的 CSS 模块约定。
Usage
此插件最适合 PostCSS CLI 的替换功能。
npx postcss ./path/to/css/**/*.css --replace --no-map --use @abcaustralia/postcss-to-camel-case
或者使用配置文件:
module.exports = (ctx) => ({
map: ctx.options.map,
parser: ctx.options.parser,
plugins: [require("@abcaustralia/postcss-to-camel-case")],
});
npx postcss ./path/to/css/**/*.css --replace --no-map --config ./postcss.config.js
postcss-to-camel-case
Convert all CSS Selectors into camelCase. Useful for converting an existing project to use camelCase selectors to follow the default CSS Modules conventions.
Usage
This plugin is most useful with the replace feature of PostCSS CLI.
npx postcss ./path/to/css/**/*.css --replace --no-map --use @abcaustralia/postcss-to-camel-case
Or with a config file:
module.exports = (ctx) => ({
map: ctx.options.map,
parser: ctx.options.parser,
plugins: [require("@abcaustralia/postcss-to-camel-case")],
});
npx postcss ./path/to/css/**/*.css --replace --no-map --config ./postcss.config.js