Commit 238289a
committed
fix: use var() instead of hsl() wrapper when CSS vars contain OKLCH values
buildTailwindThemeColorsFromCssVars() unconditionally wrapped all CSS
variable references with hsl(), but the CLI now generates OKLCH color
values in index.css. This caused a format conflict where
hsl(var(--primary)) tried to interpret oklch(0.205 0 0) as HSL.
Detect whether the CSS variables contain non-HSL values (oklch, rgb,
hex) and reference them directly via var(--name) instead of wrapping
with hsl(). Existing HSL-based themes continue to use hsl(var(--name))
for backward compatibility.
Fixes #102541 parent 5a67028 commit 238289a
File tree
1 file changed
+18
-5
lines changed- packages/shadcn/src/utils/updaters
1 file changed
+18
-5
lines changedLines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
509 | 522 | | |
510 | 523 | | |
511 | 524 | | |
512 | 525 | | |
513 | 526 | | |
514 | 527 | | |
515 | 528 | | |
516 | | - | |
| 529 | + | |
517 | 530 | | |
518 | | - | |
| 531 | + | |
519 | 532 | | |
520 | 533 | | |
521 | 534 | | |
522 | | - | |
| 535 | + | |
523 | 536 | | |
524 | | - | |
| 537 | + | |
525 | 538 | | |
526 | 539 | | |
527 | 540 | | |
528 | 541 | | |
529 | 542 | | |
530 | 543 | | |
531 | 544 | | |
532 | | - | |
| 545 | + | |
533 | 546 | | |
534 | 547 | | |
535 | 548 | | |
| |||
0 commit comments