Skip to content

Commit 08b6741

Browse files
committed
[options] Reapply hotfix for #389
1 parent 6611c45 commit 08b6741

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/options/unitless-zero.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ module.exports = {
2323

2424
if (value.is('dimension')) {
2525
var unit = value.first('ident').content;
26-
if (value.first('number').content[0] === '0' &&
26+
if (value.first('number').content === '0' &&
2727
UNITS.indexOf(unit) !== -1) {
2828
value.removeChild(1);
2929
}
3030
} else if (value.is('percentage')) {
3131
var number = value.first('number').content;
32-
if (number[0] === '0') {
32+
if (number === '0') {
3333
value.type = 'number';
3434
value.content = number;
3535
}
@@ -56,7 +56,7 @@ module.exports = {
5656
}
5757

5858
if (node.is('dimension') &&
59-
node.first('number').content[0] === '0' &&
59+
node.first('number').content === '0' &&
6060
node.first('ident').content !== 'deg') {
6161
detected.push(false);
6262
return;
@@ -65,7 +65,7 @@ module.exports = {
6565
// If we see a zero and previous node is not percentage
6666
// or dimension, then we have an option
6767
if (node.is('number') &&
68-
node.content[0] === '0' &&
68+
node.content === '0' &&
6969
!parent.is('percentage') &&
7070
!parent.is('dimension')) {
7171
detected.push(true);

0 commit comments

Comments
 (0)