File tree Expand file tree Collapse file tree 4 files changed +34
-3
lines changed
test/com/inet/lib/less/samples/general Expand file tree Collapse file tree 4 files changed +34
-3
lines changed Original file line number Diff line number Diff line change 2626 */
2727package com .inet .lib .less ;
2828
29-
3029/**
3130 * A version of the CssFormatter that produce a compressed output.
3231 */
@@ -148,8 +147,13 @@ private void checkSemicolon() {
148147 CssFormatter startBlock ( String [] selectors ) {
149148 checkSemicolon ();
150149 CssFormatter formatter = super .startBlock ( selectors );
151- if ( formatter != this && formatter .getOutput ().length () > 0 ) { // two rules with same selector was merged
152- formatter .semicolon ();
150+ if ( formatter != this ) { // two rules with same selector was merged
151+ StringBuilder output = formatter .getOutput ();
152+ int length = output .length ();
153+ if ( length > 0 && output .charAt ( length -1 ) != '}' ) {
154+ // the previous rule of the same selector ends with a property
155+ formatter .semicolon ();
156+ }
153157 }
154158 return formatter ;
155159 }
Original file line number Diff line number Diff line change 1+ @supports selector {
2+ surrounding .parentclass {
3+ background : red;
4+ }
5+ surrounding .parentclass .element {
6+ display : flex;
7+ }
8+ surrounding .parentclass .another {
9+ border-color : green;
10+ }
11+ }
Original file line number Diff line number Diff line change 1+ @supports selector{surrounding .parentclass{background:#f00}surrounding .parentclass .element{display:flex}surrounding .parentclass .another{border-color:#008000}}
Original file line number Diff line number Diff line change 1+ surrounding {
2+ @supports selector {
3+ .parentclass {
4+ background : red ;
5+
6+ .element {
7+ display : flex ;
8+ }
9+
10+ .another {
11+ border-color : green ;
12+ }
13+ }
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments