separate thems into separate files

This commit is contained in:
SethBurkart123
2024-04-05 09:36:59 +11:00
parent 38c31b88e6
commit f1346ab86e
15 changed files with 340 additions and 295 deletions
+18
View File
@@ -0,0 +1,18 @@
import { CustomTheme } from '../../../interface/types/CustomThemes';
export const removeTheme = (theme: CustomTheme) => {
// Remove custom CSS
const styleElement = document.getElementById('custom-theme');
if (styleElement) {
styleElement.parentNode?.removeChild(styleElement);
}
// Reset default color
//browser.storage.local.set({ selectedColor: '' });
// Remove custom images
const customImageVariables = theme.CustomImages.map((image) => image.variableName);
customImageVariables.forEach((variableName) => {
document.documentElement.style.removeProperty('--' + variableName);
});
};