Add custom css and rs classes for it

This commit is contained in:
kwaroran
2024-09-09 18:47:30 +09:00
parent 611f3e4b94
commit eb8e1d31c8
10 changed files with 67 additions and 22 deletions

View File

@@ -4,6 +4,7 @@ import { downloadFile } from "../storage/globalApi";
import { BufferToText, selectSingleFile } from "../util";
import { alertError } from "../alert";
import { isLite } from "../lite";
import { CustomCSSStore, SafeModeStore } from "../stores";
export interface ColorScheme{
bgcolor: string;
@@ -179,7 +180,8 @@ export async function importColorScheme(){
}
}
export function updateTextTheme(){
export function updateTextThemeAndCSS(){
let db = get(DataBase)
const root = document.querySelector(':root') as HTMLElement;
if(!root){
@@ -250,4 +252,11 @@ export function updateTextTheme(){
break
}
}
if(!get(SafeModeStore)){
CustomCSSStore.set(db.customCSS ?? '')
}
else{
CustomCSSStore.set('')
}
}