ptut-vhost/webpack/scss/menu.scss

83 lines
2.0 KiB
SCSS
Raw Normal View History

$menu-bg: #163042;
2018-02-20 18:37:45 +00:00
$menu-width: 3em;
$menu-outer-width: #{$menu-width + 1em};
#side-menu{
/* (1) Container
---------------------------------------------------------*/
display: flex;
position: absolute;
top: 0;
left: 0;
2018-02-20 18:37:45 +00:00
width: $menu-outer-width;
height: 100%;
background-color: $menu-bg;
// flex properties
flex-direction: column;
justify-content: space-around;
align-items: center;
/* (2) Items
---------------------------------------------------------*/
.item{
display: block;
2018-02-20 18:37:45 +00:00
width: $menu-width;
height: $menu-width;
border-radius: 3px / 3px;
// box-shadow: inset 0 0 5px darken($menu-bg, 6%);
2018-02-20 18:37:45 +00:00
background: center center no-repeat;
background-size: 50%;
border: 1px solid lighten($menu-bg, 5%);
transition: all .2s ease-in-out;
cursor: pointer;
/* (1) Set icons */
2018-02-20 18:37:45 +00:00
&[data-icon='home']{ background-image: url('/asset/svg/home.svg@bebedd'); }
&[data-icon='manage']{ background-image: url('/asset/svg/manage.svg@bebedd'); }
&[data-icon='fiche']{ background-image: url('/asset/svg/fiche.svg@bebedd'); }
&[data-icon='login']{ background-image: url('/asset/svg/login.svg@bebedd'); }
&[data-icon='logout']{ background-image: url('/asset/svg/logout.svg@bebedd'); }
/* (2) On hover */
&:hover{ border: 1px solid lighten($menu-bg, 20%); }
&[data-icon='home']:hover{ background-image: url('/asset/svg/home.svg@dfdfee'); }
&[data-icon='manage']:hover{ background-image: url('/asset/svg/manage.svg@dfdfee'); }
&[data-icon='fiche']:hover{ background-image: url('/asset/svg/fiche.svg@dfdfee'); }
&[data-icon='login']:hover{ background-image: url('/asset/svg/login.svg@dfdfee'); }
&[data-icon='logout']:hover{ background-image: url('/asset/svg/logout.svg@dfdfee'); }
/* (3) Label */
span{
display: none;
// display: block;
position: absolute;
2018-02-20 18:37:45 +00:00
margin-top: #{$menu-width / 4};
left: calc( 100% + .5em );
padding: .3em .7em;
background-color: $menu-bg;
color: #fff;
border-radius: 3px / 3px;
}
/* (4) Display label on item hover */
&:hover span{ display: block; }
}
}