mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 15:25:51 +01:00
client/options/keep content centered: simplify the inner workings
This commit is contained in:
@@ -69,13 +69,9 @@ export default class RootContainer extends FlexContainer<BasicWidget> {
|
||||
|
||||
#setMaxContentWidth() {
|
||||
const width = Math.max(options.getInt("maxContentWidth") || 0, 640);
|
||||
const centerContent = options.is("centerContent");
|
||||
|
||||
document.body.style.setProperty("--preferred-max-content-width", `${width}px`);
|
||||
|
||||
// To center the content, "--preferred-content-margin-inline" should be set to "auto".
|
||||
document.body.style.setProperty("--preferred-content-margin-inline",
|
||||
(centerContent) ? "auto" : "unset");
|
||||
document.body.classList.toggle("prefers-centered-content", options.is("centerContent"));
|
||||
}
|
||||
|
||||
#setMotion() {
|
||||
|
||||
Reference in New Issue
Block a user