-
-
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: validation issue when using color opacity modifier in config tok… (
#2326) fix: validation issue when using color opacity modifier in config tokens/semanticTokens
- Loading branch information
Showing
3 changed files
with
84 additions
and
1 deletion.
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,45 @@ | ||
--- | ||
'@pandacss/config': patch | ||
--- | ||
|
||
Fix a false positive with the validation check that reported `Missing token` when using a color opacity modifier in | ||
config `tokens` or `semanticTokens` | ||
|
||
```ts | ||
import { defineConfig } from '@pandacss/dev' | ||
|
||
export default defineConfig({ | ||
validation: 'warn', | ||
conditions: { | ||
light: '.light &', | ||
dark: '.dark &', | ||
}, | ||
theme: { | ||
tokens: { | ||
colors: { | ||
blue: { 500: { value: 'blue' } }, | ||
green: { 500: { value: 'green' } }, | ||
}, | ||
opacity: { | ||
half: { value: 0.5 }, | ||
}, | ||
}, | ||
semanticTokens: { | ||
colors: { | ||
secondary: { | ||
value: { | ||
base: 'red', | ||
_light: '{colors.blue.500/32}', | ||
_dark: '{colors.green.500/half}', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
``` | ||
|
||
Would incorrectly report: | ||
|
||
- [tokens] Missing token: `colors.green.500/half` used in `config.semanticTokens.colors.secondary` | ||
- [tokens] Missing token: `colors.blue.500/32` used in `config.semanticTokens.colors.secondary` |
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