postcss-shared-options

0.1.2 • Public • Published

PostCSS Shared Options

Build Status npm version

PostCSS plugin share variables between different css files with scope.

/* vars.css */
:root {
  --root-width: 25px;
}
@shared --root-width from "./vars.css";
.foo {
    width: var(--root-width);
    height: calc(var(--root-width) * 2);
}
:root {
  --root-width-<md5_hash>: 25px;
}
.foo {
  width: var(--root-width-<md5_hash>);
  height: calc(var(--root-width-<md5_hash>) * 2);
}

Usage

postcss([ require('postcss-shared-options') ])

See PostCSS docs for examples for your environment.

Package Sidebar

Install

npm i postcss-shared-options

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • lexich