-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.ts
49 lines (47 loc) · 1.36 KB
/
tailwind.config.ts
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
37
38
39
40
41
42
43
44
45
46
47
48
49
/* eslint-disable @typescript-eslint/ban-ts-comment */
// @ts-nocheck
const fs = require("fs")
const plugin = require("tailwindcss/plugin")
const postcssJs = require("postcss-js")
const FormKitVariants = require("@formkit/themes/tailwindcss")
const screens = require("./tailwind/tailwind-breakpoints.config")
const theme = require("./tailwind/theme")
module.exports = {
mode: "jit",
content: [
"./components/**/*.{vue,ts}",
"./pages/**/*.vue",
// you will need the following to be here if you plan to have global styles for formkit elements
"./formkit/**/*.ts",
"./formkit/tailwind-formkit.ts"
],
theme: {
screens,
extend: theme
},
plugins: [
FormKitVariants,
function ({ addBase, theme }) {
const screens = theme("screens", {})
const breakpoints = Object.keys(screens)
addBase({
":root": {
"--current-breakpoint": 0
},
...breakpoints.reduce((acc, current) => {
acc[`@media (min-width: ${screens[current]})`] = {
":root": {
"--current-breakpoint": screens[current]
}
}
return acc
}, {})
})
},
plugin(function ({ addComponents, postcss }) {
// Styles defined in extended-tailwind-styles.pcss will be precompiled while launching nuxt server
const css = fs.readFileSync("./assets/css/extended-tailwind-styles.pcss", "utf-8")
addComponents(postcssJs.objectify(postcss.parse(css)))
})
]
}