@uniweb/build 0.5.0 → 0.6.0
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 +4 -3
- package/src/docs.js +3 -3
- package/src/i18n/collections.js +479 -126
- package/src/i18n/index.js +2 -0
- package/src/prerender.js +59 -73
- package/src/runtime-schema.js +36 -7
- package/src/site/collection-processor.js +73 -9
- package/src/site/data-fetcher.js +3 -1
- package/src/site/plugin.js +93 -15
- package/src/theme/css-generator.js +21 -1
- package/src/theme/processor.js +8 -0
|
@@ -134,7 +134,7 @@ function generateContextCSS(context, tokens = {}) {
|
|
|
134
134
|
|
|
135
135
|
const vars = generateVarDeclarations(mergedTokens)
|
|
136
136
|
|
|
137
|
-
return `.context-${context} {\n${vars}\n}`
|
|
137
|
+
return `.context-${context} {\n${vars}\n background-color: var(--bg);\n}`
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
/**
|
|
@@ -305,6 +305,26 @@ export function generateThemeCSS(config = {}) {
|
|
|
305
305
|
sections.push(generateDarkSchemeCSS(appearance))
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
+
// 7. Site background (if specified in theme.yml)
|
|
309
|
+
if (config.background) {
|
|
310
|
+
sections.push(`/* Site Background */\nbody {\n background: ${config.background};\n}`)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// 8. Inline text styles (if specified in theme.yml)
|
|
314
|
+
if (config.inline && typeof config.inline === 'object') {
|
|
315
|
+
const rules = Object.entries(config.inline)
|
|
316
|
+
.filter(([, styles]) => styles && typeof styles === 'object')
|
|
317
|
+
.map(([name, styles]) => {
|
|
318
|
+
const declarations = Object.entries(styles)
|
|
319
|
+
.map(([prop, value]) => ` ${prop}: ${value};`)
|
|
320
|
+
.join('\n')
|
|
321
|
+
return `span[${name}] {\n${declarations}\n}`
|
|
322
|
+
})
|
|
323
|
+
if (rules.length > 0) {
|
|
324
|
+
sections.push('/* Inline Text Styles */\n' + rules.join('\n\n'))
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
308
328
|
return sections.join('\n\n')
|
|
309
329
|
}
|
|
310
330
|
|
package/src/theme/processor.js
CHANGED
|
@@ -422,6 +422,12 @@ export function processTheme(rawConfig = {}, options = {}) {
|
|
|
422
422
|
...(rawConfig.code || {}),
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
+
// Site background (pass through as CSS value)
|
|
426
|
+
const background = rawConfig.background || null
|
|
427
|
+
|
|
428
|
+
// Inline text styles (semantic names → CSS declarations)
|
|
429
|
+
const inline = rawConfig.inline || null
|
|
430
|
+
|
|
425
431
|
const config = {
|
|
426
432
|
colors, // Raw colors for CSS generator
|
|
427
433
|
palettes, // Generated palettes for Theme class
|
|
@@ -430,6 +436,8 @@ export function processTheme(rawConfig = {}, options = {}) {
|
|
|
430
436
|
appearance,
|
|
431
437
|
foundationVars: mergedFoundationVars,
|
|
432
438
|
code, // Code block theme for runtime injection
|
|
439
|
+
background, // Site-level background CSS value
|
|
440
|
+
inline, // Inline text style definitions
|
|
433
441
|
}
|
|
434
442
|
|
|
435
443
|
return { config, errors, warnings }
|