Skip to content

color: apply /opacity to ring colours on var-ref themes#169

Open
samoht wants to merge 1 commit into
mainfrom
ring-color-opacity
Open

color: apply /opacity to ring colours on var-ref themes#169
samoht wants to merge 1 commit into
mainfrom
ring-color-opacity

Conversation

@samoht

@samoht samoht commented Jul 26, 2026

Copy link
Copy Markdown
Owner

On a theme that binds palette colours to var references (no concrete hex in the scheme), ring-blue-500/50, inset-ring-*/N, and ring-offset-*/N dropped the /opacity modifier and emitted --tw-ring-color: var(--color-blue-500) at full opacity, while bg/text/border applied it.

Color.hex_alpha_color now converts the colour through oklch in that case (the same path color_with_opacity_style already uses for bg/text/border), so the ring family applies the alpha. Colours the scheme resolves to a concrete hex are unaffected.

hex_alpha_color returned None when the scheme binds a palette colour to a
var reference rather than a concrete hex, so ring/inset-ring/ring-offset
dropped the /opacity modifier and emitted the ring colour at full opacity.
Convert through oklch in that case, matching color_with_opacity_style, so
ring-blue-500/50 applies its alpha like bg/text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant