YUI Compressor is removing spaces from filter values

后端 未结 5 2138
独厮守ぢ
独厮守ぢ 2021-02-07 11:18

I have a css containing filter for adding Grayout images in FF like this:-

filter: url(\"data:image/svg+xml;utf8,         


        
5条回答
  •  遇见更好的自我
    2021-02-07 11:28

    I found out by experimenting with JW.'s idea that you can base64-encode the entire string, except for the final #grayscale part and adding the corresponding encoding part, or, even nicer. only url-encode the spaces between xml attributes and/or tag names and separating the matrix values by commas.

    So in the end you have:

    filter: url("data:image/svg+xml;utf8,#grayscale");
    

    which is compact and doesn't get altered by the css compressor

提交回复
热议问题