@gluhar/theme 4.1.0 → 6.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -58
- package/dist/module.d.mts +8 -3
- package/dist/module.d.ts +8 -3
- package/dist/module.json +1 -1
- package/dist/module.mjs +72 -13
- package/dist/runtime/theme.css +1 -0
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +29 -24
- package/dist/runtime/composables/useTheme.d.ts +0 -10
- package/dist/runtime/composables/useTheme.js +0 -29
- package/dist/runtime/tailwind/gluharTheme.d.ts +0 -4
- package/dist/runtime/tailwind/gluharTheme.js +0 -55
- package/dist/runtime/tailwind/handleTailwind.d.ts +0 -3
- package/dist/runtime/tailwind/handleTailwind.js +0 -20
package/README.md
CHANGED
|
@@ -5,78 +5,41 @@
|
|
|
5
5
|
[![License][license-src]][license-href]
|
|
6
6
|
[![Nuxt][nuxt-src]][nuxt-href]
|
|
7
7
|
|
|
8
|
-
Gluhar Theme package.
|
|
9
|
-
Configures tailwind setup. Provides composables (useTheme) and utils for working with the theme and colors.
|
|
8
|
+
Gluhar Theme package. Sets up Tailwind CSS v4, ships shared tokens (`theme.css`) and fonts, and hands the CSS breakpoints to `useResponsive()`.
|
|
10
9
|
|
|
11
10
|
[✨ Release Notes](./CHANGELOG.md)
|
|
12
11
|
|
|
13
|
-
##
|
|
12
|
+
## Setup
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
Installed by `@gluhar/app`. It registers `@tailwindcss/vite`; there is no JS Tailwind config. `tailwindcss` is a peer dependency and must be installed in the project.
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
`assets/styles/main.css` (option `gluhar.theme.css`) is added to `nuxt.options.css` unless you list it yourself, e.g. to order it after font CSS:
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
npx nuxi module add @gluhar/theme
|
|
23
|
-
```
|
|
18
|
+
```css
|
|
19
|
+
@import "tailwindcss";
|
|
20
|
+
@import "@gluhar/theme/theme.css";
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
```ts
|
|
32
|
-
import gluharTheme from "@gluhar/theme/gluharTheme";
|
|
33
|
-
import { defu } from "defu";
|
|
34
|
-
|
|
35
|
-
export default {
|
|
36
|
-
// Theme
|
|
37
|
-
theme: defu(
|
|
38
|
-
{
|
|
39
|
-
// Extends
|
|
40
|
-
extend: {
|
|
41
|
-
// Colors
|
|
42
|
-
colors: {
|
|
43
|
-
primary: {
|
|
44
|
-
base: "#3A3A3A",
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
gluharTheme,
|
|
50
|
-
),
|
|
51
|
-
};
|
|
22
|
+
@theme {
|
|
23
|
+
--breakpoint-tablet: 48.0625rem; /* overrides gluhar's 768px */
|
|
24
|
+
--breakpoint-nav: 75.0625rem; /* project-named, also usable as up("nav") */
|
|
25
|
+
--color-brand: #0181d2;
|
|
26
|
+
}
|
|
52
27
|
```
|
|
53
28
|
|
|
54
|
-
|
|
29
|
+
Fluid type is a separate, optional plugin: [`@gluhar/fluid`](../fluid).
|
|
55
30
|
|
|
56
|
-
|
|
31
|
+
## Conventions
|
|
57
32
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
```
|
|
33
|
+
- **Styling lives in the template as utilities, including all responsive styling** (`tablet:`, `desktop:`, project-named variants). `<style>` / `@apply` only for what utilities can't reach (third-party markup, scrollbars, `@layer base`).
|
|
34
|
+
- **CSS owns layout; JS owns behaviour.** Never switch layout on `useResponsive()` flags — they're `false` on the server by design.
|
|
35
|
+
- **Declare breakpoints once, as `--breakpoint-*`** in the main stylesheet or a local file it `@import`s. The module reads them at build time (rem at 16px, `--breakpoint-*: initial` resets) and writes them to `appConfig.gluhar.breakpoints`. Never hardcode breakpoint numbers in JS.
|
|
36
|
+
- Name breakpoints for what they do (`cols`, `nav`) rather than remapping `md`/`lg`.
|
|
63
37
|
|
|
64
|
-
|
|
38
|
+
## What `theme.css` provides
|
|
65
39
|
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
modules: [
|
|
69
|
-
...,
|
|
70
|
-
"@gluhar/theme"
|
|
71
|
-
],
|
|
40
|
+
`primary-light|base|dark`, `secondary-base`, `accent-base`, `white-base` colours; `tablet` (768) / `desktop` (1200) / `wide` (2000) breakpoints; `tracking-tightest`, `leading-tighter|tightest`, `ease-in-out-expo`; `h-screen-s|l|d`, `flex-0-auto`; class-based `dark:`; Lenis base CSS; and the `@source` that scans `@gluhar/app`'s components.
|
|
72
41
|
|
|
73
|
-
|
|
74
|
-
tailwind: {
|
|
75
|
-
cssPath: '~/assets/main.css'
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
```
|
|
42
|
+
Fonts: `@import "@gluhar/theme/fonts/object-sans";` or `css: ["@gluhar/theme/fonts/object-sans"]`.
|
|
80
43
|
|
|
81
44
|
## Contribution
|
|
82
45
|
|
package/dist/module.d.mts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { ModuleOptions } from '@nuxtjs/tailwindcss';
|
|
3
2
|
|
|
4
3
|
interface GluharThemeOptions {
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The project's main stylesheet, relative to the root dir. Added to
|
|
6
|
+
* `nuxt.options.css` if it isn't there yet, and scanned for
|
|
7
|
+
* `--breakpoint-*`. `false` to manage CSS entirely yourself.
|
|
8
|
+
*/
|
|
9
|
+
css?: string | false;
|
|
6
10
|
}
|
|
7
11
|
declare const _default: _nuxt_schema.NuxtModule<GluharThemeOptions, GluharThemeOptions, false>;
|
|
8
12
|
|
|
9
|
-
export {
|
|
13
|
+
export { _default as default };
|
|
14
|
+
export type { GluharThemeOptions };
|
package/dist/module.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { ModuleOptions } from '@nuxtjs/tailwindcss';
|
|
3
2
|
|
|
4
3
|
interface GluharThemeOptions {
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The project's main stylesheet, relative to the root dir. Added to
|
|
6
|
+
* `nuxt.options.css` if it isn't there yet, and scanned for
|
|
7
|
+
* `--breakpoint-*`. `false` to manage CSS entirely yourself.
|
|
8
|
+
*/
|
|
9
|
+
css?: string | false;
|
|
6
10
|
}
|
|
7
11
|
declare const _default: _nuxt_schema.NuxtModule<GluharThemeOptions, GluharThemeOptions, false>;
|
|
8
12
|
|
|
9
|
-
export {
|
|
13
|
+
export { _default as default };
|
|
14
|
+
export type { GluharThemeOptions };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,25 +1,84 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { existsSync, readFileSync } from 'fs';
|
|
2
|
+
import { resolve, dirname } from 'path';
|
|
3
|
+
import { useLogger, defineNuxtModule, createResolver, addVitePlugin } from '@nuxt/kit';
|
|
4
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
5
|
+
import { defu } from 'defu';
|
|
4
6
|
|
|
5
|
-
const
|
|
7
|
+
const REM = 16;
|
|
8
|
+
const readBreakpoints = (file, into = {}, seen = /* @__PURE__ */ new Set()) => {
|
|
9
|
+
if (seen.has(file) || !existsSync(file))
|
|
10
|
+
return into;
|
|
11
|
+
seen.add(file);
|
|
12
|
+
const css = readFileSync(file, "utf8").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
13
|
+
const pattern = /@import\s+["'](\.{1,2}\/[^"']+)["']|--breakpoint-(\*|[\w-]+)\s*:\s*([^;]+);/g;
|
|
14
|
+
for (const [, imported, name, value] of css.matchAll(pattern)) {
|
|
15
|
+
if (imported) {
|
|
16
|
+
readBreakpoints(resolve(dirname(file), imported), into, seen);
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (name === "*") {
|
|
20
|
+
if (value?.trim() === "initial")
|
|
21
|
+
for (const key of Object.keys(into))
|
|
22
|
+
delete into[key];
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const match = value?.trim().match(/^([\d.]+)(rem|em|px)?$/);
|
|
26
|
+
if (!match)
|
|
27
|
+
continue;
|
|
28
|
+
const [, amount, unit] = match;
|
|
29
|
+
into[name] = unit === "px" ? Number(amount) : Number(amount) * REM;
|
|
30
|
+
}
|
|
31
|
+
return into;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const logger = useLogger("@gluhar/theme");
|
|
6
35
|
const module = defineNuxtModule({
|
|
7
36
|
meta: {
|
|
8
37
|
name: "@gluhar/theme",
|
|
9
38
|
configKey: "gluharTheme"
|
|
10
39
|
},
|
|
11
|
-
// Default configuration options of the Nuxt module
|
|
12
40
|
defaults: {
|
|
13
|
-
|
|
14
|
-
configPath: path.join(cwd, "config/tailwind.config"),
|
|
15
|
-
cssPath: path.join(cwd, "assets/styles/base.css"),
|
|
16
|
-
exposeConfig: true
|
|
17
|
-
}
|
|
41
|
+
css: "assets/styles/main.css"
|
|
18
42
|
},
|
|
19
43
|
setup(options, nuxt) {
|
|
20
|
-
const { resolve } = createResolver(import.meta.url);
|
|
21
|
-
|
|
22
|
-
|
|
44
|
+
const { resolve: resolveRuntime } = createResolver(import.meta.url);
|
|
45
|
+
addVitePlugin(tailwindcss());
|
|
46
|
+
const css = options.css ? resolve(nuxt.options.rootDir, options.css) : void 0;
|
|
47
|
+
if (css && !existsSync(css)) {
|
|
48
|
+
logger.warn(
|
|
49
|
+
`No stylesheet at ${options.css}. Create it with:
|
|
50
|
+
@import "tailwindcss";
|
|
51
|
+
@import "@gluhar/theme/theme.css";`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
if (css && existsSync(css)) {
|
|
55
|
+
const listed = nuxt.options.css.some(
|
|
56
|
+
(entry) => typeof entry === "string" && resolve(nuxt.options.rootDir, entry.replace(/^[~@]\//, "")) === css
|
|
57
|
+
);
|
|
58
|
+
if (!listed)
|
|
59
|
+
nuxt.options.css.push(css);
|
|
60
|
+
}
|
|
61
|
+
const readAll = () => {
|
|
62
|
+
const breakpoints = readBreakpoints(resolveRuntime("runtime/theme.css"));
|
|
63
|
+
if (css)
|
|
64
|
+
readBreakpoints(css, breakpoints);
|
|
65
|
+
return breakpoints;
|
|
66
|
+
};
|
|
67
|
+
nuxt.options.appConfig.gluhar = defu(
|
|
68
|
+
{ breakpoints: readAll() },
|
|
69
|
+
nuxt.options.appConfig.gluhar
|
|
70
|
+
);
|
|
71
|
+
if (css && nuxt.options.dev) {
|
|
72
|
+
const initial = JSON.stringify(nuxt.options.appConfig.gluhar.breakpoints);
|
|
73
|
+
nuxt.hook("builder:watch", async (_event, path) => {
|
|
74
|
+
if (!path.endsWith(".css"))
|
|
75
|
+
return;
|
|
76
|
+
if (JSON.stringify(readAll()) !== initial) {
|
|
77
|
+
logger.info("Breakpoints changed \u2014 restarting.");
|
|
78
|
+
await nuxt.callHook("restart");
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
23
82
|
}
|
|
24
83
|
});
|
|
25
84
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@source "../../../app/dist/runtime/components";@source "../../../sanity/dist/runtime/components";@custom-variant dark (&:where(.dark, .dark *));@theme{--breakpoint-tablet:48rem;--breakpoint-desktop:75rem;--breakpoint-wide:125rem;--color-primary-light:#333;--color-primary-base:#222;--color-primary-dark:#111;--color-secondary-base:#f9f9f9;--color-accent-base:#faf;--color-white-base:#fff;--tracking-tightest:-0.075em;--leading-tighter:1.18;--leading-tightest:1.1;--ease-in-out-expo:cubic-bezier(0.87,0,0.13,1)}@utility h-screen-s{height:100svh}@utility h-screen-l{height:100lvh}@utility h-screen-d{height:100dvh}@utility flex-0-auto{flex:1 0 auto}html.lenis,html.lenis body{height:auto}.lenis.lenis-smooth{scroll-behavior:auto!important}.lenis.lenis-smooth [data-lenis-prevent]{overscroll-behavior:contain}.lenis.lenis-stopped{overflow:hidden}.lenis.lenis-scrolling iframe{pointer-events:none}
|
package/dist/types.d.mts
CHANGED
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gluhar/theme",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Gluhar Theme package.
|
|
3
|
+
"version": "6.0.0-next.0",
|
|
4
|
+
"description": "Gluhar Theme package. Sets up Tailwind CSS v4, ships shared tokens (theme.css) and fonts, and feeds the CSS breakpoints to useResponsive.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/gluharco/gluhar.git",
|
|
8
|
+
"directory": "packages/theme"
|
|
9
|
+
},
|
|
5
10
|
"license": "MIT",
|
|
6
11
|
"type": "module",
|
|
7
12
|
"exports": {
|
|
8
13
|
".": {
|
|
9
|
-
"types": "./dist/types.d.
|
|
10
|
-
"import": "./dist/module.mjs"
|
|
11
|
-
"require": "./dist/module.cjs"
|
|
14
|
+
"types": "./dist/types.d.mts",
|
|
15
|
+
"import": "./dist/module.mjs"
|
|
12
16
|
},
|
|
13
|
-
"./
|
|
14
|
-
"./fonts/*": "./dist/runtime/fonts/*/stylesheet.css"
|
|
15
|
-
"./styles/*": "./dist/runtime/styles/*.css"
|
|
17
|
+
"./theme.css": "./dist/runtime/theme.css",
|
|
18
|
+
"./fonts/*": "./dist/runtime/fonts/*/stylesheet.css"
|
|
16
19
|
},
|
|
17
|
-
"main": "./dist/module.
|
|
18
|
-
"types": "./dist/types.d.
|
|
20
|
+
"main": "./dist/module.mjs",
|
|
21
|
+
"types": "./dist/types.d.mts",
|
|
19
22
|
"files": [
|
|
20
23
|
"dist",
|
|
21
24
|
"CHANGELOG.md"
|
|
@@ -23,6 +26,7 @@
|
|
|
23
26
|
"scripts": {
|
|
24
27
|
"gluhar": "npm run gluhar --prefix ../.. -- --cwd=$PWD",
|
|
25
28
|
"build": "npm run gluhar build -- -t module",
|
|
29
|
+
"prepack": "npm run build",
|
|
26
30
|
"dev": "nuxi dev playground",
|
|
27
31
|
"dev:build": "nuxi build playground",
|
|
28
32
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
@@ -31,24 +35,25 @@
|
|
|
31
35
|
"test:watch": "vitest watch"
|
|
32
36
|
},
|
|
33
37
|
"dependencies": {
|
|
34
|
-
"@nuxt/kit": "^
|
|
35
|
-
"@
|
|
36
|
-
"defu": "^6.1.4"
|
|
37
|
-
"fluid-tailwind": "^1.0.4",
|
|
38
|
-
"pathe": "^1.1.2",
|
|
39
|
-
"tailwindcss": "^3.4.10"
|
|
38
|
+
"@nuxt/kit": "^4.5.0",
|
|
39
|
+
"@tailwindcss/vite": "^4.3.0",
|
|
40
|
+
"defu": "^6.1.4"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@nuxt/devtools": "latest",
|
|
43
|
-
"@nuxt/eslint-config": "^
|
|
44
|
-
"@nuxt/module-builder": "^0.
|
|
45
|
-
"@nuxt/schema": "^
|
|
46
|
-
"@nuxt/test-utils": "^3.
|
|
47
|
-
"@types/node": "^
|
|
44
|
+
"@nuxt/eslint-config": "^1.9.0",
|
|
45
|
+
"@nuxt/module-builder": "^1.0.3",
|
|
46
|
+
"@nuxt/schema": "^4.5.0",
|
|
47
|
+
"@nuxt/test-utils": "^3.19.2",
|
|
48
|
+
"@types/node": "^22.5.4",
|
|
48
49
|
"changelogen": "^0.5.5",
|
|
49
50
|
"eslint": "^9.10.0",
|
|
50
|
-
"nuxt": "^
|
|
51
|
-
"vitest": "^2.
|
|
51
|
+
"nuxt": "^4.5.0",
|
|
52
|
+
"vitest": "^3.2.4"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"nuxt": "^4.5.0",
|
|
56
|
+
"tailwindcss": "^4.3.0"
|
|
52
57
|
},
|
|
53
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "8773cd99c43cbe6a7dc415e50af8b13a7b8d4daf"
|
|
54
59
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import theme from "#tailwind-config/theme";
|
|
2
|
-
import colors from "#tailwind-config/theme/colors";
|
|
3
|
-
declare const baseColors: readonly ["slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "fuchsia", "purple", "rose", "pink"];
|
|
4
|
-
export type BaseColor = (typeof baseColors)[number];
|
|
5
|
-
export declare const useTheme: () => {
|
|
6
|
-
colors: typeof colors;
|
|
7
|
-
theme: typeof theme;
|
|
8
|
-
baseColors: readonly BaseColor[];
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import theme from "#tailwind-config/theme";
|
|
2
|
-
import colors from "#tailwind-config/theme/colors";
|
|
3
|
-
const baseColors = [
|
|
4
|
-
"slate",
|
|
5
|
-
"gray",
|
|
6
|
-
"zinc",
|
|
7
|
-
"neutral",
|
|
8
|
-
"stone",
|
|
9
|
-
"red",
|
|
10
|
-
"orange",
|
|
11
|
-
"amber",
|
|
12
|
-
"yellow",
|
|
13
|
-
"lime",
|
|
14
|
-
"green",
|
|
15
|
-
"emerald",
|
|
16
|
-
"teal",
|
|
17
|
-
"cyan",
|
|
18
|
-
"sky",
|
|
19
|
-
"blue",
|
|
20
|
-
"indigo",
|
|
21
|
-
"violet",
|
|
22
|
-
"fuchsia",
|
|
23
|
-
"purple",
|
|
24
|
-
"rose",
|
|
25
|
-
"pink"
|
|
26
|
-
];
|
|
27
|
-
export const useTheme = () => {
|
|
28
|
-
return { colors, theme, baseColors };
|
|
29
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export const sansFallbacks = [
|
|
2
|
-
"ui-sans-serif",
|
|
3
|
-
"system-ui",
|
|
4
|
-
"sans-serif",
|
|
5
|
-
"Apple Color Emoji",
|
|
6
|
-
"Segoe UI Emoji",
|
|
7
|
-
"Segoe UI Symbol",
|
|
8
|
-
"Noto Color Emoji"
|
|
9
|
-
];
|
|
10
|
-
const gluharTheme = {
|
|
11
|
-
extend: {
|
|
12
|
-
// Colors
|
|
13
|
-
colors: {
|
|
14
|
-
primary: {
|
|
15
|
-
light: "#333",
|
|
16
|
-
base: "#222",
|
|
17
|
-
dark: "#111"
|
|
18
|
-
},
|
|
19
|
-
secondary: {
|
|
20
|
-
base: "#F9F9F9"
|
|
21
|
-
},
|
|
22
|
-
accent: {
|
|
23
|
-
base: "#ffaaff"
|
|
24
|
-
},
|
|
25
|
-
white: {
|
|
26
|
-
base: "#fff"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
// Spacings
|
|
30
|
-
spacing: {
|
|
31
|
-
"13": "3.25rem",
|
|
32
|
-
"15": "3.75rem",
|
|
33
|
-
"17": "4.25rem",
|
|
34
|
-
"18": "4.5rem",
|
|
35
|
-
"128": "32rem",
|
|
36
|
-
"144": "36rem"
|
|
37
|
-
},
|
|
38
|
-
// Heights
|
|
39
|
-
height: {
|
|
40
|
-
"screen-s": "100svh",
|
|
41
|
-
"screen-l": "100lvh",
|
|
42
|
-
"screen-d": "100dvh"
|
|
43
|
-
},
|
|
44
|
-
// Typography
|
|
45
|
-
letterSpacing: { tightest: "-.075em" },
|
|
46
|
-
lineHeight: { tighter: "1.18", tightest: "1.1" },
|
|
47
|
-
// Layout
|
|
48
|
-
flex: { "0-auto": "1 0 auto" },
|
|
49
|
-
// Easing
|
|
50
|
-
transitionTimingFunction: {
|
|
51
|
-
"in-out-expo": "cubic-bezier(0.87, 0, 0.13, 1)"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
export default gluharTheme;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { addImports, createResolver, installModule } from "@nuxt/kit";
|
|
2
|
-
export const handleTailwind = (options, nuxt) => {
|
|
3
|
-
const { resolve } = createResolver(import.meta.url);
|
|
4
|
-
const { tailwind } = options;
|
|
5
|
-
const config = {
|
|
6
|
-
content: ["assets/styles/**/*.{js,vue,ts}"],
|
|
7
|
-
// content: ["assets/styles/**/*.{js,vue,ts}", extract],
|
|
8
|
-
// plugins: [fluid],
|
|
9
|
-
// Dark mode to be handled with by a class, instead of media
|
|
10
|
-
darkMode: "class"
|
|
11
|
-
};
|
|
12
|
-
installModule("@nuxtjs/tailwindcss", {
|
|
13
|
-
...tailwind,
|
|
14
|
-
config
|
|
15
|
-
});
|
|
16
|
-
addImports({
|
|
17
|
-
name: "gluharTheme",
|
|
18
|
-
from: resolve("runtime/tailwind/gluharTheme")
|
|
19
|
-
});
|
|
20
|
-
};
|