NxTIC/css/header.scss

150 lines
2.6 KiB
SCSS
Raw Normal View History

@import 'constants';
#WRAPPER > #HEADER{
/* [1] Barre de recherche
=========================================================*/
& > #searchbar{
display: block;
position: relative;
width: 10%;
margin: 1.3em 0;
padding: .2em 1em;
border: 0;
border-radius: 2em;
background-color: $theme-bg;
transition: transform .3s ease-in-out, width .3s ease-in-out;
// @focus
&:focus{
width: 20%;
}
}
/* [2] Informations utilisateur
=========================================================*/
/* (1) Image du profil */
& > .user-picture{
display: block;
position: relative;
margin-left: 2em;
width: $header-elements;
height: $header-elements;
border-radius: 50% / 50%;
background: $theme-bg url('/f/svg/sample/dy/profile') center center no-repeat;
background-size: auto 100%;
transform: scale(1);
transition: transform .3s ease-in-out;
cursor: default;
align-self: center;
}
/* (2) Username de l'utilisateur */
& > .user-name{
display: block;
position: relative;
margin-left: 1em;
margin-right: 4em;
color: darken($theme-bg, 40);
// flex alignment
align-self: center;
cursor: default;
}
/* [3] Menu deroulant pour l'administration du profil
=========================================================*/
& > .user-panel{
display: block;
position: absolute;
top: $header-height;
right: 0;
margin: 1em;
border-radius: 5px;
border: 1px solid darken($theme-bg, 10);
// box-shadow: 0 0 5px darken($theme-bg, 20);
background-color: #fff;
/* (1) Pour chaque element du menu */
& > span{
display: block;
position: relative;
// On ajoute une ligne en dessous sauf pour le dernier
&:not(:last-child){
border-bottom: 1px solid #ddd;
}
color: #000;
padding: .5em 1em;
padding-left: 2em;
cursor: pointer;
// @hover
&:hover{
background-color: #eee;
}
}
/* (2) Icone d'activation */
&:before{
content: '';
display: block;
position: absolute;
top: -4em;
left: -4.2em;
width: 1em;
height: 1em;
background: url('/f/svg/expand/st/header/999999') center center no-repeat;
background-size: 1em 1em;
cursor: pointer;
// @hover
&:hover{
background-image: url('/f/svg/expand/st/header/ff0000');
}
}
}
/* (3) Gestion de l'activation ou non de l'user panel */
& > #toggle-user-panel{ display: none; }
& > #toggle-user-panel + .user-panel{ left: 100%; }
& > #toggle-user-panel:checked + .user-panel{ left: auto; }
& > #toggle-user-panel:checked + .user-panel:before{ left: 7em; }
}