elder_docs 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/frontend/src/App.jsx +23 -7
- data/frontend/src/components/UiConfigurator.jsx +31 -7
- data/lib/elder_docs/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 68f33b151c74c023dd2d59ca3d176bac9e165503197602c122555ef1de3027da
|
|
4
|
+
data.tar.gz: e4bd1f2f70f4f51cdb92c9ff7c74afffeef29384117474f0cdba3f5b9d76725c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 44b63b766ce7a0a4d90939036d73ef172e939e804f36d59932f7bf71e3b646d63b11b5c23680df27f671908f73ecbf103db1d035dd32131eb87ae7fc0c079e5f
|
|
7
|
+
data.tar.gz: e03561a330840664aad9883a2fa042d08c805a49f67c16c685a2b847ed814bb9588d5fc36ce1292d8bc07daef7f0305f830641255dd03bb2b4e79a0d45a3b1db
|
data/frontend/src/App.jsx
CHANGED
|
@@ -16,20 +16,35 @@ function App() {
|
|
|
16
16
|
const ui = data.ui_config
|
|
17
17
|
|
|
18
18
|
if (ui.colors) {
|
|
19
|
-
|
|
19
|
+
// Map config colors to CSS variable names used in index.css
|
|
20
|
+
if (ui.colors.primary) {
|
|
21
|
+
root.style.setProperty('--bd-yellow', ui.colors.primary)
|
|
22
|
+
root.style.setProperty('--bd-primary', ui.colors.primary) // Keep for compatibility
|
|
23
|
+
}
|
|
20
24
|
if (ui.colors.secondary) {
|
|
21
|
-
root.style.setProperty('--bd-
|
|
25
|
+
root.style.setProperty('--bd-charcoal', ui.colors.secondary)
|
|
26
|
+
root.style.setProperty('--bd-border', ui.colors.secondary)
|
|
27
|
+
root.style.setProperty('--bd-ink', ui.colors.secondary)
|
|
28
|
+
root.style.setProperty('--bd-secondary', ui.colors.secondary) // Keep for compatibility
|
|
29
|
+
}
|
|
30
|
+
if (ui.colors.background) {
|
|
31
|
+
root.style.setProperty('--bd-white', ui.colors.background)
|
|
32
|
+
root.style.setProperty('--bd-background', ui.colors.background) // Keep for compatibility
|
|
33
|
+
}
|
|
34
|
+
if (ui.colors.surface) {
|
|
35
|
+
root.style.setProperty('--bd-panel', ui.colors.surface)
|
|
36
|
+
root.style.setProperty('--bd-surface', ui.colors.surface) // Keep for compatibility
|
|
22
37
|
}
|
|
23
|
-
if (ui.colors.background) root.style.setProperty('--bd-background', ui.colors.background)
|
|
24
|
-
if (ui.colors.surface) root.style.setProperty('--bd-surface', ui.colors.surface)
|
|
25
38
|
}
|
|
26
39
|
|
|
27
40
|
if (ui.corner_radius) {
|
|
28
|
-
root.style.setProperty('--bd-
|
|
41
|
+
root.style.setProperty('--bd-radius', ui.corner_radius)
|
|
42
|
+
root.style.setProperty('--bd-corner-radius', ui.corner_radius) // Keep for compatibility
|
|
29
43
|
}
|
|
30
44
|
|
|
31
45
|
if (ui.font_heading) {
|
|
32
|
-
root.style.setProperty('--
|
|
46
|
+
root.style.setProperty('--font-heading', `'${ui.font_heading}', sans-serif`)
|
|
47
|
+
root.style.setProperty('--bd-font-heading', `'${ui.font_heading}', sans-serif`) // Keep for compatibility
|
|
33
48
|
// Dynamically load font
|
|
34
49
|
const link = document.createElement('link')
|
|
35
50
|
link.href = `https://fonts.googleapis.com/css2?family=${ui.font_heading.replace(/\s/g, '+')}:wght@500;600;700&display=swap`
|
|
@@ -40,7 +55,8 @@ function App() {
|
|
|
40
55
|
}
|
|
41
56
|
|
|
42
57
|
if (ui.font_body) {
|
|
43
|
-
root.style.setProperty('--
|
|
58
|
+
root.style.setProperty('--font-body', `'${ui.font_body}', sans-serif`)
|
|
59
|
+
root.style.setProperty('--bd-font-body', `'${ui.font_body}', sans-serif`) // Keep for compatibility
|
|
44
60
|
// Dynamically load font
|
|
45
61
|
const link = document.createElement('link')
|
|
46
62
|
link.href = `https://fonts.googleapis.com/css2?family=${ui.font_body.replace(/\s/g, '+')}:wght@400;500;600&display=swap`
|
|
@@ -147,13 +147,37 @@ const UiConfigurator = () => {
|
|
|
147
147
|
|
|
148
148
|
const applyConfig = (newConfig) => {
|
|
149
149
|
const root = document.documentElement
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
// Map config colors to CSS variable names used in index.css
|
|
151
|
+
if (newConfig.colors.primary) {
|
|
152
|
+
root.style.setProperty('--bd-yellow', newConfig.colors.primary)
|
|
153
|
+
root.style.setProperty('--bd-primary', newConfig.colors.primary) // Keep for compatibility
|
|
154
|
+
}
|
|
155
|
+
if (newConfig.colors.secondary) {
|
|
156
|
+
root.style.setProperty('--bd-charcoal', newConfig.colors.secondary)
|
|
157
|
+
root.style.setProperty('--bd-border', newConfig.colors.secondary)
|
|
158
|
+
root.style.setProperty('--bd-ink', newConfig.colors.secondary)
|
|
159
|
+
root.style.setProperty('--bd-secondary', newConfig.colors.secondary) // Keep for compatibility
|
|
160
|
+
}
|
|
161
|
+
if (newConfig.colors.background) {
|
|
162
|
+
root.style.setProperty('--bd-white', newConfig.colors.background)
|
|
163
|
+
root.style.setProperty('--bd-background', newConfig.colors.background) // Keep for compatibility
|
|
164
|
+
}
|
|
165
|
+
if (newConfig.colors.surface) {
|
|
166
|
+
root.style.setProperty('--bd-panel', newConfig.colors.surface)
|
|
167
|
+
root.style.setProperty('--bd-surface', newConfig.colors.surface) // Keep for compatibility
|
|
168
|
+
}
|
|
169
|
+
if (newConfig.corner_radius) {
|
|
170
|
+
root.style.setProperty('--bd-radius', newConfig.corner_radius)
|
|
171
|
+
root.style.setProperty('--bd-corner-radius', newConfig.corner_radius) // Keep for compatibility
|
|
172
|
+
}
|
|
173
|
+
if (newConfig.font_heading) {
|
|
174
|
+
root.style.setProperty('--font-heading', `'${newConfig.font_heading}', sans-serif`)
|
|
175
|
+
root.style.setProperty('--bd-font-heading', `'${newConfig.font_heading}', sans-serif`) // Keep for compatibility
|
|
176
|
+
}
|
|
177
|
+
if (newConfig.font_body) {
|
|
178
|
+
root.style.setProperty('--font-body', `'${newConfig.font_body}', sans-serif`)
|
|
179
|
+
root.style.setProperty('--bd-font-body', `'${newConfig.font_body}', sans-serif`) // Keep for compatibility
|
|
180
|
+
}
|
|
157
181
|
|
|
158
182
|
// Load fonts
|
|
159
183
|
if (newConfig.font_heading) {
|
data/lib/elder_docs/version.rb
CHANGED