File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
test/options/unitless-zero-less Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,21 @@ module.exports = {
2525 value . remove ( 1 ) ;
2626 }
2727 } else if ( value . is ( 'percentage' ) ) {
28- var number = value . first ( 'number' ) . content ;
28+ // XXX(tonyganch): There is a bug in Gonzales when in Less,
29+ // percentage's content is not wrapped as an array but actually
30+ // type of node's content is object. This bug has already been
31+ // fixed in newer versions of Gonzales so the issue should be
32+ // gone after update of dependencies and csscomb@4.0 release.
33+ // This hack is here as a hotfix for csscomb@3.1 and must be
34+ // removed once csscom@4.0 is released. See #389.
35+ var number ;
36+ if ( ! Array . isArray ( value . content ) &&
37+ value . content . is ( 'number' ) ) {
38+ number = value . content ;
39+ } else {
40+ number = value . first ( 'number' ) . content ;
41+ }
42+
2943 if ( number [ 0 ] === '0' ) {
3044 value . type = 'number' ;
3145 value . content = number ;
Original file line number Diff line number Diff line change 1+ .test
2+ {
3+ width : 100% ;
4+ }
Original file line number Diff line number Diff line change 1+ describe ( 'options/unitless-zero (less)' , function ( ) {
2+ it ( 'Issue 389' , function ( ) {
3+ this . comb . configure ( { 'unitless-zero' : true } ) ;
4+ this . shouldBeEqual ( 'issue-389.less' ) ;
5+ } ) ;
6+ } ) ;
You can’t perform that action at this time.
0 commit comments