icingaweb2/public/css/icinga/menu.less

540 lines
9.9 KiB
Plaintext
Raw Normal View History

/*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
2014-02-03 17:03:05 +01:00
#menu [class^="icon-"],
#menu [class*=" icon-"] {
&:before {
width: 1.5em;
}
}
@icon-width: 1.7em; // 1.5em width + 0.2em right margin
#menu {
2017-11-20 17:53:12 +01:00
background-color: @menu-bg-color;
2017-11-27 13:01:43 +01:00
width: 100%;
2019-07-03 16:19:27 +02:00
flex: 1;
2019-07-04 13:33:12 +02:00
overflow: auto;
2019-07-04 16:48:01 +02:00
overflow-x: hidden;
2017-11-27 13:01:43 +01:00
}
#layout:not(.minimal-layout) #menu {
2017-11-20 17:53:12 +01:00
// Space for the #toggle-sidebar button
2017-11-27 13:01:43 +01:00
&:after {
content: "";
display: block;
padding-bottom: 2.25em;
}
2014-02-03 17:03:05 +01:00
}
2017-11-17 15:16:52 +01:00
#menu .nav-item {
vertical-align: middle;
> a {
2019-07-04 13:33:12 +02:00
position: relative;
&:focus {
2017-11-21 15:31:04 +01:00
outline: none;
}
&:hover {
text-decoration: none;
}
2017-11-17 15:16:52 +01:00
}
.nav-level-2 {
z-index: 1;
}
}
#layout:not(.sidebar-collapsed) #menu .nav-item > a {
// Respect overflowing content
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#layout:not(.minimal-layout).sidebar-collapsed #menu .nav-level-1 > .nav-item {
overflow: hidden;
}
#layout:not(.minimal-layout).sidebar-collapsed #menu .nav-level-1 > .nav-item > a {
// Clip overflowing content
overflow: hidden;
width: 4em;
2017-11-17 15:16:52 +01:00
}
#menu .nav-level-1 > .nav-item {
line-height: 2.167em; // 26 px
2017-11-20 17:53:12 +01:00
color: @menu-color;
2014-02-03 17:03:05 +01:00
&.active {
color: @menu-active-color;
> a > .badge {
display: none;
}
2017-11-20 17:53:12 +01:00
background-color: @menu-active-bg-color;
}
2015-09-27 16:34:33 +02:00
&.no-icon > a {
2017-11-22 11:33:38 +01:00
padding-left: @icon-width + .75em;
}
> a {
2017-11-20 17:53:12 +01:00
padding: 0.5em 0.5em 0.5em .75em;
}
2017-11-20 17:53:12 +01:00
&.active:not(.selected) > a:focus,
&.active:not(.selected) > a:hover {
background-color: darken(@menu-active-bg-color, 20);
}
&:not(.selected) > a:hover,
&:not(.selected) > a:focus {
background-color: fade(@menu-bg-color, 50%)
}
2017-11-20 17:53:12 +01:00
// Balance icon weight for non active menu items
&:not(.active) > a > i {
opacity: .8;
}
& > a > .icon-letter:before {
content: attr(data-letter);
font-family: @font-family;
font-weight: 800;
text-transform: uppercase;
}
2015-09-27 16:34:33 +02:00
}
#menu ul:not(.nav-level-2) > .selected > a {
2019-02-28 15:54:55 +01:00
background-color: @menu-highlight-color;
color: @text-color-inverted;
2019-02-28 15:54:55 +01:00
&:hover {
color: @text-color-inverted;
}
&:after {
.transform(rotate(45deg));
position: absolute;
right: -.75em;
background-color: @body-bg-color;
2019-02-28 15:54:55 +01:00
box-shadow: 0 0 1em 0 rgba(0,0,0,0.6);
content: "";
display: block;
height: 1.25em;
margin-top: -1.75em;
width: 1.25em;
}
}
#menu .nav-level-2 > .nav-item {
// Collapse menu by default
2015-09-27 16:34:33 +02:00
display: none;
line-height: 1.833em; // 22px
2015-09-27 16:34:33 +02:00
> a {
2017-11-20 17:53:12 +01:00
color: @menu-2ndlvl-color;
font-size: @font-size-small;
padding: 0.364em 0.545em 0.364em (@icon-width + .75em)/@font-size-small;
}
2017-11-20 17:53:12 +01:00
&.active {
background-color: @menu-highlight-color;
overflow: hidden;
position: relative;
}
2017-11-20 17:53:12 +01:00
// Little caret on active level-2 item
&.active:after {
2019-02-28 15:54:55 +01:00
.transform(rotate(45deg));
2017-11-20 17:53:12 +01:00
background-color: @body-bg-color;
box-shadow: 0 0 1em 0 rgba(0,0,0,.6);
content: "";
display: block;
height: 1.25em;
width: 1.25em;
position: absolute;
top: .5em;
right: -.75em;
z-index: 3;
2017-11-20 17:53:12 +01:00
}
&.active > a {
color: @menu-2ndlvl-highlight-color;
}
2014-02-03 17:03:05 +01:00
}
.no-js #menu .nav-level-2 > .nav-item {
// Expand menu if JavaScript is disabled
2014-02-03 17:03:05 +01:00
display: block;
}
#layout:not(.sidebar-collapsed) {
#menu .nav-level-1 > .nav-item {
&.active {
.nav-level-2 > li {
// Expand menu if active
display: block;
}
}
}
}
#menu img.icon {
line-height: 1;
margin: 0 0.5em -.05em 0.25em;
2014-02-03 17:03:05 +01:00
width: 1em;
}
#menu img[src*="/img/icons/"] {
&:not([src$="tux.png"]):not([src$="win.png"]):not([src$="_white.png"]) {
-webkit-filter: invert(100%);
-moz-filter: invert(100%);
-ms-filter: invert(100%);
filter: invert(100%);
}
2015-09-27 16:34:33 +02:00
}
2017-11-20 17:53:12 +01:00
.nav-item:hover img.icon {
opacity: .6;
}
#menu input.search {
2019-07-04 17:52:41 +02:00
background: transparent url('../img/icons/search_white.png') no-repeat 1em center;
background-size: 1em auto;
border: none;
2017-11-20 17:53:12 +01:00
color: @menu-color;
line-height: 2.167em;
padding: .25em;
2019-07-04 17:52:41 +02:00
padding-left: @icon-width + .75em;
width: 100%;
2014-02-18 19:39:54 +01:00
&.active {
2017-11-20 17:53:12 +01:00
background-color: @menu-active-bg-color;
}
&:hover,
&:focus {
background-color: darken(@menu-bg-color, 20);
}
2014-02-18 19:39:54 +01:00
}
// Badge offset correction
#menu > nav > .nav-level-1 > .badge-nav-item > a > .badge {
margin-top: 0.2em;
2014-03-27 20:39:04 +01:00
}
#menu .nav-level-2 > .badge-nav-item > a > .badge {
margin-top: 0.2em;
2017-11-20 17:53:12 +01:00
margin-right: .5em
2014-03-27 20:39:04 +01:00
}
// Hovered menu
2017-11-27 13:01:43 +01:00
#layout:not(.minimal-layout).sidebar-collapsed #menu .nav-level-1 > .nav-item.hover,
#layout:not(.minimal-layout) #menu .nav-level-1 > .nav-item:not(.active).hover {
> .nav-level-2 {
2017-11-20 17:53:12 +01:00
background-color: @menu-flyout-bg-color;
border: 1px solid @gray-light;
border-radius: .25em;
box-shadow: 0 0 1em 0 rgba(0,0,0,.3);
padding: @vertical-padding 0;
width: 14em;
2017-11-20 17:53:12 +01:00
position: fixed;
2019-07-04 13:33:12 +02:00
z-index: 1;
2019-02-28 15:54:55 +01:00
&:after {
.transform(rotate(45deg));
background-color: @body-bg-color;
border-bottom: 1px solid @gray-light;
border-left: 1px solid @gray-light;
content: "";
display: block;
height: 1.1em;
width: 1.1em;
position: absolute;
top: 1em;
left: -.6em;
z-index: -1;
}
> .nav-item {
display: block;
2017-11-20 17:53:12 +01:00
padding-left: 0;
position: relative;
> a {
color: @menu-flyout-color;
padding-left: 1.5em;
}
2014-03-27 20:39:04 +01:00
&:not(.active) {
2017-11-20 17:53:12 +01:00
&:hover, &:focus {
background-color: @tr-active-color;
}
}
&.active > a {
color: @menu-color;
}
// Hide activity caret when displayed as flyout
&:after {
display: none;
}
}
}
2014-03-27 20:39:04 +01:00
> a > .badge {
display: none;
}
img.icon {
opacity: .6;
}
2014-03-27 20:39:04 +01:00
}
2017-11-27 13:01:43 +01:00
#layout:not(.minimal-layout) #menu .nav-level-1 > .nav-item:not(.active).hover {
> .nav-level-2 {
// Position relative to parent
2017-11-20 17:53:12 +01:00
margin-left: 16em;
margin-top: -3.167em;
}
}
2017-11-27 13:01:43 +01:00
#layout:not(.minimal-layout).sidebar-collapsed #menu .nav-level-1 > .nav-item.hover {
> .nav-level-2 {
// Position relative to parent
2017-11-20 17:53:12 +01:00
margin-left: 4em;
margin-top: -3.333em;
> .badge-nav-item {
display: flex;
align-items: center;
a:not(.badge) {
flex: 1 1 auto;
width: 0;
}
a.badge {
color: @text-color-inverted;
flex: 0 1 auto;
margin-right: 1em;
padding: .25em;
width: auto;
&:hover {
opacity: .6;
}
}
}
}
}
// Accessibility skip links
.skip-links {
2015-03-13 04:18:31 +01:00
position: relative;
font-size: 1/.75em;
ul {
list-style-type: none;
margin: 0;
padding: 0;
li {
2015-03-13 04:18:31 +01:00
display: block;
a, button[type="submit"] {
background-color: @body-bg-color;
2016-11-16 12:54:38 +01:00
border: none;
left: -999px;
padding: @vertical-padding @horizontal-padding;
2015-03-13 04:18:31 +01:00
position: absolute;
width: 100%;
2016-11-16 12:54:38 +01:00
z-index: 1;
&:focus {
left: 0;
2016-11-16 12:54:38 +01:00
outline-offset: -3px;
}
}
2015-03-13 04:18:31 +01:00
button[type="submit"] {
text-align: left;
}
}
}
}
2015-11-16 14:21:08 +01:00
#sidebar.expanded {
2019-05-06 14:49:41 +02:00
#mobile-menu-toggle .icon-menu {
display: none;
}
#mobile-menu-toggle .icon-cancel {
display: inline-block;
}
2015-11-16 14:21:08 +01:00
}
.search-control {
position: relative;
}
.search-input:focus ~ .search-reset:hover {
background-color: darken(@menu-active-bg-color, 20);
}
.search-reset {
background: none;
border: 0;
2017-11-20 17:53:12 +01:00
color: @menu-color;
cursor: pointer;
display: none;
height: 100%;
padding: 0;
2017-11-20 17:53:12 +01:00
user-select: none;
position: absolute;
right: 0;
top: 0;
&:focus,
&:hover {
background-color: darken(@menu-bg-color, 20);
2017-11-20 17:53:12 +01:00
outline: none;
}
}
// Override forms.less
input[type=text].search-input {
padding-right: 1.4em;
text-overflow: ellipsis;
transition: none;
}
.search-input:focus:-moz-placeholder { // FF 18-
color: @gray-light;
}
.search-input:focus::-moz-placeholder { // FF 19+
color: @gray-light;
}
.search-input:focus:-ms-input-placeholder {
color: @gray-light;
}
.search-input:focus::-webkit-input-placeholder {
color: @gray-light;
}
.search-input ~ .search-reset {
opacity: 0;
}
.search-input:valid ~ .search-reset {
display: block;
opacity: 1;
}
.search-input:invalid,
.search-input:-moz-submit-invalid,
.search-input:-moz-ui-invalid {
// Disable glow
box-shadow: none;
}
// Toggle sidebar button
#toggle-sidebar {
font-size: 1/.75em;
// Reset button styles
background: none;
border: none;
padding: 0;
2020-07-27 17:21:21 +02:00
color: @text-color-light;
position: absolute;
bottom: 0.2em;
right: 0;
z-index: 3;
i {
2017-11-20 17:53:12 +01:00
background-color: @body-bg-color;
border-radius: .25em 0 0 .25em;
2017-11-27 13:01:43 +01:00
font-size: 1.125em;
width: 2em;
}
2017-11-21 15:31:04 +01:00
&:focus {
outline: none;
}
&:hover, &:focus {
i {
2017-11-20 17:53:12 +01:00
color: @menu-highlight-color;
}
}
}
html.no-js #toggle-sidebar {
display: none;
}
#layout.minimal-layout #toggle-sidebar {
display: none;
}
#open-sidebar {
display: none;
}
#open-sidebar:before,
#close-sidebar:before {
width: 1.4em;
margin-right: 0;
}
#layout:not(.sidebar-collapsed) #menu .nav-level-1 > .nav-item.active .nav-level-2 > li {
&.nav-item:not(.badge-nav-item) {
&:not(.selected):not(.active):hover,
&:not(.selected):not(.active):focus {
background-color: @menu-2ndlvl-highlight-bg-color;
}
}
}
#layout:not(.sidebar-collapsed) #menu .nav-level-1 > .nav-item.active .nav-level-2 > li,
#layout:not(.sidebar-collapsed) #menu .nav-level-1 > .nav-item:not(.active).hover .nav-level-2 > li {
&.badge-nav-item {
display: flex;
align-items: center;
}
&.badge-nav-item a:not(.badge) {
flex: 1 1 auto;
width: 0;
}
&.badge-nav-item a.badge {
color: @text-color-inverted;
flex: 0 1 auto;
margin-right: 1em;
padding: .25em;
width: auto;
&:hover {
opacity: .6;
}
}
}
#layout:not(.sidebar-collapsed) #menu .nav-level-1 > .nav-item.active .nav-level-2 > li {
&.badge-nav-item:not(.selected) {
&:hover {
background-color: @menu-2ndlvl-highlight-bg-color;
}
}
}