You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support for oklab and oklch color functions INSIDE DIRECTIVES #453
I looked into this. The screenshot is the case to reproduce: oklch() colors inside an unknown at-rule block. Colors inside known at-rules like @media or @supports already get decorators.
@plugin"daisyui/theme"{name:"dark";--color-base-100:oklch(16.8%0%0);/* no color decorator */}
This reproduces with 6.3.10 and 7.0.0-next.2. The cause isn't the color code. _parseUnknownAtRule only balances brackets until the block ends, so the whole body of an unknown at-rule becomes one UnknownAtRule node with no children except its name. findDocumentColors has nothing to visit. The same thing explains #423: no completion or hover inside custom directive blocks.
I'd be happy to work on it, but it's a design choice, so I wanted to check first which direction you'd prefer:
Parse the block of an unknown at-rule as declarations and nested rules, falling back to the current token skipping if that fails. This fixes colors for every unknown at-rule (Tailwind's @theme, @utility, daisyUI's @plugin, …), but changes how all unknown at-rules are parsed.
Only for at-rules declared through custom data, e.g. an opt-in flag on the directive's entry. That's narrower and stays predictable, but it wouldn't help users who haven't configured custom data.
Note that #523 is also changing _parseUnknownAtRule right now, so I'd wait for it to land either way.
Activity
kakiuwang-ui commentedon Sep 16, 2026
I looked into this. The screenshot is the case to reproduce:
oklch()colors inside an unknown at-rule block. Colors inside known at-rules like@mediaor@supportsalready get decorators.This reproduces with
6.3.10and7.0.0-next.2. The cause isn't the color code._parseUnknownAtRuleonly balances brackets until the block ends, so the whole body of an unknown at-rule becomes oneUnknownAtRulenode with no children except its name.findDocumentColorshas nothing to visit. The same thing explains #423: no completion or hover inside custom directive blocks.I'd be happy to work on it, but it's a design choice, so I wanted to check first which direction you'd prefer:
@theme,@utility, daisyUI's@plugin, …), but changes how all unknown at-rules are parsed.Note that #523 is also changing
_parseUnknownAtRuleright now, so I'd wait for it to land either way.