postcss-selector-namespace
postcss-selector-namespace copied to clipboard
Migrated to postcss 8; add ability to use multiple namespaces
I realise that this pull request may not be the easiest to review as the code has been migrated to the postcss 8 api.
See: https://evilmartians.com/chronicles/postcss-8-plugin-migration
Also solves: #8
Thank you so much, this is great!
Could you add some tests for the "multiple namespaces" case, I'm not 100% sure I understand the use-case here without examples :)
Could you add some tests for the "multiple namespaces" case, I'm not 100% sure I understand the use-case here without examples :)
Sure.
An example of multiple namespace usage is here:
https://github.com/pryley/site-reviews/blob/41584cd25b7cd5d586ab953d55ef3116eba39950/webpack.mix.js#L76
In that particular example, I am providing multiple namespaces for a plugin style that integrates with Divi, as the selectors are different depending on whether a Divi theme is used, or only the Divi Builder.
For example, with this configuration:
require('postcss-selector-namespace')({namespace: '#et-main-area, #et-boc'})
This:
.component {
/* ... */
}
Becomes this:
#et-main-area .component,
#et-boc .component {
/* ... */
}