theme: confirm before downloading code-block css

This commit is contained in:
ammarahm-ed
2023-09-11 12:51:01 +05:00
parent e8e50bebcf
commit 14d6714209

View File

@@ -643,13 +643,25 @@ function exportTheme(theme: ThemeDefinition) {
}),
`${theme.id}.json`
);
const confirmed = window.confirm(
"Do you also want to download code-block.css for this theme?"
);
if (confirmed) {
FileSaver.saveAs(
new Blob([theme.codeBlockCSS], {
type: "text/plain"
}),
`code-block.css`
);
}
}
function themeToJSON(theme: ThemeDefinition) {
return JSON.stringify(
{
$schema: JSON_SCHEMA_URL,
...theme
...theme,
codeBlockCSS: undefined
},
undefined,
2