-
Notifications
You must be signed in to change notification settings - Fork 12
Consider adding a variable
and apendVariables
option
#15
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
@pascalduez FWIW, the only way I know this would work is if you process and then hoist the output to be at the top-most style tag. It also seems like any time you'd need to share across files you'd need to make every style available in JS, which kind of defeats the purpose of CSS. |
@kevinSuttle Thanks for the feedback. |
Haha. No worries. If you'd like to do a screenshare or something when you're rested, we can. I'd like to invite @MoOx as well. |
I really really really really need this! I'm using webpack v2 + css modules + nextcss for writing my css. Currently however, I have to import my Any idea when you could work on this? |
@mrtnbroder It's on my "priority list", I might need that feature soon as well ;) |
Available as of Just wanted to push a first iteration so that you guys can play a bit with it and give feedback hopefully. @mrtnbroder @AdamJo I guess there will be things to improve/decide, like how it must work with the |
I don't want this to turn into a full blown inJS CSS stuff, but: currently: const themes = {
/* Set names won't be transformed, just `--` will be prepended. */
'toolbar-theme': {
/* Declaration properties can either be camel or kebab case. */
backgroundColor: 'rebeccapurple',
color: 'white',
border: '1px solid green',
},
};
[...]
postcss().use(apply({ sets: themes }))
[...] /* input */
.Toolbar {
@apply --toolbar-theme;
} Maybe we could go with the template trend: const themes = [
`--toolbar-theme: {
background-color: rebeccapurple;
color: white;
border: 1px solid green;
}`,
];
[...]
postcss().use(apply({ sets: themes }))
[...] |
- Implement proper property set overrides - See pascalduez/postcss-apply#10 - Implement from js custom property sets declaration - See pascalduez/postcss-apply#15 - Added a `preserve` option - See pascalduez/postcss-apply#14
https://github.com/postcss/postcss-custom-properties#variables
https://github.com/postcss/postcss-custom-properties#appendvariables
In
postcss-apply
case that would maybe be namedsets
?The text was updated successfully, but these errors were encountered: