You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've created two themes primary and secondary, the tokens for both those themes seem to be getting merged to produce valid TypeScript variables to use in recipes. However, textStyles doesn't seem to be available unless it's declared on the default theme. I'm trying to avoid producing a default theme and using static themes.
The workaround seems to be adding textStyles to the theme, but I'm wondering if I'm doing something wrong.
exportconsttextStyles=defineTextStyles({body: {description: 'The body text style - used in paragraphs',value: {fontFamily: 'Inter',fontWeight: '500',fontSize: '16px',lineHeight: '24px',letterSpacing: '0',textDecoration: 'None',textTransform: 'None'}}})constdemoPreset=definePreset({name: 'demo',theme: {},themes: {primary: {tokens: {colors: {blue: {value: 'blue'}}},
textStyles
},secondary: {tokens: {colors: {blue: {value: 'blue'}}},
textStyles
},},staticCss: {themes: ['primary','secondary']}});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've created two themes
primary
andsecondary
, the tokens for both those themes seem to be getting merged to produce valid TypeScript variables to use in recipes. However,textStyles
doesn't seem to be available unless it's declared on the defaulttheme
. I'm trying to avoid producing a default theme and using static themes.The workaround seems to be adding
textStyles
to thetheme
, but I'm wondering if I'm doing something wrong.https://play.panda-css.com/bhoffmZca0
Beta Was this translation helpful? Give feedback.
All reactions