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

Can't resolve url(data:image/svg+xml) properly. #2597

Open
Edge00 opened this issue Jul 22, 2021 · 0 comments · May be fixed by #2633
Open

Can't resolve url(data:image/svg+xml) properly. #2597

Edge00 opened this issue Jul 22, 2021 · 0 comments · May be fixed by #2633
Labels

Comments

@Edge00
Copy link

Edge00 commented Jul 22, 2021

Reproduction Link

For this code

 .icon-search {
   mask-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16.31%2015.561l4.114%204.115-.848.848-4.123-4.123a7%207%200%2011.857-.84zM16.8%2011a5.8%205.8%200%2010-11.6%200%205.8%205.8%200%200011.6%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E")
 }

If url is wrapped with ", Stylus works fine.
However, if remove the ", compiler throws error ParseError: illegal unary "%", missing left-hand operand

 .icon-search {
   mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16.31%2015.561l4.114%204.115-.848.848-4.123-4.123a7%207%200%2011.857-.84zM16.8%2011a5.8%205.8%200%2010-11.6%200%205.8%205.8%200%200011.6%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
 }

Here is the documentation of css url() which supports such usage.

@groenroos groenroos linked a pull request Sep 8, 2021 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants