Skip to content
This repository was archived by the owner on Sep 12, 2023. It is now read-only.

Commit 974ef4e

Browse files
committed
Allow custom postcss style tags
1 parent 05616c5 commit 974ef4e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

public/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@
99
}
1010
}
1111
</script>
12+
<style type="postcss">
13+
::selection {
14+
@apply bg-pink-500;
15+
}
16+
</style>
1217
<div class="container mx-auto pt-16">
1318
<div class="h-8 w-8 bg-regal-blue rounded-full hover:bg-blue-800 cursor-pointer">
1419

1520
</div>
21+
foo bar baz
22+
23+
<div class="foo">asd</div>
1624
</div>

src/observer.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,18 @@ export default (force = false) => {
2727
plugins: [],
2828
};
2929

30+
let customCss = '';
31+
document.querySelectorAll('style[type="postcss"]').forEach(styleTag => {
32+
customCss += styleTag.innerHTML;
33+
})
34+
3035
const result = await postcss([
3136
tailwindcss({ ...defaultConfig, ...userConfig }),
3237
]).process(
3338
`
3439
@tailwind base;
3540
@tailwind components;
41+
${customCss}
3642
@tailwind utilities;
3743
`,
3844
{

0 commit comments

Comments
 (0)