@farming-labs/svelte-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/svelte-theme",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.20",
|
|
4
4
|
"description": "Svelte UI components for @farming-labs/docs — layout, sidebar, TOC, search, and theme toggle",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"svelte": "./src/index.js",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"gray-matter": "^4.0.3",
|
|
74
74
|
"sugar-high": "^0.9.5",
|
|
75
|
-
"@farming-labs/docs": "0.0.2-beta.
|
|
76
|
-
"@farming-labs/svelte": "0.0.2-beta.
|
|
75
|
+
"@farming-labs/docs": "0.0.2-beta.20",
|
|
76
|
+
"@farming-labs/svelte": "0.0.2-beta.20"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"svelte": ">=5.0.0"
|
|
@@ -176,12 +176,16 @@
|
|
|
176
176
|
|
|
177
177
|
function buildLayoutCSS(layout) {
|
|
178
178
|
if (!layout) return "";
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
if (layout.
|
|
182
|
-
if (layout.
|
|
183
|
-
if (
|
|
184
|
-
|
|
179
|
+
const rootVars = [];
|
|
180
|
+
const desktopVars = [];
|
|
181
|
+
if (layout.sidebarWidth) desktopVars.push(`--fd-sidebar-width: ${layout.sidebarWidth}px;`);
|
|
182
|
+
if (layout.contentWidth) rootVars.push(`--fd-content-width: ${layout.contentWidth}px;`);
|
|
183
|
+
if (layout.tocWidth) desktopVars.push(`--fd-toc-width: ${layout.tocWidth}px;`);
|
|
184
|
+
if (rootVars.length === 0 && desktopVars.length === 0) return "";
|
|
185
|
+
const parts = [];
|
|
186
|
+
if (rootVars.length > 0) parts.push(`:root {\n ${rootVars.join("\n ")}\n}`);
|
|
187
|
+
if (desktopVars.length > 0) parts.push(`@media (min-width: 1024px) {\n :root {\n ${desktopVars.join("\n ")}\n }\n}`);
|
|
188
|
+
return parts.join("\n");
|
|
185
189
|
}
|
|
186
190
|
|
|
187
191
|
let overrideCSS = $derived.by(() => {
|