Skip to content

Commit

Permalink
update styled tests
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Mar 12, 2024
1 parent 19d43f7 commit 5f36e63
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 19 deletions.
30 changes: 25 additions & 5 deletions packages/pigment-react/tests/styled/fixtures/styled.input.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
import { styled } from '@pigment-css/react';
import { styled, keyframes } from '@pigment-css/react';

const Rail = styled('span')`
const rotateKeyframe = keyframes({
from: {
transform: 'rotate(360deg)',
},
to: {
transform: 'rotate(0deg)',
},
});

const Component = styled.div(({ theme }) => ({
color: '#ff5252',
animation: `${rotateKeyframe} 2s ease-out 0s infinite`,
}));

export const SliderRail = styled('span', {
name: 'MuiSlider',
slot: 'Rail',
})`
display: block;
position: absolute;
border-radius: inherit;
background-color: currentColor;
opacity: 0.38;
`;

const Slider = styled('div')`
const SliderRail2 = styled.span`
display: block;
opacity: 0.32;
${Rail} {
opacity: 0.38;
${SliderRail} {
display: none;
}
`;
15 changes: 6 additions & 9 deletions packages/pigment-react/tests/styled/fixtures/styled.output.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@
color: #ff5252;
animation: r1419f2q 2s ease-out 0s infinite;
}
.c1sjy0ja {
color: red;
}
.c1sjy0ja:has(.foo) {
color: blue;
}
.s6hrafw {
.s1sjy0ja {
display: block;
position: absolute;
border-radius: inherit;
background-color: currentColor;
opacity: 0.38;
}
.s1nn157y {
.s6hrafw {
display: block;
opacity: 0.38;
}
.s1nn157y .s6hrafw {
.s6hrafw .s1sjy0ja {
display: none;
}
12 changes: 7 additions & 5 deletions packages/pigment-react/tests/styled/fixtures/styled.output.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { styled as _styled4 } from '@pigment-css/react';
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: ['c1vtarpi'],
});
const Component2 = /*#__PURE__*/ _styled2('div')({
classes: ['c1sjy0ja'],
export const SliderRail = /*#__PURE__*/ _styled2('span', {
name: 'MuiSlider',
slot: 'Rail',
})({
classes: ['s1sjy0ja'],
});
const SliderRail2 = /*#__PURE__*/ _styled4('span')({
classes: ['s1nn157y'],
const SliderRail2 = /*#__PURE__*/ _styled3('span')({
classes: ['s6hrafw'],
});

0 comments on commit 5f36e63

Please sign in to comment.