Prevent data-uri function from embedding files larger than 32KB.

Although IE8 does support data-uris, it only does so with a limit of 32KB. It's a silly limitation, but a source of potential bugs. When the limit is exceeded, the data-uri() function will simply return a normal url() value with a relative path to the asset.

One may pass --no-ie-compat to lessc to avoid this safeguard.
This commit is contained in:
Daniel Stockman
2013-02-18 18:54:11 -08:00
committed by Luke Page
parent 7116b3b1c5
commit e4fe935ea1
9 changed files with 39 additions and 0 deletions

View File

@@ -52,3 +52,6 @@
uri-1: url('data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A');
uri-2: url('data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A');
}
#data-uri-toobig {
uri: url(../data/data-uri-fail.png);
}