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

Update stylis.js dependency to v4 #649

Closed
vladshcherbin opened this issue Aug 5, 2020 · 3 comments · Fixed by #1373
Closed

Update stylis.js dependency to v4 #649

vladshcherbin opened this issue Aug 5, 2020 · 3 comments · Fixed by #1373
Labels
enhancement: proposal 💬 Improvement of current behaviour that needs to be discussed needs: triage 🏷 Issue needs to be checked and prioritized

Comments

@vladshcherbin
Copy link

Describe the enhancement

Since 2.0 is coming, maybe it's not too late to update stylis.js dependency to v4.

Motivation

There might be improvements in different areas as well as breaking changes.

Possible implementations

Update stylis.js and hope tests pass 🙈

Related Issues

#582

@vladshcherbin vladshcherbin added the enhancement: proposal 💬 Improvement of current behaviour that needs to be discussed label Aug 5, 2020
@github-actions github-actions bot added the needs: triage 🏷 Issue needs to be checked and prioritized label Aug 5, 2020
@Anber
Copy link
Collaborator

Anber commented Aug 14, 2020

I've found at least one small BC… 4.0 just doesn't have an API which we used :)
The repo also doesn't have a changelog or something similar, so I think, it's not safe to upgrade it right now.

ludofischer added a commit to ludofischer/linaria that referenced this issue Jan 7, 2021
Fix: callstack#649

Stylis 4 should be safe now since emotion and styled components use it.

BREAKING CHANGE: output CSS might change in some cases, see thysultan/stylis#213
@agriffis
Copy link
Contributor

This might help: thysultan/stylis#213

@agriffis
Copy link
Contributor

It looks like @ludofischer updated his fork to use stylis v4, see commit linked above.

I'd like to see this in linaria proper, especially because stylis v4 fixes bugs I care about:

stylis v3

> const stylis = require('stylis')
> stylis('', '.a { :is(.b) { color: green; } }')
'.a:is(.b){color:green;}'

stylis v4

> const {compile, serialize, stringify} = require('stylis')
> serialize(compile('.a { :is(.b) { color: green; } }'), stringify)
'.a :is(.b){color:green;}'

Note .a:is() versus .a :is(). To get the expected result on stylis v3, you need to constantly include * or & in places where you normally wouldn't need to in something like SASS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement: proposal 💬 Improvement of current behaviour that needs to be discussed needs: triage 🏷 Issue needs to be checked and prioritized
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants