Store extracted customStyles in uiSettings (#731)

pull/741/head
Joe Krill 2024-02-22 17:28:47 -05:00 committed by GitHub
parent d25eee79f8
commit 29e55ca6b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -81,6 +81,7 @@ export type AppViewState = {
vimMode: boolean;
darkMode: boolean;
forcedROMode: boolean;
customStyles?: string;
};
// Page navigator mode

View File

@ -1087,9 +1087,13 @@ export class Client {
console.error("Failed to load custom styles", e);
}
}
document.getElementById("custom-styles")!.innerHTML = accumulatedCSS.join(
"\n\n",
);
const customStylesContent = accumulatedCSS.join("\n\n");
this.ui.viewDispatch({
type: "set-ui-option",
key: "customStyles",
value: customStylesContent,
});
document.getElementById("custom-styles")!.innerHTML = customStylesContent;
}
}