Skip to content

Commit

Permalink
Merge pull request tailwindlabs#89 from psren/fix/empty-media-queries…
Browse files Browse the repository at this point in the history
…-are-rendered

remove empty media queries
  • Loading branch information
adamwathan authored Nov 3, 2017
2 parents 01590b0 + 004fa09 commit 5c585f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions __tests__/sanity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('')
})
})
5 changes: 4 additions & 1 deletion src/lib/substituteResponsiveAtRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export default function(config) {
return cloned
})
)
css.append(mediaQuery)

if (mediaQuery.nodes.length) {
css.append(mediaQuery)
}
})
}
}

0 comments on commit 5c585f8

Please sign in to comment.