Merge pull request #89 from psren/fix/empty-media-queries-are-rendered

remove empty media queries
This commit is contained in:
Adam Wathan 2017-11-03 19:13:48 -04:00 • committed by GitHub
commit 5c585f844e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -17,3 +17,11 @@ it('generates the right CSS', () => {
expect(result.css).toBe(expected)
})
})
it('does not add any CSS if no Tailwind features are used', () => {
return postcss([tailwind()])
.process('')
.then(result => {
expect(result.css).toBe('')
})
})

View file

@ -29,7 +29,10 @@ export default function(config) {
return cloned
})
)
css.append(mediaQuery)
if (mediaQuery.nodes.length) {
css.append(mediaQuery)
}
})
}
}