A PostCSS plugin for people who prefer to write English properly

栏目: IT技术 · 发布时间: 4年前

内容简介:Pull requests for further translations welcome!Assuming you are using npm to manage dependencies, install

css-properly

PostCSS plugin for people who prefer to write English properly.

.foo {
  colour: black;
  background-colour: lightgrey;
  text-align: centre;
}

Supported translations:

From (Proper) To (American) Rationale
colour color There's a u in "colour"
centre center It's spelled "centre"
capitalise capitalize Don't even get me started
padding-ton padding-top When you're thinking of your favourite bear
z-index z-index It's the same but it's pronounced "zed", not "zee"
behaviour behavior Oh, behave!

Pull requests for further translations welcome!

Usage

As a PostCSS plugin

Assuming you are using npm to manage dependencies, install css-properly with:

npm install --save-dev css-properly

Check your project for existing PostCSS config: postcss.config.js in the project root, "postcss" section in package.json or postcss in bundle config.

If you already use PostCSS, add the plugin to plugins list:

module.exports = {
  plugins: [
+   require('css-properly'),
    require('autoprefixer')
  ]
}

If you do not use PostCSS, add it according to official docs and set this plugin in settings.

As a standalone tool using PostCSS CLI

First, install postcss-cli and css-properly globally:

npm install -g postcss-cli css-properly

Follow your heart:

postcss [input.css] --use css-properly  [-o|--output output.css] [--watch|-w]
  postcss <input.css>... --use css-properly  --dir <output-directory> [--watch|-w]
  postcss <input-directory> --use css-properly  --dir <output-directory> [--watch|-w]
  postcss <input-glob-pattern> --use css-properly  --dir <output-directory> [--watch|-w]
  postcss <input.css>... --use css-properly  --replace

License

MIT


以上所述就是小编给大家介绍的《A PostCSS plugin for people who prefer to write English properly》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

写给大家看的Web设计书

写给大家看的Web设计书

Robin Williams、John Tollett / 苏金国、刘亮 / 人民邮电出版社 / 201005 / 69.00元

在这个网络时代,Web设计几乎已经成为每个人生活的必备技能。如果你想自力更生创建一个网站,或者认为自己的网站在设计上还不尽如人意,希望它看上去更具创意和专业性,那么本书正是为你准备的! 作者Robin和John先采用通俗易懂的方式将有关基础知识娓娓道来,比如Internet、搜索信息、构建简单网页等,然后为我们奉上了精妙的技巧、技术和设计示例来启发大家的设计灵感,比如Web基本设计原则、实现......一起来看看 《写给大家看的Web设计书》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具