Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to change from hex to hsl or other color formats. #5

Open
Blankeos opened this issue Oct 18, 2024 · 0 comments
Open

Add a way to change from hex to hsl or other color formats. #5

Blankeos opened this issue Oct 18, 2024 · 0 comments

Comments

@Blankeos
Copy link

Blankeos commented Oct 18, 2024

For most websites, especially Tailwind, it's ideal to turn the color variables into HSL format.

Because of the flexibility to use classes like: bg-primary-500/20 (primary color but at 50% opacity). This is only possible if the colors are in HSL.

Basically:

/* app.css */
:root {
  --primary: 206 73% 64%
}
// tailwind.config.js
{
  primary: 'hsl(var(--primary) / <alpha-value>)';
}

I mostly learned about this from configuring Shadcn.

I currently use this for conversions: https://www.shadcn-svelte.com/docs/theming. But it'd be cool if there was just a button on your site to do it.
image

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

No branches or pull requests

1 participant