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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20f0c58e7d2f5a6497d153f05cc9127730b8897b34a0a9ac8a42959e49f263f4
4
- data.tar.gz: e9230ebcf9b18e2e3b2809dd2cd7d2880e6fe346e0d251ea32f3011a579a42f9
3
+ metadata.gz: 68f33b151c74c023dd2d59ca3d176bac9e165503197602c122555ef1de3027da
4
+ data.tar.gz: e4bd1f2f70f4f51cdb92c9ff7c74afffeef29384117474f0cdba3f5b9d76725c
5
5
  SHA512:
6
- metadata.gz: f4b30353dd92332b3a017ca6df2598daeaf96ca4c5ce67b2d0100eaeda4d26b61dd949168440fa8aa60bd3914c81fbfa4c8fed0a303b2e0bbbda16bef3b8fa03
7
- data.tar.gz: e13f040aa72ecea558922a99c678975b324f5860d5e8bd035268b6337eee23bb4ef17d879388f7ce5edaf71fa2e01a53ec95874d9eb647e013bf31adbc3f048a
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
- if (ui.colors.primary) root.style.setProperty('--bd-primary', ui.colors.primary)
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-secondary', ui.colors.secondary)
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-corner-radius', ui.corner_radius)
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('--bd-font-heading', `'${ui.font_heading}', sans-serif`)
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('--bd-font-body', `'${ui.font_body}', sans-serif`)
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
- root.style.setProperty('--bd-primary', newConfig.colors.primary)
151
- root.style.setProperty('--bd-secondary', newConfig.colors.secondary)
152
- root.style.setProperty('--bd-background', newConfig.colors.background)
153
- root.style.setProperty('--bd-surface', newConfig.colors.surface)
154
- root.style.setProperty('--bd-corner-radius', newConfig.corner_radius)
155
- root.style.setProperty('--bd-font-heading', `'${newConfig.font_heading}', sans-serif`)
156
- root.style.setProperty('--bd-font-body', `'${newConfig.font_body}', sans-serif`)
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) {
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ElderDocs
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elder_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ElderDocs