-
Notifications
You must be signed in to change notification settings - Fork 1
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
Opacity #9
Comments
Thank you for the feedback :) I'm glad you find the plugin useful! It's not something that we were originally intending to support but I can have a look into this. What would be the use-case / preferred syntax to introduce opacity just to make sure I've understood the request correctly |
I would imagine the syntax to be the same as other Tailwind colors, e. g. Since the plugin is using the Opacity is a generally used feature. Off the top of my mind I'm thinking of semi-transparent modal overlays and other semi-transparent-backgrounds, disabled buttons and certain text and icon effects. Certainly it's possible to achieve transparency with the |
I see what you're saying :) There are currently both variants in the Allowing users to set the opacity value explicitly (tailwind style) will be more consistent with tailwind's behaviour but deviate somewhat from Radix's original behaviour. For example with the color amber the package has both
Also note that the hsl component between amber-1200 and amberA-1200 are not the same. Would the proposal entail:
|
Before this plugin I have used other ways to add Radix colors to Tailwind, but have never touched the
However, I'm cautious about this behavior, as it raises concerns about deeply nested elements, where semi-transparent backgrounds can unexpectedly blend into unintended colors. Perhaps I'm mistaken, and if so, I kindly ask you to enlighten me. While styling a website with Tailwind, I prefer not to be concerned with the underlying configuration, like which color spaces I'm working with, or that I have to add a Tailwind already supports the simple and predictable Granted, that creates the issue that then the alpha variants would most likely be expected to support the same behavior. That could be achieved with something like amberLightA: {
100: 'hsla(40, 94.9%, 38.7%, calc(0.16 - 0.16 / 100 * <alpha-value>))',
...
} The steps would be pretty unpredictable, since different color levels would have vastly different steps. But it would at least keep the syntax uniform for both variants. That way the Radix palette would be transferred precisely while also conforming with Tailwind standards. |
Hello, thank you for the plugin, it's the best of both worlds!
Is it planned to add opacity settings similar to hsl-radix-colors? I feel it would bring the color palette even closer to Tailwind.
The text was updated successfully, but these errors were encountered: