-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
8 changed files
with
214 additions
and
12 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
30 changes: 30 additions & 0 deletions
30
packages/yak-swc/yak_swc/tests/fixture/keyframe-animations-function/input.tsx
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,30 @@ | ||
import { styled, css, keyframes } from "next-yak"; | ||
|
||
export const FadeInText = styled.p<{ $reverse?: boolean }>` | ||
${({ $reverse }) => $reverse ? css` | ||
animation: ${fadeOut} 1s ease-in; | ||
` : css` | ||
animation: ${fadeIn} 1s ease-in; | ||
`} | ||
font-size: 18px; | ||
color: #333; | ||
`; | ||
|
||
const fadeIn = keyframes` | ||
from { | ||
opacity: 0; | ||
} | ||
to { | ||
opacity: 1; | ||
} | ||
`; | ||
|
||
const fadeOut = keyframes` | ||
from { | ||
opacity: 1; | ||
} | ||
to { | ||
opacity: 0; | ||
} | ||
`; |
34 changes: 34 additions & 0 deletions
34
packages/yak-swc/yak_swc/tests/fixture/keyframe-animations-function/output.tsx
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,34 @@ | ||
import { styled, css, keyframes } from "next-yak/internal"; | ||
import __styleYak from "./input.yak.module.css!=!./input?./input.yak.module.css"; | ||
export const FadeInText = /*YAK Extracted CSS: | ||
.FadeInText__$reverse { | ||
animation: fadeOut 1s ease-in; | ||
} | ||
.FadeInText__not_$reverse { | ||
animation: fadeIn 1s ease-in; | ||
} | ||
.FadeInText { | ||
font-size: 18px; | ||
color: #333; | ||
} | ||
*/ /*#__PURE__*/ styled.p(__styleYak.FadeInText, ({ $reverse })=>$reverse ? /*#__PURE__*/ css(__styleYak.FadeInText__$reverse) : /*#__PURE__*/ css(__styleYak.FadeInText__not_$reverse)); | ||
const fadeIn = /*YAK Extracted CSS: | ||
@keyframes fadeIn { | ||
from { | ||
opacity: 0; | ||
} | ||
to { | ||
opacity: 1; | ||
} | ||
} | ||
*/ /*#__PURE__*/ keyframes(__styleYak.fadeIn); | ||
const fadeOut = /*YAK Extracted CSS: | ||
@keyframes fadeOut { | ||
from { | ||
opacity: 1; | ||
} | ||
to { | ||
opacity: 0; | ||
} | ||
} | ||
*/ /*#__PURE__*/ keyframes(__styleYak.fadeOut); |
34 changes: 34 additions & 0 deletions
34
packages/yak-swc/yak_swc/tests/fixture/keyframe-animations-object/input.tsx
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,34 @@ | ||
import { styled, css, keyframes } from "next-yak"; | ||
|
||
export const FadeInText = styled.p<{ $reverse?: boolean }>` | ||
${({ $reverse }) => | ||
$reverse | ||
? css` | ||
animation: ${animations.fadeOut} 1s ease-in; | ||
` | ||
: css` | ||
animation: ${animations.fadeIn} 1s ease-in; | ||
`} | ||
font-size: 18px; | ||
color: #333; | ||
`; | ||
|
||
const animations = { | ||
fadeIn: keyframes` | ||
from { | ||
opacity: 0; | ||
} | ||
to { | ||
opacity: 1; | ||
} | ||
`, | ||
fadeOut: keyframes` | ||
from { | ||
opacity: 1; | ||
} | ||
to { | ||
opacity: 0; | ||
} | ||
`, | ||
}; |
36 changes: 36 additions & 0 deletions
36
packages/yak-swc/yak_swc/tests/fixture/keyframe-animations-object/output.tsx
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,36 @@ | ||
import { styled, css, keyframes } from "next-yak/internal"; | ||
import __styleYak from "./input.yak.module.css!=!./input?./input.yak.module.css"; | ||
export const FadeInText = /*YAK Extracted CSS: | ||
.FadeInText__$reverse { | ||
animation: animations_fadeOut 1s ease-in; | ||
} | ||
.FadeInText__not_$reverse { | ||
animation: animations_fadeIn 1s ease-in; | ||
} | ||
.FadeInText { | ||
font-size: 18px; | ||
color: #333; | ||
} | ||
*/ /*#__PURE__*/ styled.p(__styleYak.FadeInText, ({ $reverse })=>$reverse ? /*#__PURE__*/ css(__styleYak.FadeInText__$reverse) : /*#__PURE__*/ css(__styleYak.FadeInText__not_$reverse)); | ||
const animations = { | ||
fadeIn: /*YAK Extracted CSS: | ||
@keyframes animations_fadeIn { | ||
from { | ||
opacity: 0; | ||
} | ||
to { | ||
opacity: 1; | ||
} | ||
} | ||
*/ /*#__PURE__*/ keyframes(__styleYak.animations_fadeIn), | ||
fadeOut: /*YAK Extracted CSS: | ||
@keyframes animations_fadeOut { | ||
from { | ||
opacity: 1; | ||
} | ||
to { | ||
opacity: 0; | ||
} | ||
} | ||
*/ /*#__PURE__*/ keyframes(__styleYak.animations_fadeOut) | ||
}; |