@farming-labs/svelte-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/svelte-theme",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.19",
|
|
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.19",
|
|
76
|
+
"@farming-labs/svelte": "0.0.2-beta.19"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"svelte": ">=5.0.0"
|
|
@@ -174,10 +174,21 @@
|
|
|
174
174
|
return `:root {\n ${vars.join("\n ")}\n}`;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
function buildLayoutCSS(layout) {
|
|
178
|
+
if (!layout) return "";
|
|
179
|
+
const vars = [];
|
|
180
|
+
if (layout.sidebarWidth) vars.push(`--fd-sidebar-width: ${layout.sidebarWidth}px;`);
|
|
181
|
+
if (layout.contentWidth) vars.push(`--fd-content-width: ${layout.contentWidth}px;`);
|
|
182
|
+
if (layout.tocWidth) vars.push(`--fd-toc-width: ${layout.tocWidth}px;`);
|
|
183
|
+
if (vars.length === 0) return "";
|
|
184
|
+
return `:root {\n ${vars.join("\n ")}\n}`;
|
|
185
|
+
}
|
|
186
|
+
|
|
177
187
|
let overrideCSS = $derived.by(() => {
|
|
178
188
|
const colorOverrides = config?.theme?._userColorOverrides;
|
|
179
189
|
const typography = config?.theme?.ui?.typography;
|
|
180
|
-
|
|
190
|
+
const layout = config?.theme?.ui?.layout;
|
|
191
|
+
return [buildColorsCSS(colorOverrides), buildTypographyCSS(typography), buildLayoutCSS(layout)].filter(Boolean).join("\n");
|
|
181
192
|
});
|
|
182
193
|
</script>
|
|
183
194
|
|