diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-06-26 16:47:16 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-07-20 23:37:00 +0200 |
commit | d6b718584e8aff74a0e76f77d2c1c5689f78cc78 (patch) | |
tree | 6f4322460b0d6e11257e59350308f8ad5e9a40b1 /core | |
parent | 842583038bb54c2787fb7a2d5ebd84a2fec849fd (diff) | |
download | nextcloud-server-d6b718584e8aff74a0e76f77d2c1c5689f78cc78.tar.gz nextcloud-server-d6b718584e8aff74a0e76f77d2c1c5689f78cc78.zip |
Sidebar fix
Fix sidebar and scrollbar on content
Sidebar fixes, and sidebar-width + header-height variables
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/css/apps.scss | 141 | ||||
-rw-r--r-- | core/css/header.scss | 35 | ||||
-rw-r--r-- | core/css/mobile.scss | 2 | ||||
-rw-r--r-- | core/css/styles.scss | 2 | ||||
-rw-r--r-- | core/css/variables.scss | 5 | ||||
-rw-r--r-- | core/js/apps.js | 12 |
6 files changed, 100 insertions, 97 deletions
diff --git a/core/css/apps.scss b/core/css/apps.scss index 411e2623c91..0f189754adb 100644 --- a/core/css/apps.scss +++ b/core/css/apps.scss @@ -16,7 +16,7 @@ * */ -/* BASE STYLING ---------------------------------------------------------- */ +/* BASE STYLING ------------------------------------------------------------ */ h2 { font-size: 20px; @@ -64,24 +64,18 @@ kbd { } -/* APP STYLING -------------------------------------------------------------- */ +/* APP STYLING ------------------------------------------------------------ */ -#app { - height: 100%; - width: 100%; - * { - box-sizing: border-box; - } +#content[class*='app-'] * { + box-sizing: border-box; } -/* APP-NAVIGATION ------------------------------------------------------------*/ - +/* APP-NAVIGATION ------------------------------------------------------------ */ /* Navigation: folder like structure */ - #app-navigation { width: 250px; /* header height */ - height: calc(100vh - 50px); + height: calc(100vh - #{$header-height}); position: fixed; box-sizing: border-box; background-color: var(--color-main-background); @@ -581,54 +575,100 @@ kbd { } } -/* APP-CONTENT ---------------------------------------------------------------*/ + +/* CONTENT --------------------------------------------------------- */ +#content { + /* header height */ + padding-top: $header-height; + box-sizing: border-box; + position: relative; + overflow-x: hidden; + transition: margin-right 300ms ease-in-out; + /* trick: scroll #app-content and not the body + * to avoid double scrollbar with sidebar + */ + max-height: 100vh; + &.with-app-sidebar { + // to force the scrollbar to be visible + // and not under the sidebar + margin-right: 27vw; + max-width: calc(100vw - #{$sidebar-width}); + } +} + +/* APP-CONTENT AND WRAPPER ------------------------------------------ */ /* Part where the content will be loaded into */ #app-content { margin-left: 250px; z-index: 1000; background-color: var(--color-main-background); position: relative; - min-height: calc(100vh - 50px); + min-height: calc(100vh - #{$header-height}); /* no top border for first settings item */ > .section:first-child { border-top: none; } - &.with-app-sidebar { - margin-right: 27%; + + /* if app-content-list is present */ + #app-content-wrapper { + display: flex; + position: relative; + align-items: start; + .app-content-list, + .app-content-detail { + min-height: calc(100vh - #{$header-height}); + max-height: calc(100vh - #{$header-height}); + overflow-x: hidden; + overflow-y: auto; + } + + /* CONTENT DETAILS AFTER LIST*/ + .app-content-detail { + /* grow full width */ + flex-grow: 1; + #app-navigation-toggle-back { + display: none; + } + } } } -/* APP-SIDEBAR ----------------------------------------------------------------*/ - +/* APP-SIDEBAR ------------------------------------------------------------ */ /* - Sidebar: a sidebar to be used within #app-content - have it as first element within app-content in order to shrink other - sibling containers properly. Compare Files app for example. + Sidebar: a sidebar to be used within #content + #app-content will be shrinked properly */ #app-sidebar { position: fixed; - top: 50px; - right: 0; + top: $header-height; left: auto; bottom: 0; - width: 27%; - min-width: 300px; + width: 27vw; + min-width: $sidebar-width; display: block; background: var(--color-main-background); border-left: 1px solid var(--color-border); - -webkit-transition: margin-right 300ms; - transition: margin-right 300ms; overflow-x: hidden; overflow-y: auto; - visibility: visible; z-index: 500; + animation: slideAndShow 300ms ease-in-out; + animation-fill-mode: both; &.disappear { - visibility: hidden; + animation: slideAndHide 300ms ease-in-out; + animation-fill-mode: both; } } +@keyframes slideAndHide { + 0% {right: 0;} + 99% {right: -100%;} + 100% {right: -100%; display: none;} +} +@keyframes slideAndShow { + 0% {right: -100%;} + 100% {right: 0;} +} -/* APP-SETTINGS ---------------------------------------------------------------*/ - +/* APP-SETTINGS ------------------------------------------------------------ */ /* settings area */ #app-settings { // To the bottom w/ flex @@ -714,7 +754,7 @@ kbd { } } -/* GENERAL SECTION ---------------------------------------------------------- */ +/* GENERAL SECTION ------------------------------------------------------------ */ .section { display: block; padding: 30px; @@ -751,7 +791,7 @@ kbd { } } -/* TABS --------------------------------------------------------------------- */ +/* TABS ------------------------------------------------------------ */ .tabHeaders { display: inline-block; margin: 15px; @@ -784,7 +824,7 @@ kbd { } } -/* POPOVER MENU ------------------------------------------------------------- */ +/* POPOVER MENU ------------------------------------------------------------ */ $popoveritem-height: 38px; $popovericon-size: 16px; @@ -1004,29 +1044,8 @@ $popovericon-size: 16px; } } - -/* CONTENT WRAPPER --------------------------------------------------------- */ -#content { - /* header height */ - padding-top: 50px; - box-sizing: border-box; - position: relative; -} -/* if app-content-list is present */ -#app-content-wrapper { - display: flex; - position: relative; - align-items: start; - .app-content-list, - .app-content-detail { - min-height: calc(100vh - 50px); - max-height: calc(100vh - 50px); - overflow-x: hidden; - overflow-y: auto; - } -} -/* CONTENT LIST ------------------------------------------------------------- */ +/* CONTENT LIST ------------------------------------------------------------ */ .app-content-list { width: 300px; border-right: 1px solid var(--color-border); @@ -1179,13 +1198,3 @@ $popovericon-size: 16px; } } -/* CONTENT ------------------------------------------------------------------ */ -.app-content-detail { - /* grow full width */ - flex-grow: 1; - - #app-navigation-toggle-back { - display: none; - } -} - diff --git a/core/css/header.scss b/core/css/header.scss index a3566f9a21e..7aeaed92265 100644 --- a/core/css/header.scss +++ b/core/css/header.scss @@ -49,7 +49,7 @@ left: 0; right: 0; z-index: 2000; - height: 50px; + height: $header-height; background-color: var(--color-primary); box-sizing: border-box; justify-content: space-between; @@ -81,7 +81,7 @@ max-width: 350px; max-height: 280px; right: 5px; - top: 50px; + top: $header-height; margin: 0; &:not(.popovermenu) { @@ -165,7 +165,7 @@ display: flex; justify-content: center; align-items: center; - width: 50px; + width: $header-height; height: 100%; cursor: pointer; opacity: 0.6; @@ -224,9 +224,9 @@ /* NAVIGATION --------------------------------------------------------------- */ nav[role='navigation'] { display: inline-block; - width: 50px; - height: 50px; - margin-left: -50px; + width: $header-height; + height: $header-height; + margin-left: -$header-height; } .header-left #navigation { @@ -439,28 +439,21 @@ nav[role='navigation'] { /* Apps menu */ #appmenu { - display: inline-block; - width: auto; - min-width: 50px; - height: 100%; - clear: both; + display: inline-flex; + min-width: $header-height; li { - float: left; - display: inline-block; position: relative; - vertical-align: top !important; - height: 100%; cursor: pointer; a { position: relative; - display: inline-block; + display: flex; margin: 0; - padding: 15px 15px; - height: 20px; - text-align: center; - vertical-align: top !important; + height: $header-height; + width: $header-height; + align-items: center; + justify-content: center; opacity: .6; } } @@ -582,7 +575,7 @@ nav[role='navigation'] { &:focus, &:active { - top: 50px; + top: $header-height; } } diff --git a/core/css/mobile.scss b/core/css/mobile.scss index 646fb65474c..fa3f0ff20e4 100644 --- a/core/css/mobile.scss +++ b/core/css/mobile.scss @@ -84,7 +84,7 @@ #app-navigation-toggle { position: fixed; display: inline-block !important; - top: 50px; + top: $header-height; left: 0; width: 44px; height: 44px; diff --git a/core/css/styles.scss b/core/css/styles.scss index a4e8f62e9a0..30aa25d183c 100644 --- a/core/css/styles.scss +++ b/core/css/styles.scss @@ -819,7 +819,7 @@ span.ui-icon { } .content { - max-height: calc(100% - 50px); + max-height: calc(100% - $header-height); height: 100%; overflow-y: auto; diff --git a/core/css/variables.scss b/core/css/variables.scss index 3cf77849395..86264dc5588 100644 --- a/core/css/variables.scss +++ b/core/css/variables.scss @@ -75,3 +75,8 @@ $color-border-dark: nc-darken($color-main-background, 14%) !default; $border-radius: 3px !default; $font-face: 'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif !default; + + +// various structure data +$header-height: 50px; +$sidebar-width: 300px;
\ No newline at end of file diff --git a/core/js/apps.js b/core/js/apps.js index 8aebbbd418c..b40883e88cf 100644 --- a/core/js/apps.js +++ b/core/js/apps.js @@ -27,9 +27,8 @@ */ exports.Apps.showAppSidebar = function($el) { var $appSidebar = $el || $('#app-sidebar'); - $appSidebar.removeClass('disappear') - .show('slide', { direction: 'right' }, 200); - $('#app-content').addClass('with-app-sidebar', 200).trigger(new $.Event('appresized')); + $appSidebar.removeClass('disappear'); + $('#content').addClass('with-app-sidebar').trigger(new $.Event('appresized')); }; /** @@ -40,11 +39,8 @@ */ exports.Apps.hideAppSidebar = function($el) { var $appSidebar = $el || $('#app-sidebar'); - $appSidebar.hide('slide', { direction: 'right' }, 100, - function() { - $appSidebar.addClass('disappear'); - }); - $('#app-content').removeClass('with-app-sidebar', 100).trigger(new $.Event('appresized')); + $appSidebar.addClass('disappear'); + $('#content').removeClass('with-app-sidebar').trigger(new $.Event('appresized')); }; /** |