-
Notifications
You must be signed in to change notification settings - Fork 482
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
Possible false positive: inline svg at background-image #571
Comments
That seems valid at first glance, so I'd guess it's a bug. I'll bet you can work around it by using a base64-encoded string instead, like this: .test {
background-image: url('data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI4Mi4zNTI5NDExNzY0NzA2IiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIyODIuMzUyOTQxMTc2NDcwNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48L2RlZnM+PHJlY3QgeD0iMzkuMTc2NDcwNTg4MjM1MzA0IiB5PSIzOS4xNzY0NzA1ODgyMzUzMDQiIHdpZHRoPSIyMDQiIGhlaWdodD0iMjA0IiBmaWxsPSIjMDAwMDAwIiBzdHlsZT0ib3BhY2l0eTogMC43NTsiPjwvcmVjdD48L3N2Zz4=')
} More bytes, less readable, but (probably) functional. |
Just chiming in, but producing less efficient code just to satisfy a code quality tool is not logical. If CSSlint had a reliable method to ignore specific rules via comments, then we could manage it that way. But, it doesn't seem to work properly. Yes I've spent way too long trying to make CSSlint ignore stuff I know is incorrect. |
It seems this is flagged by using single quotes, not double quotes around the URI; which makes things difficult for SVG, since it normally comes with double-quotes around its attributes. |
I think single quotes should be allowed especially in this case. As replete said, working around with base64 is not an option. At least we should be able to supress this warning. Hope this will get fixed! |
I have a case where a css rule specifies a background-color and a background-image with an inline svg. I think this is valid css, but csslint outputs:
Expected (<bg-image>) but found 'url('data:image/svg+xml;utf8,...
Is this a false positive?
Example:
The text was updated successfully, but these errors were encountered: