Header scss optimisation

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2017-01-12 15:18:21 +01:00
parent 00c3f807db
commit 052eb98c18
No known key found for this signature in database
GPG Key ID: FB5ACEED51955BF8
1 changed files with 83 additions and 106 deletions

View File

@ -1,3 +1,10 @@
/**
* @copyright Copyright (c) 2017, John Molakvoæ (skjnldsv@protonmail.com)
*
* @license GNU AGPL version 3 or any later version
*
*/
/* prevent ugly selection effect on accidental selection */ /* prevent ugly selection effect on accidental selection */
#header, #navigation, #expanddiv { #header, #navigation, #expanddiv {
@ -25,7 +32,6 @@
} }
/* HEADERS ------------------------------------------------------------------ */ /* HEADERS ------------------------------------------------------------------ */
#body-user #header, #body-settings #header, #body-public #header { #body-user #header, #body-settings #header, #body-public #header {
position: fixed; position: fixed;
top: 0; top: 0;
@ -39,7 +45,6 @@
} }
/* LOGO and APP NAME -------------------------------------------------------- */ /* LOGO and APP NAME -------------------------------------------------------- */
#nextcloud { #nextcloud {
position: absolute; position: absolute;
top: 0; top: 0;
@ -88,6 +93,16 @@
padding-top: 18px; padding-top: 18px;
padding-right: 10px; padding-right: 10px;
} }
/* show caret indicator next to logo to make clear it is tappable */
.icon-caret {
display: inline-block;
width: 12px;
height: 12px;
margin: 0;
margin-top: -21px;
padding: 0;
vertical-align: middle;
}
} }
/* hover effect for app switcher label */ /* hover effect for app switcher label */
@ -123,7 +138,6 @@
} }
/* show appname next to logo */ /* show appname next to logo */
.header-appname { .header-appname {
display: inline-block; display: inline-block;
position: relative; position: relative;
@ -136,26 +150,14 @@
vertical-align: middle; vertical-align: middle;
} }
/* show caret indicator next to logo to make clear it is tappable */
#header .icon-caret {
display: inline-block;
width: 12px;
height: 12px;
margin: 0;
margin-top: -21px;
padding: 0;
vertical-align: middle;
}
/* do not show menu toggle on public share links as there is no menu */ /* do not show menu toggle on public share links as there is no menu */
#body-public #header .icon-caret { #body-public #header .icon-caret {
display: none; display: none;
} }
/* NAVIGATION --------------------------------------------------------------- */ /* NAVIGATION --------------------------------------------------------------- */
#navigation { #navigation {
position: fixed; position: fixed;
top: 45px; top: 45px;
@ -170,6 +172,7 @@
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 0; border-top-right-radius: 0;
display: none; display: none;
box-sizing: border-box;
/*overflow-y: auto; /*overflow-y: auto;
overflow-x: hidden;*/ overflow-x: hidden;*/
z-index: 2000; z-index: 2000;
@ -185,37 +188,8 @@
border-bottom-color: rgba(255, 255, 255, 0.97); border-bottom-color: rgba(255, 255, 255, 0.97);
border-width: 10px; border-width: 10px;
margin-left: -10px; margin-left: -10px;
left: 47%;
} }
}
/* arrow look */
#expanddiv:after {
bottom: 100%;
border: solid transparent;
content: ' ';
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: rgba(0, 0, 0, 0);
border-bottom-color: rgba(255, 255, 255, 0.97);
border-width: 10px;
margin-left: -10px;
}
/* position of dropdown arrow */
#navigation:after {
left: 47%;
}
#expanddiv:after {
right: 15px;
}
#navigation {
box-sizing: border-box;
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
@ -245,7 +219,10 @@
-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=50)'; -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=50)';
opacity: .5; opacity: .5;
} }
&:hover svg, &:focus svg, &:hover span, &:focus span { &:hover svg,
&:focus svg,
&:hover span,
&:focus span {
-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)'; -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';
opacity: 1; opacity: 1;
} }
@ -256,26 +233,30 @@
} }
} }
} }
} .app-icon {
margin: 0 auto;
/* icon opacity and hover effect */ padding: 0;
max-height: 32px;
#apps-management a { max-width: 32px;
&:hover svg, &:focus svg, &.active svg, &:hover span, &:focus span, &.active span { }
-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)'; /* loading feedback for apps */
opacity: 1; .app-loading {
.icon-loading-dark {
display: inline !important;
position: absolute;
top: 20px;
left: 24px;
width: 32px;
height: 32px;
}
.app-icon {
-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)';
opacity: 0;
}
} }
} }
#navigation .app-icon {
margin: 0 auto;
padding: 0;
max-height: 32px;
max-width: 32px;
}
/* Apps management */ /* Apps management */
#apps-management { #apps-management {
min-height: initial; min-height: initial;
height: initial; height: initial;
@ -285,23 +266,16 @@
-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=30)'; -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=30)';
opacity: .3; opacity: .3;
} }
} /* icon opacity and hover effect */
} &:hover svg,
&:focus svg,
/* loading feedback for apps */ &.active svg,
&:hover span,
#navigation .app-loading { &:focus span,
.icon-loading-dark { &.active span {
display: inline !important; -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';
position: absolute; opacity: 1;
top: 20px; }
left: 24px;
width: 32px;
height: 32px;
}
.app-icon {
-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)';
opacity: 0;
} }
} }
@ -313,7 +287,6 @@
/* USER MENU -----------------------------------------------------------------*/ /* USER MENU -----------------------------------------------------------------*/
/* info part on the right, used e.g. for info on who shared something */ /* info part on the right, used e.g. for info on who shared something */
.header-right { .header-right {
position: absolute; position: absolute;
right: 0; right: 0;
@ -325,21 +298,6 @@
box-sizing: border-box; box-sizing: border-box;
} }
/* Profile picture in header */
#header .avatardiv {
float: left;
display: inline-block;
margin-right: 8px;
cursor: pointer;
height: 32px;
width: 32px;
img {
opacity: 1;
cursor: pointer;
}
}
#settings { #settings {
float: right; float: right;
color: #ddd; color: #ddd;
@ -352,6 +310,7 @@
} }
} }
/* User menu on the right */
#expand { #expand {
display: block; display: block;
padding: 7px 30px 6px 10px; padding: 7px 30px 6px 10px;
@ -374,6 +333,24 @@
.icon-caret { .icon-caret {
margin-top: 0; margin-top: 0;
} }
/* Profile picture in header */
.avatardiv {
float: left;
display: inline-block;
margin-right: 8px;
cursor: pointer;
height: 32px;
width: 32px;
img {
opacity: 1;
cursor: pointer;
}
/* do not show display name when profile picture is present */
&.avatardiv-shown + #expandDisplayName {
display: none;
}
}
} }
#expanddiv { #expanddiv {
@ -389,8 +366,19 @@
border-top-right-radius: 0; border-top-right-radius: 0;
box-sizing: border-box; box-sizing: border-box;
&:after { &:after {
/* position of dropdown arrow */
right: 15px;
border-color: rgba(0, 0, 0, 0); border-color: rgba(0, 0, 0, 0);
border-bottom-color: rgba(255, 255, 255, 1); border-bottom-color: rgba(255, 255, 255, 1);
bottom: 100%;
border: solid transparent;
content: ' ';
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-width: 10px;
margin-left: -10px;
} }
a { a {
display: block; display: block;
@ -410,14 +398,3 @@
} }
} }
} }
/* do not show display name when profile picture is present */
#header {
.avatardiv.avatardiv-shown + #expandDisplayName {
display: none;
}
#expand {
display: block;
}
}