Repository navigation
An empty value parses as the initial value of flex, flex-flow, text-decoration, list-style and background
#1413
YevheniiKotyrlo
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
flex,flex-flow,text-decoration,list-styleandbackgroundwith an empty value parse as their initial values, so the minifier turns a declaration a browser drops into one it applies:.a{flex:2;flex:}minifies to.a{flex:1}, where a browser keepsflex:2. None of these grammars matches an empty value, since each needs at least one component (CSS Values 4);border,outline,fontandplace-itemsalready leave an empty value unparsed.Flex::parseandFlexFlow::parsereturn their defaults when their loop takes no component.Reproducer
repro.shbuildsmain.rsagainst lightningcss'smaster, parses each declaration withProperty::parse_string, and minifies it in a rule withStyleSheet::parse,minifyandto_css.Steps to reproduce
git clone https://gist.github.com/YevheniiKotyrlo/ef0685041d453e8adc35d3f830e0d3b8 repro && cd reprobash repro.sh, which exits 1 while a declaration with an empty value parses as a typed value.Expected result
Each empty value is left unparsed, as
border:is, and.a{flex:2;flex:}keepsflex:2.flex: 1,flex: none,flex-flow: rowandborder: 1px solidparse as they do now.Actual result
Versions and platform
All reactions