@csstools/postcss-mixins
Use mixins in CSS
Last updated 3 months ago by romainmenke .
MIT-0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @csstools/postcss-mixins 
SYNC missed versions from official npm registry.

PostCSS Mixins PostCSS Logo

npm install @csstools/postcss-mixins --save-dev

PostCSS Mixins lets you use @mixin and @apply following CSS Mixins 1.

Several specification aspects of CSS Mixins still need to be settled.
This plugin is only a partial implementation to avoid conflicts with the final specification.

Unsupported:

  • mixin arguments
  • @contents blocks
  • @result blocks
  • layered @mixin declarations
  • mixin overrides
@mixin --foo() {
	color: green;
}

.foo {
	@apply --foo;
}

/* becomes */

.foo {
	color: green;
}

Usage

Add PostCSS Mixins to your project:

npm install postcss @csstools/postcss-mixins --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssMixins = require('@csstools/postcss-mixins');

postcss([
	postcssMixins(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);

Options

preserve

The preserve option determines whether the original notation is preserved. By default, it is not preserved.

postcssMixins({ preserve: true })
@mixin --foo() {
	color: green;
}

.foo {
	@apply --foo;
}

/* becomes */

@mixin --foo() {
	color: green;
}

.foo {
	color: green;
	@apply --foo;
}

Current Tags

  • 1.0.0                                ...           latest (3 months ago)

1 Versions

  • 1.0.0                                ...           3 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |