Skip to content

Commit

Permalink
Rename dynamic to conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
Mad-Kat committed Dec 19, 2024
1 parent 3dc4425 commit f996816
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .changeset/red-rats-double.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"yak-swc": patch
---

Allow dynamic props in css prop
Enable conditional styling for the css prop
2 changes: 1 addition & 1 deletion packages/example/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default function Home() {
`}
`}
>
Dynamic CSS Prop works if this is green
Conditional CSS Prop works if this is green
</p>
<Inputs />
</main>
Expand Down
32 changes: 16 additions & 16 deletions packages/next-yak/runtime/__tests__/cssPropTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const ComponentWithInterpolatedCSS = () => {
);
};

<<<<<<< HEAD
const Text = styled.p`
font-size: 20px;
font-weight: bold;
Expand All @@ -129,7 +130,7 @@ const StyledComponentWithCSSProp = () => {
</div>;
};

const ComponentWithDynamicCSSButWithoutOwnProps = () => {
const ComponentWithConditionalCSSButWithoutOwnProps = () => {
const x = Math.random() > 0.5;
return (
<div
Expand All @@ -144,7 +145,7 @@ const ComponentWithDynamicCSSButWithoutOwnProps = () => {
);
};

const ComponentWithDynamicCSSVarsButWithoutOwnProps = () => {
const ComponentWithConditionalCSSVarsButWithoutOwnProps = () => {
const x = Math.random() > 0.5;
return (
<div
Expand All @@ -155,7 +156,7 @@ const ComponentWithDynamicCSSVarsButWithoutOwnProps = () => {
);
};

const ComponentWithDynamicCSSWithOwnPropsShouldGenerateTypeError = () => {
const ComponentWithDynamicCSSShouldGenerateTypeError = () => {
return (
<div
// @ts-expect-error - properties not supported
Expand All @@ -174,16 +175,15 @@ const dynamicMixin = css<{ $primary: boolean }>`
`}
`;

const ComponentWithCSSThatUsesDynamicMixinWithOwnPropsShouldGenerateTypeError =
() => {
return (
<div
css={css`
${
// @ts-expect-error - properties not supported
dynamicMixin
}
`}
/>
);
};
const ComponentWithCSSThatUsesDynamicMixinShouldGenerateTypeError = () => {
return (
<div
css={css`
${
// @ts-expect-error - properties not supported
dynamicMixin
}
`}
/>
);
};

0 comments on commit f996816

Please sign in to comment.