Skip to content

Commit

Permalink
Merge pull request tailwindlabs#442 from tailwindcss/preflight-source…
Browse files Browse the repository at this point in the history
…maps

Add sourcemaps for replaced preflight styles
  • Loading branch information
adamwathan authored Mar 30, 2018
2 parents 64d3cf5 + 2e34df9 commit 14f1ba6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib/substituteTailwindAtRules.js
Original file line number Diff line number Diff line change
@@ -13,9 +13,13 @@ export default function(config) {

css.walkAtRules('tailwind', atRule => {
if (atRule.params === 'preflight') {
atRule.before(
postcss.parse(fs.readFileSync(`${__dirname}/../../css/preflight.css`, 'utf8'))
const preflightTree = postcss.parse(
fs.readFileSync(`${__dirname}/../../css/preflight.css`, 'utf8')
)

preflightTree.walk(node => (node.source = atRule.source))

atRule.before(preflightTree)
atRule.remove()
}

0 comments on commit 14f1ba6

Please sign in to comment.