OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/assets/stylesheets/layout/_main_menu.sass

412 lines
11 KiB

//-- copyright
// OpenProject is a project management system.
// Copyright (C) 2012-2018 the OpenProject Foundation (OPF)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2017 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See docs/COPYRIGHT.rdoc for more details.
//++
$toggler-width: 40px
#main-menu,
.main-menu
bottom: auto
@include varprop(width, main-menu-width)
@include varprop(min-width, main-menu-width)
float: left
left: 0
border-right: $main-menu-border-width solid $main-menu-border-color
// min-height is full height minus header and footer.
min-height: calc(100vh - 55px)
@include varprop(background-color, main-menu-bg-color)
//@include default-transition
#menu-sidebar
height: 100%
%absolute-layout-mode &
position: relative
#menu-sidebar
+allow-vertical-scrolling
-ms-overflow-style: -ms-autohiding-scrollbar
ul
margin: 0
padding: 0
&.menu_root
// -------------------- ALL menu items ---------------------------
li
float: none
list-style-type: none
margin: 0
padding: 0
white-space: nowrap
position: relative
min-height: 23px
&.ng-leave
@include animation(0.5s fade-out)
[class*="-menu-item"]
display: flex
align-items: center
// -------------------- MAIN menu items ---------------------------
li
.main-item-wrapper
display: flex
//@include default-transition
&:hover
@if $main-menu-enable-toggle-highlighting != true
// simultaneously hover all menu item anchor tags
> a
@include varprop(color, main-menu-hover-font-color)
&.toggler
@include varprop(background, main-menu-bg-hover-background)
a
//@include default-transition
&.selected, &.selected + a
@include varprop(background, main-menu-bg-selected-background)
&:hover
@include varprop(background, main-menu-bg-hover-background)
&.selected, &.selected + a
@include varprop(color, main-menu-selected-font-color)
&:hover
@include varprop(background, main-menu-bg-hover-background)
@include varprop(color, main-menu-hover-font-color)
// placeholder for highlighted left-item-border
a:not(.toggler)
@extend .small-12
a:not(:only-child):first-of-type
flex: 0 0 calc(100% - 40px)
max-width: calc(100% - 40px)
.open .toggler
.icon-toggler:before
@include icon-mixin-arrow-left1
// padding for placeholder for highlighted left-item-border
a
// work around due to dom manipulation on document: ready:
// this isn't scoped to .main-item-wrapper to avoid flickering
padding-left: 11px
a.toggler
// explicitly reset to zero to avoid selector precedence problems
padding-left: 0
// -------------------- CHILD menu items ---------------------------
ul.menu-children
display: none
padding-top: 10px
padding-bottom: 10px
padding: 0
&.unattached
border-top: 1px solid #ddd
li
&.partial
// NEEDS CLEANUP: resetting styles in partials.
background: initial
&:hover,
li,
li:hover
background: initial
a
@include varprop(color, main-menu-font-color)
padding: initial
&:hover
@include varprop(background, main-menu-child-bg-hover-color)
@if $main-menu-enable-toggle-highlighting != true
// simultaneously hover all menu item anchor tags
> a
@include varprop(color, main-menu-bg-hover-background)
> a
//@include default-transition
&.selected, &.selected + a
@include varprop(background, main-menu-bg-selected-background)
&:hover, &.selected, &.selected + a
@include varprop(color, main-menu-bg-selected-background)
a
// children have no icon so we need to push them right.
padding-left: 32px
&:hover
text-decoration: none
@include varprop(color, main-menu-hover-font-color)
&.selected
border: none !important
@include varprop(color, main-menu-selected-font-color)
a
text-decoration: none
line-height: $main-menu-item-height
display: block
position: relative
height: $main-menu-item-height
@include varprop(color, main-menu-font-color)
font-family: $body-font-family
font-weight: normal
font-size: $main-menu-font-size
font-style: normal
.toggler
width: $toggler-width
height: $main-menu-item-height
text-align: center
.sub-menu-heading
float: left
#toggle-project-menu
background: none
height: 100vh
7 years ago
width: 18px
position: fixed
top: 0px
border-left-width: 2px
border-left-style: solid
border-left-color: transparent
left: calc(#{$main-menu-width} - 2px)
left: calc(var(--main-menu-width) - 2px)
vertical-align: middle
opacity: 0
z-index: 1
%absolute-layout-mode &
z-index: 100
//@include default-transition
&:hover
@include varprop(border-left-color, primary-color)
opacity: 1
&.show
left: calc(#{$main-menu-folded-width} - 1px)
a.navigation-toggler
i:before
@include icon-mixin-arrow-right2
a.navigation-toggler
//@include default-transition
position: absolute
top: 0
height: 40px
7 years ago
width: 16px
text-align: right
padding: 50vh 6px 50vh 0
color: $gray-dark
// Center toggle icon vertically. The element is higher than it looks like.
line-height: 38px
font-size: 11px
&:hover
@include varprop(color, main-menu-navigation-toggler-font-hover-color)
.toggle-follow
position: absolute
width: 140px
.icon-time
background: none
padding: 0
$arrow-left-width: 40px
#main-menu
ul.menu_root
&.closed
li
display: none
> li.open
display: list-item
.main-item-wrapper
display: none
.children-menu-header
padding: 10px
border-bottom: 1px solid
border-bottom: $main-menu-border-width solid $main-menu-border-color
height: calc(#{$main-menu-item-height} + (2 * 10px))
a.arrow-left-to-project
display: inline-block
width: $arrow-left-width
float: left
border-radius: 3px
padding-left: 14px
padding-right: 14px
width: 40px
margin-right: 10px
&:hover
@include varprop(background, main-menu-bg-hover-background)
span.parent-node
display: inline-block
7 years ago
width: calc(100% - #{$arrow-left-width})
height: $main-menu-item-height
line-height: $main-menu-item-height
ul.menu-children
width: 100%
display: block
li
display: list-item
&.open
> li
display: list-item
.children-menu-header
display: none
.hidden-navigation
#main-menu
width: $main-menu-folded-width
min-width: $main-menu-folded-width
ul
&.menu_root
> li
.main-item-wrapper
a:not(:only-child):first-of-type
@extend .small-12
.ellipsis
text-overflow: clip
-o-text-overflow: clip
-ms-text-overflow: clip
.toggler
display: none
#sidebar,
.menu-children
display: none
#sidebar
margin: 30px 0 0 0
padding: 0 17px 0 17px
width: auto
@include varprop(color, main-menu-sidebar-font-color)
font-family: $body-font-family
font-style: normal
overflow: hidden
text-overflow: ellipsis
overflow-wrap: initial
h3
display: block
border: none
@include varprop(color, main-menu-sidebar-h3-color)
font-weight: normal
font-size: $main-menu-sidebar-h3-font-size
margin: 30px 0 8px 0
padding: 10px 0 0 0
text-transform: uppercase
> h3:first-child
margin-top: 0
a, a:link
@include varprop(color, main-menu-sidebar-link-color)
display: inline
position: static
text-decoration: underline
a:hover
text-decoration: underline
label
@include varprop(color, main-menu-sidebar-font-color)
max-width: 80%
vertical-align: top
ul
border: none
overflow-x: hidden
li
border: none
li a
padding: 0
.menu-wiki-pages-tree
border-top: $main-menu-border-width solid $main-menu-border-color
padding-top: 7px
padding-left: 7px
padding-right: 7px
.main-menu--segment-header
color: $gray-dark
text-transform: uppercase
padding-left: $hierarchy-span-width
font-size: 0.8rem
.main-menu--resizer,
main-menu-resizer
background: none
height: 100vh
width: 18px
position: fixed
top: 0px
border-left-width: 2px
border-left-style: solid
border-left-color: transparent
left: calc(#{$main-menu-width} - 2px)
left: calc(var(--main-menu-width) - 2px)
vertical-align: middle
opacity: 0
z-index: 1
cursor: col-resize
%absolute-layout-mode &
z-index: 100
//@include default-transition
&:hover
@include varprop(border-left-color, primary-color)
opacity: 1
&.show
left: calc(#{$main-menu-folded-width} - 1px)
// #main.hidden-navigation
// #main-menu
// ul
// &.menu_root
// // -------------------- MAIN menu items ---------------------------
// > li
// .main-item-wrapper
// a:not(:only-child):first-of-type
// @extend .small-12