remove empty media queries

This commit is contained in:
Patrick Heller 💩 2017-11-03 20:52:16 +01:00
parent 9f16bf54ea
commit e5a9c8926f
2 changed files with 13 additions and 1 deletions

View file

@ -17,3 +17,11 @@ it('generates the right CSS', () => {
expect(result.css).toBe(expected)
})
})
it('Does not add something if not used at all', () => {
return postcss([tailwind()])
.process('')
.then(result => {
expect(result.css).toBe('')
})
})

View file

@ -29,7 +29,11 @@ export default function(config) {
return cloned
})
)
css.append(mediaQuery)
if(mediaQuery.nodes.length) {
// do not add media query without any rules or comments
css.append(mediaQuery)
}
})
}
}