@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.
@@ -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
 
@@ -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 }