-
-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathtailwind.config.cjs
36 lines (33 loc) · 961 Bytes
/
tailwind.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const plugin = require("tailwindcss/plugin");
const fs = require("fs");
const postcss = require("postcss");
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{vue,js,ts,jsx,tsx,svg}",
],
important: '.vuefinder',
darkMode: 'class',
theme: {
extend: {},
},
plugins: [
/* Preflight but limit to only apply our components */
// https://github.com/tailwindlabs/tailwindcss/discussions/10332#discussioncomment-4699227
plugin(({ addBase }) => {
const preflightStyles = postcss.parse(
fs.readFileSync(require.resolve('./src/assets/css/preflight.css'), "utf8")
)
// Scope the selectors to specific components
preflightStyles.walkRules((rule) => {
rule.selector = rule.selectors
.map(selector => ".vuefinder " + selector)
.join(",");
});
addBase(preflightStyles.nodes)
})
],
corePlugins: {
preflight: false,
}
}