Skip to content

Commit

Permalink
fix: number token values
Browse files Browse the repository at this point in the history
  • Loading branch information
koba04 committed May 11, 2024
1 parent d3ff01f commit 117308b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/language-server/src/tokens/get-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const getTokenFromPropValue = (ctx: PandaContext, prop: string, value: st

let color = token.value
// could be a semantic token, so the token.value wouldn't be a color directly, it's actually a CSS variable
if (!isColor(color) && token.value.startsWith('var(--')) {
if (!isColor(color) && typeof token.value === "string" && token.value.startsWith('var(--')) {
const [tokenRef] = ctx.tokens.getReferences(token.originalValue)
if (tokenRef?.value) {
color = tokenRef.value
Expand Down
5 changes: 5 additions & 0 deletions sandbox/vite/panda.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export default defineConfig({
recipes: {
button,
},
tokens: {
lineHeights: {
normal: { value: 1.4 }
}
},
semanticTokens: {
colors: {
danger: {
Expand Down
1 change: 1 addition & 0 deletions sandbox/vite/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function App() {
margin: '2rem',
padding: '4',
fontSize: '2xl',
lineHeight: 'normal'
})}
>
Hello from Panda !
Expand Down

0 comments on commit 117308b

Please sign in to comment.