Skip to content

Commit 14f1ba6

Browse files
authored
Merge pull request #442 from tailwindcss/preflight-sourcemaps
Add sourcemaps for replaced preflight styles
2 parents 64d3cf5 + 2e34df9 commit 14f1ba6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/substituteTailwindAtRules.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ export default function(config) {
1313

1414
css.walkAtRules('tailwind', atRule => {
1515
if (atRule.params === 'preflight') {
16-
atRule.before(
17-
postcss.parse(fs.readFileSync(`${__dirname}/../../css/preflight.css`, 'utf8'))
16+
const preflightTree = postcss.parse(
17+
fs.readFileSync(`${__dirname}/../../css/preflight.css`, 'utf8')
1818
)
19+
20+
preflightTree.walk(node => (node.source = atRule.source))
21+
22+
atRule.before(preflightTree)
1923
atRule.remove()
2024
}
2125

0 commit comments

Comments
 (0)