PostCSS Plugins

🌙
手机阅读
本文目录结构

PostCSS Plugins

控制

有两个办法让 PostCSS 的魔法更加直观使用。

譬如,使用 postcss-plugin-context 将一个插件的样式上下文环境限制: :

.css-example.is-test-for-css4-browsers {
  color: gray(255, 50%);
}
@context postcss-preset-env {
  .css-example.is-fallback-for-all-browsers {
    color: gray(255, 50%);
  }
}

或者可以使用 [postcss-use] 直接在 CSS 里启用插件:

@use autoprefixer(browsers: ['last 2 versions']);

:fullscreen a {
  display: flex;
}

打包

  • postcss-utilities includes the most commonly used mixins, shortcuts and helpers to use as @util rules.
  • atcss contains plugins that transform your CSS according to special annotation comments.
  • cssnano contains plugins that optimize CSS size for use in production.
  • oldie contains plugins that transform your CSS for older Internet Explorer compatibility.
  • precss contains plugins that allow you to use Sass-like CSS.
  • rucksack contains plugins to speed up CSS development with new features and shortcuts.
  • level4 contains only plugins that let you write CSS4 without the IE9 fallbacks.
  • short adds and extends numerous shorthand properties.
  • stylelint contains plugins that lint your stylesheets.
  • postcss-hamster for vertical rhythm, typography, modular scale functions.
  • postcss-preset-env lets you convert modern CSS into something most browsers can understand, determining the polyfills you need based on your targeted browsers or runtime environments.
  • postcss-ui-theme gives you syntax sugar and allow you change theme.

面向未来的 CSS 语法

See also [posctss-preset-env] plugins pack to add future CSS syntax by one line of code.

向下兼容

See also oldie plugins pack.

语言扩展

See also precss plugins pack to add them by one line of code.

颜色

图片与字体

网格

优化

See also plugins in modular minifier cssnano.

快捷工具

其它

分析

反馈报告

有趣的项目

AXIHE / 精选资源

浏览全部教程

面试题

学习网站

前端培训
自己甄别

前端书籍

关于朱安邦

我叫 朱安邦,阿西河的站长,在杭州。

以前是一名平面设计师,后来开始接接触前端开发,主要研究前端技术中的JS方向。

业余时间我喜欢分享和交流自己的技术,欢迎大家关注我的 Bilibili

关注我: Github / 知乎

于2021年离开前端领域,目前重心放在研究区块链上面了

我叫朱安邦,阿西河的站长

目前在杭州从事区块链周边的开发工作,机械专业,以前从事平面设计工作。

2014年底脱产在老家自学6个月的前端技术,自学期间几乎从未出过家门,最终找到了满意的前端工作。更多>

于2021年离开前端领域,目前从事区块链方面工作了