Replies: 2 comments 1 reply
-
const NavButton = styled.button<{ $pos: "prev" | "next" }>`
top: calc(50% - 1.5rem);
border-radius: 5rem;
width: 5rem;
height: 5rem;
font-size: 3rem;
${(p) =>
p.$pos === "prev"
? css`
left: 10px;
`
: css`
right: 10px;
`}
` |
Beta Was this translation helpful? Give feedback.
0 replies
-
oh wait, call me dummas :-) With template-literal turned on, the styled-component example I had given becomes the following. const NavButton = styled("button", {
base: {
top: "calc(50% - 1.5rem)",
borderRadius: "5rem",
width: "5rem",
height: "5rem",
fontSize: "3rem",
// ...
},
variants: {
type: {
prev: {
left: "10px",
},
next: {
right: "10px",
},
},
},
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
If I add
syntax: "template-literal"
to panda.config.ts and runpanda codegen --clean
,./styled-system/css/cva.d.ts
and.mjs
are deleted.I understand that
cva
uses object syntax, but it shouldn't just disappear when you switch to template-literal syntax forcss
right? If it is intended, how should you use recipes?Link to Reproduction
https://stackblitz.com/edit/stackblitz-starters-h6tcy6?file=package.json
Steps to reproduce
Look in
./styled-system/css/
JS Framework
TS
Panda CSS Version
0.5.1
Browser
No response
Operating System
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions