-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[pigment-css] Fix keyframes
serialize styles error
#41395
Merged
Merged
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
acd39c2
add prettier and init result at first run
siriwatknp bdb1714
run install
siriwatknp 3eb88d9
add support for tagged template call
siriwatknp b217aaf
update keyframes to handle tagged template call
siriwatknp 57404e9
revert
siriwatknp c590dbb
add interpolation support to keyframes
siriwatknp 7e59194
add a comment
siriwatknp baeb88a
remove condition test
siriwatknp 80047c6
extract common functions
siriwatknp bfa524d
restore
siriwatknp b1b83a9
Merge branch 'master' of https://github.com/mui/material-ui into fix/…
siriwatknp 453a101
fix keyframes and split tests
siriwatknp ec88614
remove `only`
siriwatknp 0ec65c9
revert tsconfig change
siriwatknp acce2e3
add babel presets and plugins to resolve modules
siriwatknp 4aec0cb
Merge branch 'master' of https://github.com/mui/material-ui into fix/…
siriwatknp 160d5d3
remove tag-call
siriwatknp 9ad2382
update test output
siriwatknp e973ede
revert keyframes
siriwatknp 845c870
revert testUtil
siriwatknp 6ecf4a8
Merge branch 'master' of https://github.com/mui/material-ui into fix/…
siriwatknp 19d43f7
wip
siriwatknp 5f36e63
update styled tests
siriwatknp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/pigment-react/tests/keyframes/fixtures/keyframes-theme.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { keyframes } from '@pigment-css/react'; | ||
|
||
const green = 'green'; | ||
|
||
const gradientKeyframe = keyframes(({ theme }) => ({ | ||
'0%': { | ||
background: theme.palette.primary.main, | ||
}, | ||
'50%': { | ||
background: green, | ||
}, | ||
'100%': { | ||
background: theme.palette.secondary.main, | ||
}, | ||
})); | ||
|
||
const gradientKeyframe2 = keyframes` | ||
0% { | ||
background: ${({ theme }) => theme.palette.primary.main}; | ||
} | ||
|
||
50% { | ||
background: ${green}; | ||
} | ||
|
||
100% { | ||
background: ${({ theme }) => theme.palette.secondary.main}; | ||
} | ||
`; |
22 changes: 22 additions & 0 deletions
22
packages/pigment-react/tests/keyframes/fixtures/keyframes-theme.output.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@keyframes g2c7x3u { | ||
0% { | ||
background: red; | ||
} | ||
50% { | ||
background: green; | ||
} | ||
100% { | ||
background: blue; | ||
} | ||
} | ||
@keyframes gb35t65 { | ||
0% { | ||
background: red; | ||
} | ||
50% { | ||
background: green; | ||
} | ||
100% { | ||
background: blue; | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/pigment-react/tests/keyframes/fixtures/keyframes-theme.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const gradientKeyframe = 'g2c7x3u'; | ||
const gradientKeyframe2 = 'gb35t65'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/pigment-react/tests/keyframes/fixtures/keyframes.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
const rotateKeyframe = 'r14c1bqo'; | ||
const rotateKeyframe2 = 'r3amm75'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/pigment-react/tests/styled/fixtures/styled-theme.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { styled, keyframes } from '@pigment-css/react'; | ||
|
||
const rotateKeyframe = keyframes({ | ||
from: { | ||
transform: 'rotate(360deg)', | ||
}, | ||
to: { | ||
transform: 'rotate(0deg)', | ||
}, | ||
}); | ||
|
||
const Component = styled.div(({ theme }) => ({ | ||
color: (theme.vars ?? theme).palette.primary.main, | ||
animation: `${rotateKeyframe} 2s ease-out 0s infinite`, | ||
})); | ||
|
||
const SliderRail = styled('span', { | ||
name: 'MuiSlider', | ||
slot: 'Rail', | ||
})` | ||
display: block; | ||
position: absolute; | ||
border-radius: inherit; | ||
background-color: currentColor; | ||
opacity: 0.38; | ||
font-size: ${({ theme }) => (theme.vars ?? theme).size.font.h1}; | ||
`; | ||
|
||
const SliderRail2 = styled.span` | ||
display: block; | ||
opacity: 0.38; | ||
font-size: ${({ theme }) => (theme.vars ?? theme).size.font.h1}; | ||
`; |
28 changes: 28 additions & 0 deletions
28
packages/pigment-react/tests/styled/fixtures/styled-theme.output.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@keyframes r3sp8jf { | ||
from { | ||
transform: rotate(360deg); | ||
} | ||
to { | ||
transform: rotate(0deg); | ||
} | ||
} | ||
.clqufod { | ||
color: red; | ||
animation: r3sp8jf 2s ease-out 0s infinite; | ||
} | ||
.s1fopuc2 { | ||
display: block; | ||
position: absolute; | ||
border-radius: inherit; | ||
background-color: currentColor; | ||
opacity: 0.38; | ||
font-size: 3rem; | ||
} | ||
.s1fopuc2-1 { | ||
font-size: 1.5rem; | ||
} | ||
.s1tggtaa { | ||
display: block; | ||
opacity: 0.38; | ||
font-size: 3rem; | ||
} |
16 changes: 16 additions & 0 deletions
16
packages/pigment-react/tests/styled/fixtures/styled-theme.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { styled as _styled3 } from '@pigment-css/react'; | ||
import { styled as _styled2 } from '@pigment-css/react'; | ||
import { styled as _styled } from '@pigment-css/react'; | ||
import _theme from '@pigment-css/react/theme'; | ||
const Component = /*#__PURE__*/ _styled('div')({ | ||
classes: ['clqufod'], | ||
}); | ||
const SliderRail = /*#__PURE__*/ _styled2('span', { | ||
name: 'MuiSlider', | ||
slot: 'Rail', | ||
})({ | ||
classes: ['s1fopuc2', 's1fopuc2-1'], | ||
}); | ||
const SliderRail2 = /*#__PURE__*/ _styled3('span')({ | ||
classes: ['s1tggtaa'], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition is required to prevent
ILLEGAL_ESCAPE_SEQUENCE_ERROR
from emotion becauseserializeStyles
assumes that[]
is an expression.