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
stylis #5
Comments
👍 |
yo @thysultan, thanks or showing up! quick question - is it possible for stylis to return the parsed rules as an array, instead all concatenated into a string? This will make it possible to use insertRule. Thanks! |
It is possible with a middleware, ex. function plugin (context, block, line, column, id, length) {
switch (context) {
// executed whenever a block of css is done compiling.
case 5: case 6: rules.push(block);
// or directly interface with insertRulle
// case 5: case 6: styleSheet.insertRule(block, length)
}
} Since it could become a common pattern this could be added to be built into stylis in the V3 rewrite, ex. const rules = [];
stylis.set({
output: rules
})
// rules
[
'selector {...body}'
]
// or
const rules = {};
stylis.set({
output: rules
})
// rules
{
'selector': '...body'
} |
@threepointone do you still want to do this? I want to add keyframes but I think this should be done first if we are going with it. |
Not high priority for now. |
Use stylis as the parser, this will make a runtime version more viable
The text was updated successfully, but these errors were encountered: