-
-
Notifications
You must be signed in to change notification settings - Fork 804
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
Gradient end color becomes transparent #2522
Comments
Would you mind sending a PR to fix it? Thanks! |
@antfu The source of the problem is these two lines: unocss/packages/core/src/generator/index.ts Lines 222 to 223 in 063f427
They ruin a lot of things already. I'm going to nuke all As a quick fix, we can separate the following rule into 3 rules to fix this issue.
/cc @chu121su12 I wanted to mention you in this conversation since most of these lines are written by you. Maybe you could come up with a better solution. |
Yeah I think we should separate the rules of the order matters to them. |
This is my first time making a pull request, so I apologize if there are any mistakes. Please check. |
UnoCSS version
0.51.5
Describe the bug
When using a gradient class for the class attribute, the color at the end of the gradient becomes transparent.
Since the second argument of
colorToString
in thebgGradientToValue
function is 0,to-{toColor}
ofbg-gradient-to-r from-{startColor} via-{viaColor} to-{toColor}
will be displayed transparently.Reproduction
NG(with class attributes)
https://uno.antfu.me/play/?html=DwEwlgbgBAFgtAMwK4BsVQC4FMAeG4DGWAdtgE5QIq5QDOW1B%2BxA9sVlAIZoBcGZnYrTAYwbOABYADFIB8AKChRQkKAFtOCpUpXQqNAFZJaohAE9CJclu07w0AO5wATFNgu3AIwDmcbwPArOAwWOAoEMhY1OFoAawsIqKgIME4Y%2BLgUzkxQuIsQ2WAAensbW10oAhROWloAXgAiJ1d3Fp8-ALAgkLDKSOi8xH7k1PSLLJyx4JYGwpLIMuV5iBti0vk1haA&config=JYWwDg9gTgLgBAbwFBzgEwKYDNgDsMDCEuOA5gDQpxhQYDOGMAgjDFMAEYCuMwWAnpVQ16jAJIBjYnSHVaDGAFVcESgF84WKBBBwA5FxUS6dPUiQYAHpFjpsAQy4AbeJhz4iJYKQAUyVHQAFtAwEjx0AFyIVKh6YXQwOgC0QSFhMHpRejBWMElOpHA5lnnQ9rikGHDBAG4YUBHFeTn2TmaoarIiCpFwANoxcqJKKj4AlLLC8owsbJw8fPzjsgC6sjCBGCAYUf6ocFJO0L3IAJDnp3QA1vy7SBfnWjpZAMQALBj2EhIYepQPpxqwHsrwA7FgOABmNAADj%2B9weiVeHBRoLQACYzA9OoM1FQ8WoxkggA&css=Q&options=N4IgLgTghgdgzgMwPYQLYgFwKgGzgUwF8g
OK(no class attributes)
https://uno.antfu.me/play/?html=DwEwlgbgBAFgtAMwK4BsVQC4FMAeG4DGWAdtgE5QIq5QDOW1B%2BxA9sVlAIZoBcGZnYrTAYwbOABYADFIB8AKChRQkKAFtOCpUpXQqNAFZJaohAE9CJclu07w0AO5wATFNgu3AIwDmcbwPArOAwWOAoEMhY1OFoAawsIqKgIME4Y%2BLgUzkxQuIsQ2WAAensbW10oJ1d3ap8-ALAgkLDKSOi8xDbk1PSLLJze4JZCksgy5VGIG2LS%2BRmxoA&config=JYWwDg9gTgLgBAbwFBzgEwKYDNgDsMDCEuOA5gDQpxhQYDOGMAgjDFMAEYCuMwWAnpVQ16jAJIBjYnSHVaDGAFVcESgF84WKBBBwA5FxUS6dPUiQYAHpFjpsAQy4AbeJhz4iJYKQAUyVHQAFtAwEjx0AFyIVKh6YXQwOgC0QSFhMHpRejBWMElOpHA5lnnQ9rikGHDBAG4YUBHFeTn2TmaoarIiCpFwANoxcqJKKj4AlLLC8owsbJw8fPzjsgC6sjCBGCAYUf6ocFJO0L3IAJDnp3QA1vy7SBfnWjpZAMQALBj2EhIYepQPpxqwHsrwA7FgOABmNAADj%2B9weiVeHBRoLQACYzA9OoM1FQ8WoxkggA&css=Q&options=N4IgLgTghgdgzgMwPYQLYgFwKgGzgUwF8g
System Info
Validations
The text was updated successfully, but these errors were encountered: