Skip to content

Commit 5fee312

Browse files
authored
fix: number token values (#46)
1 parent d3ff01f commit 5fee312

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

packages/language-server/src/tokens/get-token.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const getTokenFromPropValue = (ctx: PandaContext, prop: string, value: st
7070

7171
let color = token.value
7272
// could be a semantic token, so the token.value wouldn't be a color directly, it's actually a CSS variable
73-
if (!isColor(color) && token.value.startsWith('var(--')) {
73+
if (!isColor(color) && typeof token.value === "string" && token.value.startsWith('var(--')) {
7474
const [tokenRef] = ctx.tokens.getReferences(token.originalValue)
7575
if (tokenRef?.value) {
7676
color = tokenRef.value

sandbox/vite/panda.config.ts

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ export default defineConfig({
1717
recipes: {
1818
button,
1919
},
20+
tokens: {
21+
lineHeights: {
22+
normal: { value: 1.4 }
23+
}
24+
},
2025
semanticTokens: {
2126
colors: {
2227
danger: {

sandbox/vite/src/App.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function App() {
3232
margin: '2rem',
3333
padding: '4',
3434
fontSize: '2xl',
35+
lineHeight: 'normal'
3536
})}
3637
>
3738
Hello from Panda !

0 commit comments

Comments
 (0)