-
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: parsing values of tokens that look like numbers but arent (start… (
#2245) fix: parsing values of tokens that look like numbers but arent (starts with 0)
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
'@pandacss/parser': patch | ||
'@pandacss/core': patch | ||
--- | ||
|
||
Fix an issue for token names starting with '0' | ||
|
||
```ts | ||
import { defineConfig } from '@pandacss/dev' | ||
|
||
export default defineConfig({ | ||
theme: { | ||
tokens: { | ||
spacing: { | ||
'025': { | ||
value: '0.125rem', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
``` | ||
|
||
and then using it like | ||
|
||
```ts | ||
css({ margin: '025' }) | ||
``` | ||
|
||
This would not generate the expected CSS because the parser would try to parse `025` as a number (`25`) instead of | ||
keeping it as a string. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters