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

Add stylis middleware support #141

Closed
niksurff opened this issue Mar 1, 2017 · 4 comments
Closed

Add stylis middleware support #141

niksurff opened this issue Mar 1, 2017 · 4 comments

Comments

@niksurff
Copy link

niksurff commented Mar 1, 2017

Should we add stylis middleware support via Babel plugin options that would be passed down to stylis.use?

@giuseppeg
Copy link
Collaborator

I was wondering if it'd make sense to let users define a function to transform the CSS that is passed to Stylis instead. Like:

const userTransform = state.file.opts.transform || (i) => i
transformedCss = transform(
    String(state.jsxId),
    userTransform(css)
)

This will in fact make styled-jsx extensible i.e. people could use SASS, I could drop styled-jsx-postcss etc.
Thoughts? cc @rauchg @nkzawa

@thysultan
Copy link
Contributor

@giuseppeg BTW re: 171 stylis has nesting support out of the box.

@giuseppeg
Copy link
Collaborator

giuseppeg commented Apr 28, 2017

@thysultan yup those are awesome features, I think that if we add support for a single function people can apply Stylis on their own like they would do with anything else (eg. sass or postcss).
IMHO styled-jsx should only scope selectors which is something that I would like to discuss when we get close to v1.0.0.

@giuseppeg
Copy link
Collaborator

Fixed by #291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants