PostCSS plugin to unwrap nested rules like how Sass does it.
will be processed to:
Use postcss-current-selector after this plugin if you want to use current selector in properties or variables values.
Use postcss-nested-ancestors before this plugin if you want to reference any ancestor element directly in your selectors with
There is also postcss-nested-props for nested properties like
See PostCSS docs for examples for your environment.
By default, plugin will unwrap only
@document at-rules. You can add your custom at-rules to this list bybubble` option:
By default, plugin will strip out any empty selector generated by intermediate
nesting levels. You can set
true to preserve them.
Will be compiled to:
This is especially useful if you want to export the empty classes with