@uniweb/theming 0.1.12 → 0.1.13
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 +1 -1
- package/src/processor.js +8 -34
package/package.json
CHANGED
package/src/processor.js
CHANGED
|
@@ -115,36 +115,6 @@ function normalizeApplyTo(applyTo) {
|
|
|
115
115
|
return cleaned.length ? cleaned : null
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
/**
|
|
119
|
-
* Default code block theme configuration
|
|
120
|
-
* Uses Shiki CSS variable names for compatibility
|
|
121
|
-
* These values are NOT converted to CSS here - the kit's Code component
|
|
122
|
-
* injects them at runtime only when code blocks are used (tree-shaking)
|
|
123
|
-
*/
|
|
124
|
-
const DEFAULT_CODE_THEME = {
|
|
125
|
-
// Background and foreground
|
|
126
|
-
background: '#1e1e2e', // Dark editor background
|
|
127
|
-
foreground: '#cdd6f4', // Default text color
|
|
128
|
-
|
|
129
|
-
// Syntax highlighting colors (Shiki token variables)
|
|
130
|
-
keyword: '#cba6f7', // Purple - keywords (if, else, function)
|
|
131
|
-
string: '#a6e3a1', // Green - strings
|
|
132
|
-
number: '#fab387', // Orange - numbers
|
|
133
|
-
comment: '#6c7086', // Gray - comments
|
|
134
|
-
function: '#89b4fa', // Blue - function names
|
|
135
|
-
variable: '#f5e0dc', // Light pink - variables
|
|
136
|
-
operator: '#89dceb', // Cyan - operators
|
|
137
|
-
punctuation: '#9399b2', // Gray - punctuation
|
|
138
|
-
type: '#f9e2af', // Yellow - types
|
|
139
|
-
constant: '#f38ba8', // Red - constants
|
|
140
|
-
property: '#94e2d5', // Teal - properties
|
|
141
|
-
tag: '#89b4fa', // Blue - HTML/JSX tags
|
|
142
|
-
attribute: '#f9e2af', // Yellow - attributes
|
|
143
|
-
|
|
144
|
-
// UI elements
|
|
145
|
-
lineNumber: '#6c7086', // Line number color
|
|
146
|
-
selection: '#45475a', // Selection background
|
|
147
|
-
}
|
|
148
118
|
|
|
149
119
|
/**
|
|
150
120
|
* Validate color configuration
|
|
@@ -693,10 +663,14 @@ export function processTheme(rawConfig = {}, options = {}) {
|
|
|
693
663
|
// Process code block theme
|
|
694
664
|
// These values are stored for runtime injection by kit's Code component
|
|
695
665
|
// (not converted to CSS here - enables tree-shaking when code blocks aren't used)
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
666
|
+
// Passed through exactly as declared — no defaults filled in.
|
|
667
|
+
//
|
|
668
|
+
// A default palette here would defeat the point of the setting downstream: a
|
|
669
|
+
// site naming a bundled theme and overriding one colour would arrive carrying
|
|
670
|
+
// fifteen, and the theme it named would be overridden in full by values it
|
|
671
|
+
// never asked for. Whoever renders code owns the default; this only carries
|
|
672
|
+
// what the site said.
|
|
673
|
+
const code = rawConfig.code ?? null
|
|
700
674
|
|
|
701
675
|
// Site background (pass through as CSS value)
|
|
702
676
|
const background = rawConfig.background || null
|