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

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.19",
3
+ "version": "0.0.2-beta.20",
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.19"
56
+ "@farming-labs/docs": "0.0.2-beta.20"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "vue": ">=3.0.0",
@@ -134,12 +134,16 @@ function buildTypographyCSS(typo: Record<string, any> | undefined): string {
134
134
 
135
135
  function buildLayoutCSS(layout: Record<string, any> | undefined): string {
136
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}`;
137
+ const rootVars: string[] = [];
138
+ const desktopVars: string[] = [];
139
+ if (layout.sidebarWidth) desktopVars.push(`--fd-sidebar-width: ${layout.sidebarWidth}px;`);
140
+ if (layout.contentWidth) rootVars.push(`--fd-content-width: ${layout.contentWidth}px;`);
141
+ if (layout.tocWidth) desktopVars.push(`--fd-toc-width: ${layout.tocWidth}px;`);
142
+ if (rootVars.length === 0 && desktopVars.length === 0) return "";
143
+ const parts: string[] = [];
144
+ if (rootVars.length > 0) parts.push(`:root {\n ${rootVars.join("\n ")}\n}`);
145
+ if (desktopVars.length > 0) parts.push(`@media (min-width: 1024px) {\n :root {\n ${desktopVars.join("\n ")}\n }\n}`);
146
+ return parts.join("\n");
143
147
  }
144
148
 
145
149
  const overrideCSS = computed(() => {