PostCSS plugin to place rules directly at the root
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Latest commit e345e82 Nov 21, 2015
Permalink
Failed to load latest commit information.
test sources Sep 14, 2015
.eslintrc sources Sep 14, 2015
.gitignore remove unnecessary files and add to gitignore Sep 17, 2015
LICENSE Initial commit Sep 14, 2015
README.md fix link Sep 20, 2015
gulpfile.js sources Sep 14, 2015
index.js sources Sep 14, 2015
package.json 0.1.3 Nov 21, 2015

README.md

PostCSS at-root Circle CI

PostCSS plugin to place rules directly at the root node.

The @at-root causes one or more rules to be emitted at the root of the document, rather than being nested beneath their parent selectors:

.parent {
  ...
  @at-root{
    .child {...}
  }
}

Which would produce:

.child { ... }
.parent { ... }

It will play well with postcss @include plugins.
foo.css:

@at-root {
  @viewport { width: device-width; }
}
.foo {
  color: blue;
}

bar.css:

.bar {
  @import "foo.css";
}

Will produce:

@viewport { width: device-width; }

.bar .foo {
  color: blue; 
}

Usage

postcss([ require('postcss-atroot')() ])

See PostCSS docs for examples for your environment.