From 4298c6081605383abb83f28e752d1a39347e96c6 Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sun, 26 Feb 2017 17:18:27 -0500 Subject: [PATCH] Improve sidebar UI --- assets/stylesheets/components/_mobile.scss | 18 ++++++++---------- assets/stylesheets/components/_settings.scss | 11 +++++++---- assets/stylesheets/components/_sidebar.scss | 12 +++++++++--- views/app.erb | 13 +++++++------ 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/assets/stylesheets/components/_mobile.scss b/assets/stylesheets/components/_mobile.scss index 25b24de7..2992e622 100644 --- a/assets/stylesheets/components/_mobile.scss +++ b/assets/stylesheets/components/_mobile.scss @@ -12,7 +12,7 @@ ._app, ._content { overflow: visible; } - ._container, ._sidebar { + ._container { margin: 0; padding-top: $headerHeight; } @@ -21,26 +21,22 @@ position: static; height: auto; margin: 0; - padding: .75rem 1rem 2rem; + padding: .75rem 1rem 0; &:before { content: none; } } ._booting:before, ._content-loading:before { font-size: 3rem; } - ._header, ._footer { - position: fixed; - width: 100%; - } + ._header { position: fixed; } - ._header, ._list, ._footer { + ._header, ._list, ._sidebar-footer { width: 100%; border-right: 0; box-shadow: none; } - ._settings { position: static; } - ._settings ._sidebar { padding-bottom: $headerHeight; } + ._settings { position: relative; } ._settings-tabs { display: block; } ._header ._settings-btn { width: auto; } @@ -61,11 +57,13 @@ // Sidebar ._sidebar { - position: static; + position: relative; min-height: 100%; overflow: visible; } + ._resizer { display: none; } + ._list-item { white-space: normal; word-wrap: break-word; diff --git a/assets/stylesheets/components/_settings.scss b/assets/stylesheets/components/_settings.scss index 0d08b3c0..97d533e4 100644 --- a/assets/stylesheets/components/_settings.scss +++ b/assets/stylesheets/components/_settings.scss @@ -12,13 +12,16 @@ &._in { display: block; } ._sidebar { - bottom: $headerHeight; + &:after { // padding bottom + content: ''; + display: block; + height: $headerHeight; + } ._sidebar-hidden & { display: block; } } ._header { justify-content: space-between; } - ._footer { box-shadow: 1.25rem 0 $contentBackground; } // cover sidebar scrollbar } // @@ -78,8 +81,8 @@ // Footer // -._footer { - position: absolute; +._sidebar-footer { + position: fixed; z-index: $headerZ; bottom: 0; left: 0; diff --git a/assets/stylesheets/components/_sidebar.scss b/assets/stylesheets/components/_sidebar.scss index a02cba41..5fa619a1 100644 --- a/assets/stylesheets/components/_sidebar.scss +++ b/assets/stylesheets/components/_sidebar.scss @@ -5,11 +5,12 @@ ._sidebar { position: absolute; z-index: $sidebarZ; - top: $headerHeight; + top: 0; bottom: 0; left: 0; overflow-x: hidden; overflow-y: scroll; + padding-top: $headerHeight; background: $sidebarBackground; background-clip: content-box; -webkit-overflow-scrolling: touch; @@ -17,6 +18,11 @@ @extend %border-box; @extend %user-select-none; + @media (-moz-overlay-scrollbars) { + padding-top: 0; + top: $headerHeight; + } + &::-webkit-scrollbar { -webkit-appearance: none; width: 10px; } &::-webkit-scrollbar-button { display: none; } &::-webkit-scrollbar-track { background: $contentBackground; } @@ -41,9 +47,9 @@ ._resizer { position: absolute; - z-index: $sidebarZ; + z-index: $sidebarZ + 1; top: $headerHeight; - bottom: 0; + bottom: $headerHeight; left: $sidebarWidth; margin-left: -2px; width: 3px; diff --git a/views/app.erb b/views/app.erb index e2220d39..1836046e 100644 --- a/views/app.erb +++ b/views/app.erb @@ -47,17 +47,18 @@ -
-