-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a75d3c
commit bfca706
Showing
22 changed files
with
605 additions
and
15 deletions.
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
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
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
95 changes: 95 additions & 0 deletions
95
packages/pigment-css-react/tests/sx/fixtures/sx-array.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,95 @@ | ||
import { jsx as _jsx } from 'react/jsx-runtime'; | ||
|
||
<div sx={[{ opacity: 1 }]} />; | ||
|
||
<div className="foo" style={{ opacity: 1 }} sx={[{ color: 'red' }, { color: 'green' }]} />; | ||
|
||
function App(props) { | ||
return ( | ||
<SliderRail | ||
{...props} | ||
sx={[ | ||
props.variant === 'secondary' | ||
? { color: props.isRed ? 'red' : 'blue' } | ||
: { backgroundColor: 'blue', color: 'white' }, | ||
(theme) => ({ | ||
border: `1px solid ${theme.palette.primary.main}`, | ||
}), | ||
]} | ||
/> | ||
); | ||
} | ||
|
||
function App2(props) { | ||
return ( | ||
<SliderRail | ||
sx={[ | ||
{ color: 'green' }, | ||
props.variant === 'secondary' && { color: props.isRed ? 'red' : 'blue' }, | ||
]} | ||
className={`foo ${props.className}`} | ||
style={{ | ||
color: 'red', | ||
...props.style, | ||
}} | ||
/> | ||
); | ||
} | ||
|
||
_jsx('div', { | ||
sx: [ | ||
{ | ||
opacity: 1, | ||
}, | ||
], | ||
}); | ||
|
||
_jsx('div', { | ||
className: 'foo', | ||
style: { | ||
opacity: 1, | ||
}, | ||
sx: [ | ||
{ | ||
color: 'red', | ||
}, | ||
{ | ||
color: 'green', | ||
}, | ||
], | ||
}); | ||
|
||
function App3(props) { | ||
return _jsx('div', { | ||
sx: [ | ||
(theme) => ({ | ||
border: `1px solid ${theme.palette.primary.main}`, | ||
}), | ||
props.disabled | ||
? { | ||
opacity: 0.4, | ||
} | ||
: { | ||
color: 'red', | ||
}, | ||
], | ||
children: 'test', | ||
...props, | ||
}); | ||
} | ||
|
||
function App4(props) { | ||
return _jsx('div', { | ||
sx: [ | ||
(theme) => ({ | ||
border: `1px solid ${theme.palette.primary.main}`, | ||
}), | ||
props.variant === 'secondary' && { color: props.isRed ? 'red' : 'blue' }, | ||
], | ||
className: `foo ${props.className}`, | ||
style: { | ||
color: 'red', | ||
...props.style, | ||
}, | ||
}); | ||
} |
49 changes: 49 additions & 0 deletions
49
packages/pigment-css-react/tests/sx/fixtures/sx-array.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,49 @@ | ||
.dnf03uj { | ||
opacity: 1; | ||
} | ||
.dsvwfmp { | ||
color: red; | ||
} | ||
.d121rcfp { | ||
color: green; | ||
} | ||
.schfkcb { | ||
color: var(--schfkcb-0); | ||
} | ||
.s1cp79ho { | ||
background-color: blue; | ||
color: white; | ||
} | ||
.soyt4ij { | ||
border: 1px solid red; | ||
} | ||
.sr48wd1 { | ||
color: green; | ||
} | ||
.s6s70bv { | ||
color: var(--s6s70bv-0); | ||
} | ||
.s1v8upwb { | ||
opacity: 1; | ||
} | ||
.sjtfjpx { | ||
color: red; | ||
} | ||
.s1r80n7h { | ||
color: green; | ||
} | ||
.s1gu7ed8 { | ||
border: 1px solid red; | ||
} | ||
.s1h4vmh2 { | ||
opacity: 0.4; | ||
} | ||
.s1oy2sl1 { | ||
color: red; | ||
} | ||
.s14d8kn5 { | ||
border: 1px solid red; | ||
} | ||
.s1su4mia { | ||
color: var(--s1su4mia-0); | ||
} |
Oops, something went wrong.