Skip to content

Support for at keyword in css gradient functions #85

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

Closed
2 of 3 tasks
romainmenke opened this issue Dec 22, 2021 · 0 comments · Fixed by #287
Closed
2 of 3 tasks

Support for at keyword in css gradient functions #85

romainmenke opened this issue Dec 22, 2021 · 0 comments · Fixed by #287

Comments

@romainmenke
Copy link
Member

Bug description

Currently gradient functions with extra keywords lead to incorrect output as they are mistaken for color values.


see : csstools/postcss-preset-env#120

https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/radial-gradient()

https://drafts.csswg.org/css-images/#radial-gradients


Propose rewriting gradients plugin from an order based find/replace to something that first builds a data model and then stringifies this to a syntax that most browsers understand.

Source CSS

.at-keyword {
	background-image: radial-gradient(farthest-corner at 40px 40px, #f35 0%, #43e 100%);
}

Expected CSS

need to check if there is a valid alternative

Actual CSS

.at-keyword {
	background-image: radial-gradient(farthest-corner at 40px,at 40px, #f35 0%, #43e 100%);
}

Does it happen with npx <plugin-name> minimal-example.css?

Yes

Extra config

No response

What plugin are you experiencing this issue on?

PostCSS Double Position Gradients

Plugin version

7.1.0

What OS are you experiencing this on?

macOS

Node Version

16

Validations

  • Follow our Code of Conduct
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this bug?

  • I'm willing to open a PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant