77 line-height : 1.5 ;
88}
99# example h1 {
10- font-size : 36pt ;
11- margin : .5em 0 .2em 0 ;
10+ font-size : 38pt ;
11+ margin : 0 0 .2em 0 ;
12+ }
13+ # example h2 {
14+ font-size : 19pt ;
1215}
1316# example p {
1417 margin : 0 ;
1518}
16- .snap -height # example {
19+ .line -height-step # example {
1720 line-height : 1 ;
1821 snap-height : 18pt ;
22+ line-height-step : 18pt ;
1923}
20- .snap-height .baseline # example {
21- snap-height : 18pt 70 ;
22- }
23- .snap-height # example > * {
24+ .line-height-step # example > * {
2425 margin : 0 ;
2526}
26- .snap -height .use-inline-block # example > h2 {
27+ .line -height-step .use-inline-block # example > h2 {
2728 display : inline-block;
2829 width : 100% ;
2930 snap-height : 0 ;
31+ line-height-step : 0 ;
3032 line-height : 1.2 ;
3133}
3234
4648 border : thin solid black;
4749 padding : 2px ;
4850}
49- .has-snap -height # prerequisite {
51+ .has-line -height-step # prerequisite {
5052 display : none;
5153}
52- .has-snap -height # control {
54+ .has-line -height-step # control {
5355 display : block;
5456}
55- .if-snap -height {
57+ .if-line -height-step {
5658 display : none;
5759}
58- .snap -height .if-snap -height {
60+ .line -height-step .if-line -height-step {
5961 display : initial;
6062}
6163.editable # example {
8688 with the < code > --enable-blink-features=CSSSnapSize</ code > command line option.
8789 </ div >
8890 < div id ="control ">
89- < label > < input type ="checkbox " value ="snap -height" > Snap height</ label >
90- < span class ="if-snap -height ">
91+ < label > < input type ="checkbox " value ="line -height-step " > Enable line- height-step </ label >
92+ < span class ="if-line -height-step ">
9193 < label > < input type ="checkbox " value ="use-inline-block "> Use inline-block for h2</ label >
92- < label > < input type ="checkbox " value ="baseline "> Baseline</ label >
9394 </ span >
9495 </ div >
9596 < label > < input type ="checkbox " value ="editable "> Editable</ label >
@@ -108,8 +109,8 @@ <h2>A long long multi-line heading</h2>
108109< script >
109110( function ( ) {
110111 var style = getComputedStyle ( document . documentElement ) ;
111- if ( 'snapHeight' in style )
112- panel . classList . add ( 'has-snap -height' )
112+ if ( 'lineHeightStep' in style || ' snapHeight' in style )
113+ panel . classList . add ( 'has-line -height-step ' )
113114 Array . prototype . forEach . call ( document . querySelectorAll ( "input[type=checkbox]" ) , function ( e ) {
114115 e . addEventListener ( "click" , onChange ) ;
115116 } ) ;
0 commit comments