Vulcan/client/components/menu/menu.scss

190 lines
3.6 KiB
SCSS
Raw Normal View History

2015-03-29 15:08:52 +09:00
@function black($opacity){
@return rgba(0,0,0,$opacity);
}
@function white($opacity){
@return rgba(255,255,255,$opacity);
}
$medium-text: #a4a9ab;
$red: #DD3416;
$text: #444444;
2015-03-23 11:28:36 +09:00
// ------------------------------------ Base ------------------------------------ //
2015-03-29 15:08:52 +09:00
.menu-item{
padding: 5px;
margin: 0;
a{
font-size:14px;
}
2015-03-29 15:08:52 +09:00
}
.menu-label{
display: block;
}
.menu-description{
display: block;
font-weight: normal;
font-size: 12px;
margin-top: 2px;
color: $medium-text;
}
.item-admin{
.menu-label:after{
content: "[A]";
font-size: 10px;
color: $red;
display: inline-block;
margin-left: 3px;
}
2015-03-29 15:08:52 +09:00
}
.item-active{
.dark-bg &, .medium-dark-bg &{
background: white(0.1);
}
2015-03-29 15:08:52 +09:00
.light-bg &, .medium-light-bg &, white-bg &{
background: black(0.1);
2014-08-20 17:03:54 +09:00
}
2015-03-23 11:28:36 +09:00
}
2015-03-29 15:08:52 +09:00
.item-active.item-never-active{
background: none;
}
.menu-top-label{
cursor: pointer;
}
2015-03-23 11:28:36 +09:00
// ------------------------------------ List ------------------------------------ //
2015-03-28 10:54:41 +09:00
.menu-list{
2015-03-23 11:28:36 +09:00
.show-more{
display: none;
2014-08-20 17:03:54 +09:00
}
2015-03-28 10:54:41 +09:00
.item-active{
background: black(0.05);
}
2015-03-23 11:28:36 +09:00
}
// ------------------------------------ Hover ------------------------------------ //
2015-03-28 10:54:41 +09:00
.menu-dropdown{
2015-03-23 11:28:36 +09:00
position:relative;
2015-03-28 10:54:41 +09:00
&.menu-has-items{
.menu-top-level{
2015-03-23 11:28:36 +09:00
cursor: pointer;
&:after{
display:inline-block;
position:relative;
top:-1px;
margin-left:4px;
content:"";
font-size:8px;
}
2015-03-23 11:28:36 +09:00
}
&:hover{
2015-03-28 10:54:41 +09:00
.menu-menu{
2015-03-23 11:28:36 +09:00
display:block;
}
2014-08-20 17:03:54 +09:00
}
}
2015-03-28 10:54:41 +09:00
.menu-menu{
2015-03-23 11:28:36 +09:00
display:none;
top:10px;
left:10px;
position:absolute;
padding-top:20px;
z-index: 10000;
&, a, a:link, a:visited{
color: $text;
}
a.button{
color: white;
}
2015-03-28 10:54:41 +09:00
.menu-contents{
2015-03-23 11:28:36 +09:00
background:white;
2015-03-27 14:40:11 +09:00
padding: 10px;
2015-03-23 11:28:36 +09:00
min-width:180px;
border-radius: 3px;
box-shadow: 0 1px 3px black(0.35);
list-style-type: none;
}
}
.show-more{
display: none;
}
2015-03-21 18:43:35 +09:00
}
2015-03-23 11:28:36 +09:00
// ------------------------------------ Accordion ------------------------------------ //
2015-03-28 10:54:41 +09:00
.menu-accordion{
.menu-top-level{
cursor: default;
display: block;
padding: 5px;
position: relative;
/* note: we use a pseudo-element for the border so we can control the opacity indepdently from the color */
&:after{
content: " ";
display: block;
position: absolute;
width: 100%;
height: 1px;
background: currentColor;
bottom: 0px;
left: 0px;
opacity: 0.5;
}
}
2015-03-23 11:28:36 +09:00
/* ------- Show More Button ------- */
.show-more{
2015-03-24 14:30:04 +09:00
// border-top: 1px solid #ccc;
position: relative;
/* note: we use a pseudo-element for the border so we can control the opacity indepdently from the color */
&:before{
content: " ";
display: block;
position: absolute;
width: 100%;
height: 1px;
background: currentColor;
top: 0px;
left: 0px;
opacity: 0.5;
}
2015-03-23 11:28:36 +09:00
padding: 8px 0;
display: none;
text-align: center;
2015-03-24 13:13:04 +09:00
.icon{
2015-03-23 11:28:36 +09:00
display: block;
height: 20px;
width: 20px;
opacity: 0.5;
margin: 0 auto;
}
&:hover{
background: white(0.2);
.show-more-icon{
opacity: 1;
}
}
2015-03-24 13:13:04 +09:00
.icon-close{
2015-03-23 11:28:36 +09:00
display: none;
2015-03-21 18:43:35 +09:00
}
}
2015-03-28 10:54:41 +09:00
&.menu-long .show-more{
display: block; // only show the "show more" button if the menu has more than three items
2015-03-21 18:43:35 +09:00
}
2015-03-28 10:54:41 +09:00
&.menu-open{
2015-03-24 13:13:04 +09:00
.icon-close{
2015-03-21 18:43:35 +09:00
display: block;
}
2015-03-24 13:13:04 +09:00
.icon-open{
2015-03-21 18:43:35 +09:00
display: none;
2015-03-23 11:28:36 +09:00
}
}
/* expand/collapse animation */
2015-03-28 10:54:41 +09:00
.menu-contents{
max-height: 93px;
2015-03-23 11:28:36 +09:00
overflow: hidden;
2015-03-29 15:08:52 +09:00
transition: max-height ease-out 300ms;
2015-03-23 11:28:36 +09:00
}
2015-03-28 10:54:41 +09:00
&.menu-open .menu-contents{
2015-03-23 11:28:36 +09:00
max-height: 999px !important;
2015-03-21 18:43:35 +09:00
}
}