Skip to content

Commit

Permalink
[options] Reapply hotfix for csscomb#389
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang authored and tonyganch committed Jul 11, 2016
1 parent 2bc6281 commit 1d6771f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/options/unitless-zero.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ module.exports = {

if (value.is('dimension')) {
var unit = value.first('ident').content;
if (value.first('number').content[0] === '0' &&
if (value.first('number').content === '0' &&
UNITS.indexOf(unit) !== -1) {
value.removeChild(1);
}
} else if (value.is('percentage')) {
var number = value.first('number').content;
if (number[0] === '0') {
if (number === '0') {
value.type = 'number';
value.content = number;
}
Expand All @@ -56,7 +56,7 @@ module.exports = {
}

if (node.is('dimension') &&
node.first('number').content[0] === '0' &&
node.first('number').content === '0' &&
node.first('ident').content !== 'deg') {
detected.push(false);
return;
Expand All @@ -65,7 +65,7 @@ module.exports = {
// If we see a zero and previous node is not percentage
// or dimension, then we have an option
if (node.is('number') &&
node.content[0] === '0' &&
node.content === '0' &&
!parent.is('percentage') &&
!parent.is('dimension')) {
detected.push(true);
Expand Down

0 comments on commit 1d6771f

Please sign in to comment.