@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 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
- ## INFO
12
+ ## Setup
14
13
 
15
- I have set a specific version for `@nuxtjs/tailwindcss` of 6.12.2, because 6.13 messes up with Tailwind Intellisense and does not load the config file correctly. It produces a `.nuxt/tailwind.config.d.ts` file that overrides the actual config and the defined custom classes. (23 Jan 2025)
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
- ## Installation
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
- Install the module to your Nuxt application with one command:
20
-
21
- ```bash
22
- npx nuxi module add @gluhar/theme
23
- ```
18
+ ```css
19
+ @import "tailwindcss";
20
+ @import "@gluhar/theme/theme.css";
24
21
 
25
- ## Tailwind Config
26
-
27
- In your /config folder, create a `tailwind.config.ts` file that is a standard tw config. For theme use gluharTheme from the package and merge with defu.
28
-
29
- Importing the predefined theme like such is meant for vs code tw intellisense to work properly.
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
- Create a `base.css` file to import tailwind's classes and provide initial variables.
29
+ Fluid type is a separate, optional plugin: [`@gluhar/fluid`](../fluid).
55
30
 
56
- In `~/assets/styles/base.css`
31
+ ## Conventions
57
32
 
58
- ```css
59
- @tailwind base
60
- @tailwind components
61
- @tailwind utilities;
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
- If you want your main stylesheet to be named differently, not be sass or be elsewhere, you can config the `cssPath` in nuxt.config.ts:
38
+ ## What `theme.css` provides
65
39
 
66
- ```ts
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
- gluharTheme: {
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.1.0",
4
- "description": "Gluhar Theme package. Configures tailwind setup. Provides composables and utils for working with the theme and colors.",
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.ts",
10
- "import": "./dist/module.mjs",
11
- "require": "./dist/module.cjs"
14
+ "types": "./dist/types.d.mts",
15
+ "import": "./dist/module.mjs"
12
16
  },
13
- "./gluharTheme": "./dist/runtime/tailwind/gluharTheme.js",
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.cjs",
18
- "types": "./dist/types.d.ts",
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": "^3.13.1",
35
- "@nuxtjs/tailwindcss": "6.12.2",
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": "^0.5.6",
44
- "@nuxt/module-builder": "^0.8.3",
45
- "@nuxt/schema": "^3.13.1",
46
- "@nuxt/test-utils": "^3.14.1",
47
- "@types/node": "^20.16.5",
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": "^3.13.1",
51
- "vitest": "^2.0.5"
51
+ "nuxt": "^4.5.0",
52
+ "vitest": "^3.2.4"
52
53
  },
53
- "gitHead": "10ebf6500c71e1beeceece4de90467b26aa67a21"
54
+ "peerDependencies": {
55
+ "nuxt": "^4.5.0",
56
+ "tailwindcss": "^4.3.0"
57
+ }
54
58
  }
package/dist/module.cjs DELETED
@@ -1,5 +0,0 @@
1
- module.exports = function(...args) {
2
- return import('./module.mjs').then(m => m.default.call(this, ...args))
3
- }
4
- const _meta = module.exports.meta = require('./module.json')
5
- module.exports.getMeta = () => Promise.resolve(_meta)
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
@@ -1,9 +0,0 @@
1
- {
2
- "name": "@gluhar/theme",
3
- "configKey": "gluharTheme",
4
- "version": "4.1.0",
5
- "builder": {
6
- "@nuxt/module-builder": "0.8.3",
7
- "unbuild": "2.0.0"
8
- }
9
- }
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
- };
@@ -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,4 +0,0 @@
1
- import type { Config as TailwindConfig } from "tailwindcss/types/config.d";
2
- export declare const sansFallbacks: string[];
3
- declare const gluharTheme: TailwindConfig["theme"];
4
- export default gluharTheme;
@@ -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,3 +0,0 @@
1
- import type { Nuxt } from "@nuxt/schema";
2
- import type { GluharThemeOptions } from "~/src/module";
3
- export declare const handleTailwind: (options: GluharThemeOptions, nuxt: Nuxt) => void;
@@ -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'