@gluhar/theme 4.1.0 → 6.0.0-next.1
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 +11 -0
- package/README.md +21 -58
- package/package.json +28 -24
- package/dist/module.cjs +0 -5
- package/dist/module.d.mts +0 -9
- package/dist/module.d.ts +0 -9
- package/dist/module.json +0 -9
- package/dist/module.mjs +0 -26
- package/dist/runtime/composables/useTheme.d.ts +0 -10
- package/dist/runtime/composables/useTheme.js +0 -29
- package/dist/runtime/fonts/object-sans/PPObjectSans-Heavy.otf +0 -0
- package/dist/runtime/fonts/object-sans/PPObjectSans-HeavySlanted.otf +0 -0
- package/dist/runtime/fonts/object-sans/PPObjectSans-Regular.otf +0 -0
- package/dist/runtime/fonts/object-sans/PPObjectSans-Slanted.otf +0 -0
- package/dist/runtime/fonts/object-sans/stylesheet.css +0 -1
- 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/dist/types.d.mts +0 -7
- package/dist/types.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.1](https://github.com/gluharco/gluhar/compare/v6.0.0-next.0...v6.0.0-next.1) (2026-10-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### 🚀 Enhancements
|
|
10
|
+
|
|
11
|
+
- **release:** Publish from GitHub Actions with npm trusted publishing ([8773cd9](https://github.com/gluharco/gluhar/commit/8773cd99c43cbe6a7dc415e50af8b13a7b8d4daf))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [4.1.0](https://github.com/gluharco/gluhar/compare/@gluhar/theme@4.0.4...@gluhar/theme@4.1.0) (2026-04-28)
|
|
7
18
|
|
|
8
19
|
|
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/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.1",
|
|
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,24 @@
|
|
|
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"
|
|
52
53
|
},
|
|
53
|
-
"
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"nuxt": "^4.5.0",
|
|
56
|
+
"tailwindcss": "^4.3.0"
|
|
57
|
+
}
|
|
54
58
|
}
|
package/dist/module.cjs
DELETED
package/dist/module.d.mts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { ModuleOptions } from '@nuxtjs/tailwindcss';
|
|
3
|
-
|
|
4
|
-
interface GluharThemeOptions {
|
|
5
|
-
tailwind?: Partial<ModuleOptions>;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: _nuxt_schema.NuxtModule<GluharThemeOptions, GluharThemeOptions, false>;
|
|
8
|
-
|
|
9
|
-
export { type GluharThemeOptions, _default as default };
|
package/dist/module.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { ModuleOptions } from '@nuxtjs/tailwindcss';
|
|
3
|
-
|
|
4
|
-
interface GluharThemeOptions {
|
|
5
|
-
tailwind?: Partial<ModuleOptions>;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: _nuxt_schema.NuxtModule<GluharThemeOptions, GluharThemeOptions, false>;
|
|
8
|
-
|
|
9
|
-
export { type GluharThemeOptions, _default as default };
|
package/dist/module.json
DELETED
package/dist/module.mjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import path from 'pathe';
|
|
2
|
-
import { defineNuxtModule, createResolver, addImportsDir } from '@nuxt/kit';
|
|
3
|
-
import { handleTailwind } from '../dist/runtime/tailwind/handleTailwind.js';
|
|
4
|
-
|
|
5
|
-
const cwd = process.cwd();
|
|
6
|
-
const module = defineNuxtModule({
|
|
7
|
-
meta: {
|
|
8
|
-
name: "@gluhar/theme",
|
|
9
|
-
configKey: "gluharTheme"
|
|
10
|
-
},
|
|
11
|
-
// Default configuration options of the Nuxt module
|
|
12
|
-
defaults: {
|
|
13
|
-
tailwind: {
|
|
14
|
-
configPath: path.join(cwd, "config/tailwind.config"),
|
|
15
|
-
cssPath: path.join(cwd, "assets/styles/base.css"),
|
|
16
|
-
exposeConfig: true
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
setup(options, nuxt) {
|
|
20
|
-
const { resolve } = createResolver(import.meta.url);
|
|
21
|
-
handleTailwind(options, nuxt);
|
|
22
|
-
addImportsDir(resolve("runtime/composables"));
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export { module as default };
|
|
@@ -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
|
-
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
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")}
|
|
@@ -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
|
-
};
|
package/dist/types.d.mts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { NuxtModule } from '@nuxt/schema'
|
|
2
|
-
|
|
3
|
-
import type { default as Module } from './module.js'
|
|
4
|
-
|
|
5
|
-
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
|
-
|
|
7
|
-
export { type GluharThemeOptions, default } from './module.js'
|
package/dist/types.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { NuxtModule } from '@nuxt/schema'
|
|
2
|
-
|
|
3
|
-
import type { default as Module } from './module'
|
|
4
|
-
|
|
5
|
-
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
|
-
|
|
7
|
-
export { type GluharThemeOptions, default } from './module'
|