We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5a5808 commit 7e3ba57Copy full SHA for 7e3ba57
1 file changed
frontend/webEditor/src/serialize/export.ts
@@ -117,7 +117,14 @@ export class ExportCommand extends Command {
117
118
// add stylesheets
119
const styleHolder = document.createElement("style");
120
- styleHolder.innerHTML = `${themeCss}\n${elementCss}`;
+ // extract light mode variables from them
121
+ const defaultColorsMatch = /:root ({[^}]*})/.exec(themeCss);
122
+ let colors = themeCss;
123
+ if (defaultColorsMatch) {
124
+ colors = `* ${defaultColorsMatch[1]}`;
125
+ }
126
+
127
+ styleHolder.innerHTML = `${colors}\n${elementCss}`;
128
dom.appendChild(styleHolder);
129
130
// render svg into dom
0 commit comments