@gluhar/theme 6.0.0-next.1 → 6.0.0-next.3

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [6.0.0-next.3](https://github.com/gluharco/gluhar/compare/v6.0.0-next.2...v6.0.0-next.3) (2026-10-21)
7
+
8
+ **📝 Note:** Version bump only for package @gluhar/theme
9
+
10
+
11
+
12
+
13
+
6
14
  # [6.0.0-next.1](https://github.com/gluharco/gluhar/compare/v6.0.0-next.0...v6.0.0-next.1) (2026-10-20)
7
15
 
8
16
 
@@ -0,0 +1,14 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface GluharThemeOptions {
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;
10
+ }
11
+ declare const _default: _nuxt_schema.NuxtModule<GluharThemeOptions, GluharThemeOptions, false>;
12
+
13
+ export { _default as default };
14
+ export type { GluharThemeOptions };
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@gluhar/theme",
3
+ "configKey": "gluharTheme",
4
+ "version": "6.0.0-next.3",
5
+ "builder": {
6
+ "@nuxt/module-builder": "1.0.3",
7
+ "unbuild": "3.6.1"
8
+ }
9
+ }
@@ -0,0 +1,79 @@
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';
6
+
7
+ const REM = 16;
8
+ const readBreakpoints = (file, into = {}, seen = /* @__PURE__ */ new Set()) => {
9
+ if (seen.has(file) || !existsSync(file)) return into;
10
+ seen.add(file);
11
+ const css = readFileSync(file, "utf8").replace(/\/\*[\s\S]*?\*\//g, "");
12
+ const pattern = /@import\s+["'](\.{1,2}\/[^"']+)["']|--breakpoint-(\*|[\w-]+)\s*:\s*([^;]+);/g;
13
+ for (const [, imported, name, value] of css.matchAll(pattern)) {
14
+ if (imported) {
15
+ readBreakpoints(resolve(dirname(file), imported), into, seen);
16
+ continue;
17
+ }
18
+ if (name === "*") {
19
+ if (value?.trim() === "initial")
20
+ for (const key of Object.keys(into)) delete into[key];
21
+ continue;
22
+ }
23
+ const match = value?.trim().match(/^([\d.]+)(rem|em|px)?$/);
24
+ if (!match) continue;
25
+ const [, amount, unit] = match;
26
+ into[name] = unit === "px" ? Number(amount) : Number(amount) * REM;
27
+ }
28
+ return into;
29
+ };
30
+
31
+ const logger = useLogger("@gluhar/theme");
32
+ const module$1 = defineNuxtModule({
33
+ meta: {
34
+ name: "@gluhar/theme",
35
+ configKey: "gluharTheme"
36
+ },
37
+ defaults: {
38
+ css: "assets/styles/main.css"
39
+ },
40
+ setup(options, nuxt) {
41
+ const { resolve: resolveRuntime } = createResolver(import.meta.url);
42
+ addVitePlugin(tailwindcss());
43
+ const css = options.css ? resolve(nuxt.options.rootDir, options.css) : void 0;
44
+ if (css && !existsSync(css)) {
45
+ logger.warn(
46
+ `No stylesheet at ${options.css}. Create it with:
47
+ @import "tailwindcss";
48
+ @import "@gluhar/theme/theme.css";`
49
+ );
50
+ }
51
+ if (css && existsSync(css)) {
52
+ const listed = nuxt.options.css.some(
53
+ (entry) => typeof entry === "string" && resolve(nuxt.options.rootDir, entry.replace(/^[~@]\//, "")) === css
54
+ );
55
+ if (!listed) nuxt.options.css.push(css);
56
+ }
57
+ const readAll = () => {
58
+ const breakpoints = readBreakpoints(resolveRuntime("runtime/theme.css"));
59
+ if (css) readBreakpoints(css, breakpoints);
60
+ return breakpoints;
61
+ };
62
+ nuxt.options.appConfig.gluhar = defu(
63
+ { breakpoints: readAll() },
64
+ nuxt.options.appConfig.gluhar
65
+ );
66
+ if (css && nuxt.options.dev) {
67
+ const initial = JSON.stringify(nuxt.options.appConfig.gluhar.breakpoints);
68
+ nuxt.hook("builder:watch", async (_event, path) => {
69
+ if (!path.endsWith(".css")) return;
70
+ if (JSON.stringify(readAll()) !== initial) {
71
+ logger.info("Breakpoints changed \u2014 restarting.");
72
+ await nuxt.callHook("restart");
73
+ }
74
+ });
75
+ }
76
+ }
77
+ });
78
+
79
+ export { module$1 as default };
@@ -0,0 +1 @@
1
+ @font-face{ascent-override:85%;font-family:Object Sans;font-style:normal;font-weight:400;src:url(PPObjectSans-Regular.otf) format("opentype")}@font-face{font-family:Object Sans;font-style:italic;font-weight:400;src:url(PPObjectSans-Slanted.otf) format("opentype")}@font-face{font-family:Object Sans;font-style:normal;font-weight:700;src:url(PPObjectSans-Heavy.otf) format("opentype")}@font-face{font-family:Object Sans;font-style:italic;font-weight:700;src:url(PPObjectSans-HeavySlanted.otf) format("opentype")}
@@ -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}
@@ -0,0 +1,9 @@
1
+ import type { NuxtModule } from '@nuxt/schema'
2
+
3
+ import type { default as Module } from './module.mjs'
4
+
5
+ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
+
7
+ export { default } from './module.mjs'
8
+
9
+ export { type GluharThemeOptions } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gluhar/theme",
3
- "version": "6.0.0-next.1",
3
+ "version": "6.0.0-next.3",
4
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
5
  "repository": {
6
6
  "type": "git",