Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
css: Extract variables for the widths of the sidebars.
Tim Abbotted6d5dcf36e7
diff --git a/static/js/scroll_bar.js b/static/js/scroll_bar.jsindex 83ad5f220e1..d388c8a0da0 100644--- a/static/js/scroll_bar.js+++ b/static/js/scroll_bar.js@@ -40,6 +40,9 @@ let sbWidth;export function initialize() {// Workaround for browsers with fixed scrollbarssbWidth = getScrollbarWidth();+ // These need to agree with zulip.css+ const left_sidebar_width = 250;+ const right_sidebar_width = 250;if (sbWidth > 0) {$(".header").css("left", "-" + sbWidth + "px");@@ -52,7 +55,7 @@ export function initialize() {$(".column-right").css("right", sbWidth + "px");$(".app-main .right-sidebar").css({"margin-left": sbWidth + "px",- width: 250 - sbWidth + "px",+ width: right_sidebar_width - sbWidth + "px",});$("#compose").css("left", "-" + sbWidth + "px");@@ -63,12 +66,12 @@ export function initialize() {"<style> @media (min-width: " +media_breakpoints.xl_min +") { .compose-content, .header-main .column-middle { margin-right: " +- (250 + sbWidth) ++ (right_sidebar_width + sbWidth) +"px !important; } } " +"@media (min-width: " +media_breakpoints.md_min +") { .fixed-app .column-middle { margin-left: " +- (250 + sbWidth) ++ (left_sidebar_width + sbWidth) +"px !important; } } " +"</style>",);diff --git a/static/styles/compose.css b/static/styles/compose.cssindex 9627720dd0b..37b5cb4da7f 100644--- a/static/styles/compose.css+++ b/static/styles/compose.css@@ -43,14 +43,12 @@}}+/* Main geometry for this element is in zulip.css */.compose-content {border-top: 1px solid hsla(0, 0%, 0%, 0.07);transition: background-color 200ms linear;padding: 8px 10px 8px 10px;- margin-left: 250px;- margin-right: 250px;- position: relative;border-left: 1px solid hsl(0, 0%, 93%);border-right: 1px solid hsl(0, 0%, 93%);diff --git a/static/styles/zulip.css b/static/styles/zulip.cssindex dc0642ddcb5..7d913ddf7c0 100644--- a/static/styles/zulip.css+++ b/static/styles/zulip.css@@ -18,6 +18,10 @@ go beneath the header.*/$sidebar_top: calc($header_height + $header_padding_bottom);+/* These need to agree with scroll_bar.js */+$left_sidebar_width: 250px;+$right_sidebar_width: 250px;+body,html {width: 100%;@@ -345,21 +349,19 @@ p.n-margin {left: 0;}-.column-left,.column-right {- width: 250px;- max-width: 250px;-}--.column-left {+ width: $right_sidebar_width;+ max-width: $right_sidebar_width;position: absolute;- left: 0;+ right: 0;top: 0;}-.column-right {+.column-left {+ width: $left_sidebar_width;+ max-width: $left_sidebar_width;position: absolute;- right: 0;+ left: 0;top: 0;}@@ -375,7 +377,7 @@ p.n-margin {}.column-left .left-sidebar {- width: 242px;+ width: $left_sidebar_width;padding-left: 0;}@@ -389,9 +391,10 @@ p.n-margin {}}-.column-middle {- margin-right: 250px;- margin-left: 250px;+.column-middle,+.compose-content {+ margin-right: $right_sidebar_width;+ margin-left: $left_sidebar_width;position: relative;}@@ -2772,7 +2775,7 @@ select.inline_select_topic_edit {height: 100%;padding-left: 10px;- width: 250px;+ width: $left_sidebar_width;}}}