Skip to content

Commit

Permalink
fix exception when dimension found outside declaration (fixes #273)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Feb 28, 2016
1 parent 730b8b3 commit bfac3b2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/compressor/compress/Dimension.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function compressDimension(node, item) {

if (value === '0' && !NON_LENGTH_UNIT.hasOwnProperty(unit)) {
// issue #200: don't remove units in flex property as it could change value meaning
if (this.declaration.property.name === 'flex') {
if (this.declaration && this.declaration.property.name === 'flex') {
return;
}

Expand Down
8 changes: 8 additions & 0 deletions test/fixture/compress/atrules/supports-2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
issue #273 should compress length dimension outside block
*/
@supports (width: 0px) and (test: 0deg) {
.test {
foo: 1
}
}
1 change: 1 addition & 0 deletions test/fixture/compress/atrules/supports-2.min.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@supports (width:0) and (test:0deg){.test{foo:1}}

0 comments on commit bfac3b2

Please sign in to comment.