项目作者: bjarneo

项目描述 :
Transpile your CSS bundle to support CSS variables, calc, and future CSS for legacy browsers.
高级语言: JavaScript
项目地址: git://github.com/bjarneo/cessie.git
创建时间: 2019-05-23T05:50:22Z
项目社区:https://github.com/bjarneo/cessie

开源协议:MIT License

下载





cessie logo

cessie

Transpile your CSS bundle to support CSS variables, calc, and future CSS for legacy browsers.

Features

  • Uses PostCSS behind the scenes.
  • Transpiles future CSS by using postcss-preset-env.
  • Transpiles CSS variables and calc by using postcss-custom-properties, and postcss-calc.
  • Can be used for all CSS bundles.
  • Can transpile SCSS, SASS, and LESS.
  • Can minify the output if not already minified.
  • Watch mode.
  • Source map.

Case

Example usage of this CLI would be cases where you don’t have the power, or will to edit/write postcss/webpack config for your application. One of those examples are Create React App.

Create React App:

  1. $ npm run build
  2. $ cat build/static/css/*.chunk.css >> bundle.css
  3. $ cessie bundle.css -o ie11.css

Install

  1. $ npm i -g cessie
  2. // Or use npx
  3. $ npx cessie

Usage

  1. $ cessie inputFile.css -o ie11.css
  1. Usage
  2. $ cessie <input> -o filename.css
  3. Options
  4. --out-file, -o Name of the out file
  5. --minify, -m Minify css. Defaults to true.
  6. --watch, -w Watch for file changes. Defaults to false.
  7. --source-map, -s Generate source map. Defaults to true.
  8. --import-from, -i Import CSS variables from file (https://github.com/postcss/postcss-custom-properties#importfrom)
  9. --export-to, -e Export CSS variables to file (https://github.com/postcss/postcss-custom-properties#exportto)
  10. Examples
  11. $ cessie bundle.css -o ie11.css

Examples

  1. // css/sass/less file
  2. :root {
  3. --color: white;
  4. --padding: 10px;
  5. }
  6. div {
  7. color: var(--color);
  8. padding: calc(var(--padding) * 2);
  9. }
  10. // Run cessie with no minify
  11. $ cessie my.css -o output.css -m false
  12. // output.css
  13. div {
  14. color: white;
  15. padding: 20px;
  16. }

See more examples

Want features?

Please write an issue.

License

MIT © Bjarne Øverli