Browse Source

feat: CSS-changeable max-width in wide mode

Michael Schmidt-Korth 4 years ago
parent
commit
1f408d7e34
2 changed files with 2 additions and 1 deletions
  1. 1 0
      resources/css/common.css
  2. 1 1
      src/main/frontend/handler/ui.cljs

+ 1 - 0
resources/css/common.css

@@ -5,6 +5,7 @@
   --ls-page-title-size: 36px;
   --ls-font-family: 'Inter';
   --ls-main-content-max-width: 740px;
+  --ls-main-content-max-width-wide: 100%;
   --ls-border-radius-low: 4px;
   --ls-border-radius-medium: 8px;
 }

+ 1 - 1
src/main/frontend/handler/ui.cljs

@@ -98,7 +98,7 @@
   []
   (let [wide? (state/get-wide-mode?)
         elements (array-seq (js/document.getElementsByClassName "cp__sidebar-main-content"))
-        max-width (if wide? "var(--ls-main-content-max-width)" "100%")]
+        max-width (if wide? "var(--ls-main-content-max-width)" "var(--ls-main-content-max-width-wide)")]
     (when-let [element (first elements)]
       (dom/set-style! element :max-width max-width))
     (state/toggle-wide-mode!)))