diff --git a/__tests__/sanity.test.js b/__tests__/sanity.test.js index 516d425f6..d79bcee57 100644 --- a/__tests__/sanity.test.js +++ b/__tests__/sanity.test.js @@ -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('') + }) +}) \ No newline at end of file diff --git a/src/lib/substituteResponsiveAtRules.js b/src/lib/substituteResponsiveAtRules.js index 98b306c3f..9e69e9aba 100644 --- a/src/lib/substituteResponsiveAtRules.js +++ b/src/lib/substituteResponsiveAtRules.js @@ -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) + } }) } }