You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This command will produce a `formkit.theme.(mjs|ts)` file in your project's root directory. To complete the setup you will need to do the following two things:
381
381
382
382
- Import the `rootClasses` function from your built theme into your `formkit.config` file
383
-
- Add the `formkit.theme` file to your `tailwind.config` file's `content` array.
383
+
- Add a `@source` directive for the `formkit.theme` file in your CSS
Install the resulting `formkit.theme.(mjs|ts)` file by following the same instructions from the section above — adding the `rootClasses` to your `formkit.config` file and including the `formkit.theme.(mjs|ts)` file in your `tailwind.config` file's content array.
445
+
Install the resulting `formkit.theme.(mjs|ts)` file by following the same instructions from the section above — adding the `rootClasses` to your `formkit.config` file and including the `formkit.theme.(mjs|ts)` file via `@source` directives in your CSS.
Finally, you’ll need to add the `formkit.theme.{ts|js}` file to your Tailwind config file’s content property. This will ensure that the theme’s styles are included in your project’s CSS:
36
+
Finally, you'll need to add the `formkit.theme.{ts|js}` file to your CSS using a `@source` directive. This ensures Tailwind scans the theme file for class names to include in your CSS:
37
37
38
+
```css
39
+
/* main.css (or your primary CSS file) */
40
+
@import"tailwindcss";
41
+
@source "./formkit.theme.ts";
42
+
@source "./formkit.config.ts";
43
+
```
44
+
45
+
::Callout
46
+
---
47
+
type: "tip"
48
+
label: "Tailwind CSS 3"
49
+
---
50
+
If you're using Tailwind CSS 3, add the theme file to your `tailwind.config.js` content array instead:
38
51
```js
39
52
// tailwind.config.js
40
-
/**@type{import('tailwindcss').Config}*/
41
53
module.exports= {
42
54
content: [
43
55
"./app.vue",
44
-
"~/formkit.theme"// <-- add your theme file
45
-
],
46
-
darkMode:'class',
47
-
theme: {
48
-
extend: {},
49
-
},
50
-
plugins: [],
56
+
"./formkit.theme.ts"
57
+
]
51
58
}
52
59
```
60
+
::
53
61
54
62
If you run the command again, you will be taken to [https://themes.formkit.com](https://themes.formkit.com) where you can customize your chosen theme.
0 commit comments