0.1.2 • Published 8 years ago

postcss-shared-options v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

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.