Skip to content

Conversation

@pryley
Copy link

@pryley pryley commented Jan 22, 2021

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

@pryley pryley changed the title Migrated to postcss 8; includes ability to use multiple namespaces Migrated to postcss 8; add ability to use multiple namespaces Jan 22, 2021
@topaxi
Copy link
Owner

topaxi commented Jan 22, 2021

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 :)

@pryley
Copy link
Author

pryley commented Jan 22, 2021

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 {
    /* ... */
}

Since not everyone uses a custom line-height in the editor instead of inserting line breaks for clarity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants