Skip to content

Commit 5c585f8

Browse files
authored
Merge pull request #89 from psren/fix/empty-media-queries-are-rendered
remove empty media queries
2 parents 01590b0 + 004fa09 commit 5c585f8

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

__tests__/sanity.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,11 @@ it('generates the right CSS', () => {
1717
expect(result.css).toBe(expected)
1818
})
1919
})
20+
21+
it('does not add any CSS if no Tailwind features are used', () => {
22+
return postcss([tailwind()])
23+
.process('')
24+
.then(result => {
25+
expect(result.css).toBe('')
26+
})
27+
})

src/lib/substituteResponsiveAtRules.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default function(config) {
2929
return cloned
3030
})
3131
)
32-
css.append(mediaQuery)
32+
33+
if (mediaQuery.nodes.length) {
34+
css.append(mediaQuery)
35+
}
3336
})
3437
}
3538
}

0 commit comments

Comments
 (0)