-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Alpha utilities do not apply to HSL colors using space-separated notation #4677
Comments
Fixing this issue appears to require a couple of steps: ✅ 1. Refactor HSL parsing in
|
@adamwathan I added a PR that enables space-separated HSL color values: #5003. It is a surprisingly small diff! |
What version of Tailwind CSS are you using?
v2.2.0
What build tool (or framework if it abstracts the build tool) are you using?
Next.js v11.0.0
What version of Node.js are you using?
v15.2.1
What browser are you using?
Firefox
What operating system are you using?
macOS 11.4 (Big Sur)
Reproduction repository
https://github.com/htunnicliff/tailwind-hsl-issue
Describe your issue
Colors that are defined in tailwind.config.js that use space-separated HSL notation are not handled correctly when used with color modification utilities like
bg-opacity-{n}
ortext-opacity-{n}
.For example, if I add the same color using the the two notation styles to my config:
hsl(152 75% 40%)
(uses space-separated HSL notation)hsl(152, 75%, 40%)
(uses comma-separated HSL notation)And then I use those colors in conjunction with background and text opacity utilities:
This is the result:
As you can see, the comma-separated HSL values have their opacity changed, while the space-separated HSL values do not change.
Since space-separated HSL values are supported by evergreen browsers, it seems like Tailwind should support them as well.
The text was updated successfully, but these errors were encountered: