grafana/public/sass/components/_sidemenu.scss

285 lines
5.1 KiB
SCSS
Raw Normal View History

$mobile-menu-breakpoint: md;
.sidemenu {
2017-08-17 07:00:41 -05:00
position: fixed;
display: flex;
flex-flow: column;
flex-direction: column;
2016-02-18 12:47:00 -06:00
width: $side-menu-width;
z-index: $zindex-sidemenu;
2016-02-15 08:27:41 -06:00
a:focus {
text-decoration: none;
}
.sidemenu__logo_small_breakpoint {
display: none;
2017-08-17 07:00:41 -05:00
}
.sidemenu__close {
display: none;
2017-08-17 07:00:41 -05:00
}
@include media-breakpoint-up($mobile-menu-breakpoint) {
2020-04-04 08:39:43 -05:00
background: $side-menu-bg;
height: auto;
box-shadow: $side-menu-shadow;
position: relative;
z-index: $zindex-sidemenu;
}
}
// body class that hides sidemenu
.sidemenu-hidden {
.sidemenu {
display: none;
}
}
2017-08-15 07:49:12 -05:00
.sidemenu__top {
padding-top: 40px;
2017-08-15 07:49:12 -05:00
flex-grow: 1;
}
.sidemenu__bottom {
padding-bottom: $spacer;
}
.sidemenu__top,
.sidemenu__bottom {
2017-08-17 07:00:41 -05:00
display: none;
@include media-breakpoint-up($mobile-menu-breakpoint) {
display: block;
}
2017-08-15 07:49:12 -05:00
}
.sidemenu-item {
position: relative;
@include left-brand-border();
@include media-breakpoint-up($mobile-menu-breakpoint) {
&.active,
&:hover {
background-color: $side-menu-item-hover-bg;
@include left-brand-border-gradient();
2017-08-15 07:49:12 -05:00
.dropdown-menu {
border: none;
margin: 0;
display: block;
opacity: 0;
top: 0px;
// important to overlap it otherwise it can be hidden
// again by the mouse getting outside the hover space
left: $side-menu-width - 2px;
@include animation('dropdown-anim 150ms ease-in-out 100ms forwards');
2017-12-19 09:22:41 -06:00
z-index: $zindex-sidemenu;
}
2016-02-15 08:27:41 -06:00
}
}
}
2017-08-15 07:49:12 -05:00
.dropup.sidemenu-item:hover .dropdown-menu {
top: auto !important;
}
.sidemenu-link {
color: $side-menu-icon-color !important;
2017-08-15 07:49:12 -05:00
line-height: 42px;
padding: 0px 10px 0px 10px;
display: block;
position: relative;
font-size: 16px;
border: 1px solid transparent;
2017-10-14 14:17:16 -05:00
text-align: center;
2017-08-15 07:49:12 -05:00
img {
border-radius: 50%;
width: 28px;
height: 28px;
2017-12-19 09:22:41 -06:00
box-shadow: 0 0 14px 2px rgba(255, 255, 255, 0.05);
2017-08-15 07:49:12 -05:00
}
}
@include keyframes(dropdown-anim) {
2016-02-20 08:02:12 -06:00
0% {
opacity: 0;
//transform: translate3d(-5%,0,0);
2016-02-20 08:02:12 -06:00
}
100% {
opacity: 1;
//transform: translate3d(0,0,0);
2016-02-20 08:02:12 -06:00
}
}
2016-02-15 08:27:41 -06:00
.icon-circle {
width: 35px;
height: 35px;
2016-02-15 08:27:41 -06:00
display: inline-block;
@grafana/ui: Create Icon component and replace part of the icons (#23402) * Part1: Unicons implementation (#23197) * Create a new Icon component * Update icons in main sidebar * Update icons in Useful links and in react components on main site * Update icons in Useful links and in main top navigation * Adjust sizing * Update panel navigation and timepicker * Update icons in Panel menu * NewPanelEditor: Fixed so that test alert rule works in new edit mode (#23179) * Update icons in add panel widget * Resolve merge conflict * Fix part of the test errors and type errors * Fix storybook errors * Update getAvailableIcons import in storybook knobs * Fix import path * Fix SyntaxError: Cannot use import statement outside a module in test environment error * Remove dynamic imports * Remove types as using @ts-ignore * Update snapshot test * Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax * Remove color prop from icon, remove color implemetation in mono icons * Update navbar styling * Move toPascalCase to utils/string Co-authored-by: Torkel Ödegaard <torkel@grafana.com> * Resolve type errors resulted from merge * Part2: Unicons implementation (#23266) * Create a new Icon component * Update icons in main sidebar * Update icons in Useful links and in react components on main site * Update icons in Useful links and in main top navigation * Adjust sizing * Update panel navigation and timepicker * Update icons in Panel menu * Update icons in add panel widget * Resolve merge conflict * Fix part of the test errors and type errors * Fix storybook errors * Update getAvailableIcons import in storybook knobs * Fix import path * Fix SyntaxError: Cannot use import statement outside a module in test environment error * Remove dynamic imports * Remove types as using @ts-ignore * Update snapshot test * Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax * Implment icons in Tabs * Implement icons in search items and empty list * Update buttons * Update button-related snapshot tests * Update icons in modals and page headers * Create anfular wrapper and update all icons on search screen * Update sizing, remove colors, update snapshot tests * Remove color prop from icon, remove color implemetation in mono icons * Remove color props from monochrome icons * Complete update of icons for search screen * Update icons for infor tooltips, playlist, permissions * Support temporarly font awesome icons used in enterprise grafana * Part1: Unicons implementation (#23197) * Create a new Icon component * Update icons in main sidebar * Update icons in Useful links and in react components on main site * Update icons in Useful links and in main top navigation * Adjust sizing * Update panel navigation and timepicker * Update icons in Panel menu * NewPanelEditor: Fixed so that test alert rule works in new edit mode (#23179) * Update icons in add panel widget * Resolve merge conflict * Fix part of the test errors and type errors * Fix storybook errors * Update getAvailableIcons import in storybook knobs * Fix import path * Fix SyntaxError: Cannot use import statement outside a module in test environment error * Remove dynamic imports * Remove types as using @ts-ignore * Update snapshot test * Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax * Remove color prop from icon, remove color implemetation in mono icons * Update navbar styling * Move toPascalCase to utils/string Co-authored-by: Torkel Ödegaard <torkel@grafana.com> * Icons update * Add optional chaining to for isFontAwesome variable Co-authored-by: Torkel Ödegaard <torkel@grafana.com> * Part3: Unicons implementation (#23356) * Create a new Icon component * Update icons in main sidebar * Update icons in Useful links and in react components on main site * Update icons in Useful links and in main top navigation * Adjust sizing * Update panel navigation and timepicker * Update icons in Panel menu * Update icons in add panel widget * Resolve merge conflict * Fix part of the test errors and type errors * Fix storybook errors * Update getAvailableIcons import in storybook knobs * Fix import path * Fix SyntaxError: Cannot use import statement outside a module in test environment error * Remove dynamic imports * Remove types as using @ts-ignore * Update snapshot test * Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax * Implment icons in Tabs * Implement icons in search items and empty list * Update buttons * Update button-related snapshot tests * Update icons in modals and page headers * Create anfular wrapper and update all icons on search screen * Update sizing, remove colors, update snapshot tests * Remove color prop from icon, remove color implemetation in mono icons * Remove color props from monochrome icons * Complete update of icons for search screen * Update icons for infor tooltips, playlist, permissions * Support temporarly font awesome icons used in enterprise grafana * Part1: Unicons implementation (#23197) * Create a new Icon component * Update icons in main sidebar * Update icons in Useful links and in react components on main site * Update icons in Useful links and in main top navigation * Adjust sizing * Update panel navigation and timepicker * Update icons in Panel menu * NewPanelEditor: Fixed so that test alert rule works in new edit mode (#23179) * Update icons in add panel widget * Resolve merge conflict * Fix part of the test errors and type errors * Fix storybook errors * Update getAvailableIcons import in storybook knobs * Fix import path * Fix SyntaxError: Cannot use import statement outside a module in test environment error * Remove dynamic imports * Remove types as using @ts-ignore * Update snapshot test * Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax * Remove color prop from icon, remove color implemetation in mono icons * Update navbar styling * Move toPascalCase to utils/string Co-authored-by: Torkel Ödegaard <torkel@grafana.com> * Update icons in Explore * Update icons in alerting * Update + and x buttons * Update icons in configurations and settings * Update close icons * Update icons in rich history * Update alert messages * Add optional chaining to for isFontAwesome variable * Remove icon mock, set up jest.config * Fix navbar plus icon * Fir enable-bacground to enableBackgournd Co-authored-by: Torkel Ödegaard <torkel@grafana.com> * Merge remote branch origin master to icons-unicons * Revert "Merge remote branch origin master to icons-unicons" This reverts commit 3f25d50a39a940883fefe73ce51219139c1ed37f. * Size-up dashnav icons * Fix alerting icons, panel headers, update tests * Fix typecheck error * Adjustments - add panel icon, spacing * Set TerserPlugin sourceMap to false to prevent running out of memory when publishing storybook Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-04-08 07:33:31 -05:00
position: relative;
2017-06-12 09:46:02 -05:00
2016-02-15 08:27:41 -06:00
img {
position: relative;
}
}
2017-06-08 16:13:38 -05:00
.side-menu-header {
2017-06-12 14:11:22 -05:00
padding: 10px 10px 10px 20px;
2017-06-22 17:11:29 -05:00
white-space: nowrap;
2017-06-08 16:13:38 -05:00
background-color: $side-menu-item-hover-bg;
2017-08-15 07:49:12 -05:00
font-size: 17px;
color: $side-menu-header-color;
2016-02-15 08:27:41 -06:00
}
.side-menu-header-link {
color: $side-menu-header-color !important;
border: none !important;
padding: 0 !important;
}
.dropdown-menu--sidemenu > li > .side-menu-header-link:hover {
color: #fff !important;
background-color: $side-menu-item-hover-bg !important;
}
2018-04-16 09:25:28 -05:00
.sidemenu-subtitle {
padding: $space-sm $space-md $space-sm;
font-size: $font-size-sm;
color: $text-color-weak;
2018-04-16 09:25:28 -05:00
border-bottom: 1px solid $dropdownDividerBottom;
margin-bottom: $space-xs;
2018-04-16 09:25:28 -05:00
white-space: nowrap;
}
li.sidemenu-org-switcher {
border-bottom: 1px solid $dropdownDividerBottom;
2016-02-15 08:27:41 -06:00
}
.sidemenu-org-switcher__org-name {
font-size: $font-size-base;
2016-02-15 08:27:41 -06:00
}
.sidemenu-org-switcher__org-current {
font-size: $font-size-xs;
color: $text-color-weak;
position: relative;
top: -2px;
2016-02-15 08:27:41 -06:00
}
.sidemenu-org-switcher__switch {
font-size: $font-size-sm;
padding-left: $space-lg;
display: flex;
align-items: center;
> i.fa.fa-random {
margin-right: $space-xs;
top: 1px;
}
}
2017-08-17 07:00:41 -05:00
.sidemenu__logo {
2017-08-17 07:00:41 -05:00
display: block;
padding: 6px 14px 6px 9px;
2017-08-17 07:00:41 -05:00
min-height: $navbarHeight;
2017-11-01 08:23:46 -05:00
position: relative;
height: $navbarHeight - 1px;
2017-08-17 07:00:41 -05:00
&:hover {
background: lightOrDark($gray33, $gray25);
2017-08-17 07:00:41 -05:00
}
img {
width: 26px;
2017-08-17 07:00:41 -05:00
position: relative;
2017-10-16 02:55:55 -05:00
top: 5px;
left: 8px;
2017-08-17 07:00:41 -05:00
}
}
@include media-breakpoint-down(sm) {
.sidemenu-open--xs {
li {
font-size: $font-size-md;
}
.sidemenu {
width: 100%;
background: $side-menu-bg-mobile;
height: auto;
box-shadow: $side-menu-shadow;
position: relative;
z-index: $zindex-sidemenu;
}
.sidemenu__close {
display: block;
font-size: $font-size-md;
position: relative;
top: -3px;
}
.sidemenu__top,
.sidemenu__bottom {
display: block;
}
.sidemenu-item {
border-right: 2px solid transparent;
}
}
.sidemenu {
.sidemenu__logo {
display: none;
}
.sidemenu__logo_small_breakpoint {
padding: 13px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: baseline;
cursor: pointer;
.fa-bars {
font-size: 25px;
}
}
.sidemenu__top {
padding-top: 0;
}
.side-menu-header {
padding-left: 10px;
}
.sidemenu-link {
text-align: left;
}
.sidemenu-icon {
2017-12-19 09:22:41 -06:00
display: none;
}
.dropdown-menu--sidemenu {
display: block;
position: unset;
width: 100%;
float: none;
2019-03-12 02:10:31 -05:00
margin-bottom: $space-sm;
> li > a {
padding-left: 15px;
}
}
.sidemenu__bottom {
.dropdown-menu--sidemenu {
display: flex;
flex-direction: column-reverse;
}
}
}
}