Skip to content
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

Open
threepointone opened this issue May 11, 2017 · 5 comments
Open

stylis #5

threepointone opened this issue May 11, 2017 · 5 comments

Comments

@threepointone
Copy link
Owner

Use stylis as the parser, this will make a runtime version more viable

@thysultan
Copy link

👍

@threepointone
Copy link
Owner Author

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!

@thysultan
Copy link

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'
}

@tkh44
Copy link
Collaborator

tkh44 commented Jun 8, 2017

@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.

@threepointone
Copy link
Owner Author

Not high priority for now.

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

No branches or pull requests

3 participants