-
Notifications
You must be signed in to change notification settings - Fork 564
Contract with ICSS #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@michael-ciniawsky @evilebottnawi |
@TrySound good question, i wonder how other plugins do this, example |
As a workaround we may consider first word in exported value as alias. |
Yeah. It will be semantic contract caz composes classes should be always appended. |
Or we can use separate contract between these plugins via messages. This will let to provide more info. |
Messages contractpostcss-icss-selectors and postcss-icss-keyframespass each defined identifier {
type: 'modules-scoped',
name: string,
value: string
} postcss-icss-values matches scoped values by local keys postcss-icss-valuespasses message for each imported value (TODO: should we pass for all values?) {
type: 'modules-value',
name: string,
value: string
} postcss-icss-selectors skips selector if values has equal value postcss-icss-composespasses each composition pair {
type: 'modules-composed',
name: string,
value: string
} postcss-icss-selectors prepends scoped identifier to matched by name local one This contracts let's plugins rely on each other but still be optional and independent. |
I decide to rely on ICSS contract scheme. Values plugin will use messages to resolve original class names. |
This thread to summarize all contracts between icss plugins
This plugins do not require contracts
Values plugin before selectors and composes plugins
If local identifier already exists
:import
keys then skip scopingValues plugin after selectors and composes pluginValues can't be detected in compound exported values
Composes plugin before selectors plugin
If exported key already exists then apply scoping and replace exported value if present in scoped list
Else add identifier as key and scoped class name as value
Composes plugin after selectors plugin
If exported value contains class name then append composed one
else add class name as key and composed one as value
The text was updated successfully, but these errors were encountered: