@dheme/next 1.9.0 → 1.10.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 CHANGED
@@ -87,6 +87,7 @@ Fetches the theme on the server and renders inline `<style>` + `<script>` tags.
87
87
  radius: 0.75,
88
88
  saturationAdjust: 10,
89
89
  borderIsColored: false,
90
+ tailwindVersion: 'v4', // 'v3' | 'v4' (default: 'v4')
90
91
  }}
91
92
  defaultMode="light" // 'light' | 'dark' (default: 'light')
92
93
  baseUrl="http://localhost:3005" // Override API URL (optional)
@@ -103,13 +104,15 @@ Fetches the theme on the server and renders inline `<style>` + `<script>` tags.
103
104
  | `baseUrl` | `string` | - | Override API base URL. |
104
105
  | `nonce` | `string` | - | CSP nonce for style and script tags. |
105
106
 
106
- **What it renders:**
107
+ > **`themeParams.tailwindVersion`** controls the CSS variable format in the inlined `<style>`. Use `'v3'` for `hsl(var(--token))` (Tailwind v3 / shadcn/ui) or `'v4'` (default) for `var(--token)` (Tailwind v4 / `@theme inline`). Must match the value used in `<DhemeProvider>`.
108
+
109
+ **What it renders (Tailwind v4 — default):**
107
110
 
108
111
  ```html
109
112
  <!-- CSS for both modes — parsed before paint -->
110
113
  <style>
111
- :root { --background:0 0% 100%; --primary:221.2 83.2% 53.3%; ... }
112
- .dark { --background:222.2 84% 4.9%; --primary:217.2 91.2% 59.8%; ... }
114
+ :root { --background:hsl(0 0% 100%); --primary:hsl(221.2 83.2% 53.3%); ... }
115
+ .dark { --background:hsl(222.2 84% 4.9%); --primary:hsl(217.2 91.2% 59.8%); ... }
113
116
  </style>
114
117
 
115
118
  <!-- Mode detection — applies .dark class if needed -->
@@ -428,10 +431,7 @@ import type {
428
431
  } from '@dheme/next';
429
432
 
430
433
  // Server types
431
- import type {
432
- DhemeScriptProps,
433
- GenerateThemeStylesOptions,
434
- } from '@dheme/next/server';
434
+ import type { DhemeScriptProps, GenerateThemeStylesOptions } from '@dheme/next/server';
435
435
  ```
436
436
 
437
437
  ## Related Packages
package/dist/server.js CHANGED
@@ -99,8 +99,9 @@ async function DhemeScript({
99
99
  }
100
100
  themeCache.set(cacheKey, themeData);
101
101
  }
102
- const lightCSS = (0, import_utils.themeToCSS)(themeData, "light");
103
- const darkCSS = (0, import_utils.themeToCSS)(themeData, "dark");
102
+ const tailwindVersion = params.tailwindVersion ?? "v4";
103
+ const lightCSS = (0, import_utils.themeToCSS)(themeData, "light", tailwindVersion);
104
+ const darkCSS = (0, import_utils.themeToCSS)(themeData, "dark", tailwindVersion);
104
105
  const styleContent = `:root{${lightCSS}}.dark{${darkCSS}}`;
105
106
  const scriptContent = (0, import_utils.getNextBlockingScriptPayload)(defaultMode);
106
107
  const styleProps = {
package/dist/server.mjs CHANGED
@@ -58,8 +58,9 @@ async function DhemeScript({
58
58
  }
59
59
  themeCache.set(cacheKey, themeData);
60
60
  }
61
- const lightCSS = themeToCSS(themeData, "light");
62
- const darkCSS = themeToCSS(themeData, "dark");
61
+ const tailwindVersion = params.tailwindVersion ?? "v4";
62
+ const lightCSS = themeToCSS(themeData, "light", tailwindVersion);
63
+ const darkCSS = themeToCSS(themeData, "dark", tailwindVersion);
63
64
  const styleContent = `:root{${lightCSS}}.dark{${darkCSS}}`;
64
65
  const scriptContent = getNextBlockingScriptPayload(defaultMode);
65
66
  const styleProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dheme/next",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Next.js App Router bindings for Dheme SDK with server-side theme generation",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@dheme/sdk": "^1.1.0",
59
- "@dheme/react": "^2.11.0"
59
+ "@dheme/react": "^2.12.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/react": "^18.2.0",