Less v3.0.0 incorrectly processes a base64-encoded style sheets
See original GitHub issueIf you compile the following code:
@import url("data:text/css;base64,Ym9keSB7IGJhY2tncm91bmQtY29sb3I6IGxpbWUgIWltcG9ydGFudDsgfQ==");
then get the following error:
FileError: 'data:text/css;base64,Ym9keSB7IGJhY2tncm91bmQtY29sb3I6IGxpbWUgIWltcG9ydGFudDsgfQ==' wasn't found. Tried - data:text/css;base64,Ym9keSB7IGJhY2tncm91bmQtY29sb3I6IGxpbWUgIWltcG9ydGFudDsgfQ==,C:\temp\data:text\css;base64,Ym9keSB7IGJhY2tncm91bmQtY29sb3I6IGxpbWUgIWltcG9ydGFudDsgfQ==,C:\temp\node_modules\data:text\css;base64,Ym9keSB7IGJhY2tncm91bmQtY29sb3I6IGxpbWUgIWltcG9ydGFudDsgfQ== in C:\temp\test.less on line 1, column 1:
1 @import url("data:text/css;base64,Ym9keSB7IGJhY2tncm91bmQtY29sb3I6IGxpbWUgIWltcG9ydGFudDsgfQ==");
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Is embedding background image data into CSS as Base64 ...
It's not a good idea when you want your images and style information to be cached ... I don't see a problem to...
Read more >Base64 - MDN Web Docs Glossary: Definitions of ... - Mozilla
Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a ......
Read more >invalid base64-encoded string: number of data characters (9 ...
I wager that storing at worst 2 extra bytes is far less expensive than the hassle / complexity / unexpectedness of a custom...
Read more >Base64 Encoding & Performance, Part 2: Gathering Data
Expectedly, parsing stylesheets is dramatically slower if they're full of Base64 encoded assets. On Desktop, parsing was over 10× slower. On ...
Read more >Data URIs | CSS-Tricks
The end result can be a site with all the less HTTP Requests, ... data:[<mime type>][;charset=<charset>][;base64],<encoded data>.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Right. So the fact it worked in 2.7.3 was actually a bug, probably just because the “css” string was in
data:text/css
. There is no supported/documented method to do imports in Less in this way. If you want to preserve an@import
statement, you need to specify the import type as(css)
.It is, otherwise it would not be declared as a CSS superset. Still 1000 incompatibilities (of infinite language feature combinations in total) is a myriad. (It does not mean you’ll ever face more than two or three of them though. Just like most of average users will never face
@import url("data:text/css;base64,Ym...
).A quick walk through issues here could give some ideas (it’s too tedious to build a list for even two or three when each sounds like
or longer).