postcss-constant

PostCSS plugin for the annotation based binding rule set

Usage no npm install needed!

<script type="module">
  import postcssConstant from 'https://cdn.skypack.dev/postcss-constant';
</script>

README

postcss-constant Build Status

PostCSS plugin for the annotation based binding rule set

Installation

$ npm install postcss-constant

Example

// dependencies
var fs = require("fs")
var postcss = require("postcss")
var constant = require("postcss-constant")

// css to be processed
var css = fs.readFileSync("input.css", "utf8")

// process css
var output = postcss()
  .use(constant(css))
  .process(css)
  .css

Using this input.css:

.class {
  /*
   * @constant
   */
  padding: 20px;
}

.class {
  padding: 0;
}

Run error: Cannot cascade .class

License

The MIT License (MIT)

Copyright (c) 2014 Masaaki Morishita