: What is the maximum safe line length in css files? YUI Compressor and other minifiers tend to remove unnecessary whitespaces, causing long lines. Safari 5 seems to fail rendering some rules from
YUI Compressor and other minifiers tend to remove unnecessary whitespaces, causing long lines. Safari 5 seems to fail rendering some rules from the css files when the file has more than 5000 characters per line (blog post about my experiences).
UglifyJS has a --max-line-len (default 32K characters) and the author says at the page
I’ve seen both FF and Chrome croak when all the code was on a single
line of around 670K
What is the maximum safe line length in css files? I would like to support most of the still active browsers, while still removing unnecessary whitespaces. Any references to specifications would be useful.
More posts by @Harper822
1 Comments
Sorted by latest first Latest Oldest Best
To quote the Closure Compiler FAQ:
The Closure Compiler intentionally adds line breaks every 500
characters or so. Firewalls and proxies sometimes corrupt or ignore
large JavaScript files with very long lines. Adding line breaks every
500 characters prevents this problem. Removing the line breaks has no
effect on a script's semantics. The impact on code size is small, and
the Compiler optimizes line break placement so that the code size
penalty is even smaller when files are gzipped.
jQuery (1.7.2) has a 32k single line limit. Since jQuery is a widely used library, I would use the 32k character limit as a guideline.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.