Repository navigation
🐛 fix(css): keep escaped hash colors as written - #2191
Conversation
minify_css shortened and lower-cased a hash color that held a CSS escape as if every character were a hex digit. The spelled backslash of an escape could pair up into a digit, and a lone backslash left at the end escaped the rule's closing brace. A hash with a backslash now keeps its spelling. Escapes that decode to plain hex digits still shorten as before. Fixes tox-dev#1849.
Merging this PR will improve performance by 61.1%2 warnings
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
The CSS minifier could change a hash color that holds a backslash escape. It lower-cased and shortened such a color as if every character were a hex digit, and a stray backslash could then escape the closing brace of the rule. 🎨 Once this merges, such a color keeps its case and is not shortened. Fixes #1849.
The hash-color path no longer lower-cases or shortens a spelling that contains a backslash. It only writes each escape in its shortest form, so
#0000\5cbecomes#0000\\. The trade-off is that an escaped color is left alone even when a shorter spelling exists.Behavior changes