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

Parse alpha value from rgba/hsla colors when using variables #10429

Merged
merged 2 commits into from Jan 31, 2023

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Jan 27, 2023

When given colors like: rgba(var(--color), 0.1) or hsla(var(--color), 0.1) we were not parsing the alpha value from them properly. This could result in outputting utilities like the following:

.text-primary\/50 {
    color: rgba(var(--color) 0.1 0.5);
}

Which has 1) the wrong syntax; and 2) too many values because the alpha value wasn't replaced.

This PR fixes addresses this issue and outputs this instead:

.text-primary\/50 {
    color: rgba(var(--color), 0.5);
}

@thecrypticace thecrypticace changed the title Parse alpha value from rgba/hsla colors Parse alpha value from rgba/hsla colors when using variables Jan 27, 2023
@thecrypticace thecrypticace merged commit 885e134 into master Jan 31, 2023
@thecrypticace thecrypticace deleted the fix/hsla-rgba-alpha-parsing branch January 31, 2023 19:36
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.

None yet

1 participant