Add custom css and rs classes for it
This commit is contained in:
@@ -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('')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user