rn-shiki 0.0.37-26 → 0.0.37-27
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -110,26 +110,24 @@ interface Theme {
|
|
110
110
|
}
|
111
111
|
|
112
112
|
export function getRNStylesFromShikiStyle(theme: Theme): HighlighterStyleSheet {
|
113
|
-
if (!theme)
|
113
|
+
if (!theme)
|
114
114
|
return {}
|
115
|
-
}
|
116
115
|
|
117
116
|
try {
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
117
|
+
// Start with default styles
|
118
|
+
const styles: HighlighterStyleSheet = {
|
119
|
+
editor: {
|
120
|
+
backgroundColor: normalizeColor(theme.colors?.['editor.background']),
|
121
|
+
},
|
122
|
+
base: {
|
123
|
+
color: normalizeColor(theme.colors?.['editor.foreground']),
|
124
|
+
},
|
123
125
|
}
|
124
126
|
|
125
|
-
//
|
126
|
-
if (theme.
|
127
|
-
|
128
|
-
|
129
|
-
}
|
130
|
-
styles.base = {
|
131
|
-
color: normalizeColor(theme.colors['editor.foreground']),
|
132
|
-
}
|
127
|
+
// Process token colors
|
128
|
+
if (theme.tokenColors) {
|
129
|
+
const tokenStyles = convertTokenColorsToReactStyle(theme.tokenColors)
|
130
|
+
Object.assign(styles, tokenStyles)
|
133
131
|
}
|
134
132
|
|
135
133
|
return styles
|