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

[css-images-4] image() fragment cannot be created from var() #6226

Closed
jsnkuhn opened this issue Apr 20, 2021 · 3 comments
Closed

[css-images-4] image() fragment cannot be created from var() #6226

jsnkuhn opened this issue Apr 20, 2021 · 3 comments

Comments

@jsnkuhn
Copy link

jsnkuhn commented Apr 20, 2021

The currently proposed image fragment syntax cannot be created from a css variable since css variables can't be used to create larger tokens.

Firefox's old -moz-image-rect syntax allows construction from css variables:
https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-image-rect

Codepen comparing -moz-image-rect() with the current proposed image():
https://codepen.io/jsnkuhn/pen/JjEpbwy?editors=1100

https://drafts.csswg.org/css-images-4/#image-fragments

@jsnkuhn
Copy link
Author

jsnkuhn commented Apr 20, 2021

maybe a fragment() function? Something similar to css clip-path like rect() or svg's viewbox() could be generalized for image fragment use?

@Loirooriol
Copy link
Contributor

I guess #542 would allow this

@tabatkins
Copy link
Member

Yup, this is basically a dup of #542

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

No branches or pull requests

3 participants