Replies: 1 comment 2 replies
-
+1. I noticed it's impossible to easily define darker colors based on existing ones. I find it especially useful for active states on buttons. Right now I'm doing something like this for selected colors, but it's impossible to scale for every color :/ @theme {
--color-discord: #5865f2;
--color-discord-dark: oklch(from var(--color-discord) calc(l - 0.05) c h);
} <button class="bg-discord hover:bg-discord/95 active:bg-discord-dark"> I don't think it's possible to use the legacy plugin API unfortunately. I found this function in code, maybe there's a way to create a similar for lightening/darkening colors and submit a PR. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be cool to have a modifier like the opacity modifier, but instead changing the opacity, it would change lightness by using a CSS relative color to modify the original color.
text-accent
becomesvar(--color-accent)
text-accent/50
becomescolor-mix(in oklab, var(--color-accent) 50%, transparent)
text-accent/l10
becomesoklch(from var(--color-accent) calc(l + 10%) c h)
It would be nice to have a theme namespace for lightness values too, so we can define the whole color palette with just the base semantic colors and a few lightness values which can be used with each.
This is similar to #17616
Beta Was this translation helpful? Give feedback.
All reactions