@farming-labs/nuxt-theme 0.0.2-beta.18 → 0.0.2-beta.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/nuxt-theme",
3
- "version": "0.0.2-beta.18",
3
+ "version": "0.0.2-beta.19",
4
4
  "description": "Nuxt/Vue UI components for @farming-labs/docs — layout, sidebar, TOC, search, and theme toggle",
5
5
  "type": "module",
6
6
  "exports": {
@@ -53,7 +53,7 @@
53
53
  "license": "MIT",
54
54
  "dependencies": {
55
55
  "sugar-high": "^0.9.5",
56
- "@farming-labs/docs": "0.0.2-beta.18"
56
+ "@farming-labs/docs": "0.0.2-beta.19"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "vue": ">=3.0.0",
@@ -132,11 +132,22 @@ function buildTypographyCSS(typo: Record<string, any> | undefined): string {
132
132
  return `:root {\n ${vars.join("\n ")}\n}`;
133
133
  }
134
134
 
135
+ function buildLayoutCSS(layout: Record<string, any> | undefined): string {
136
+ if (!layout) return "";
137
+ const vars: string[] = [];
138
+ if (layout.sidebarWidth) vars.push(`--fd-sidebar-width: ${layout.sidebarWidth}px;`);
139
+ if (layout.contentWidth) vars.push(`--fd-content-width: ${layout.contentWidth}px;`);
140
+ if (layout.tocWidth) vars.push(`--fd-toc-width: ${layout.tocWidth}px;`);
141
+ if (vars.length === 0) return "";
142
+ return `:root {\n ${vars.join("\n ")}\n}`;
143
+ }
144
+
135
145
  const overrideCSS = computed(() => {
136
146
  const colorOverrides = (props.config?.theme as any)?._userColorOverrides
137
147
  ?? (props.config?.theme as any)?.ui?.colors;
138
148
  const typography = (props.config?.theme as any)?.ui?.typography;
139
- return [buildColorsCSS(colorOverrides), buildTypographyCSS(typography)].filter(Boolean).join("\n");
149
+ const layout = (props.config?.theme as any)?.ui?.layout;
150
+ return [buildColorsCSS(colorOverrides), buildTypographyCSS(typography), buildLayoutCSS(layout)].filter(Boolean).join("\n");
140
151
  });
141
152
 
142
153
  useHead(() => ({