General cool popover mixin

stable
Xavier Julián 2014-06-04 13:53:36 +02:00
parent 1bab78eb08
commit 71f2d9ee1b
4 changed files with 62 additions and 11 deletions

View File

@ -0,0 +1,25 @@
@mixin popover($width, $top:"", $left:"", $bottom:"", $right:"") {
margin: 0;
padding: 0;
list-style-type: none;
position: absolute;
background: $blackish;
color: $white;
font-family: 'DroidSans';
padding: 10px;
top: #{$top};
left: #{$left};
bottom: #{$bottom};
right: #{$right};
width: $width;
display: none;
a {
padding: 10px 2px;
display: block;
@extend .small;
border-bottom: 1px solid $grayer;
&:last-child {
border: none;
}
}
}

View File

@ -20,6 +20,7 @@ $prefix-for-spec: true;
@import 'components/buttons';
@import 'components/avatar';
@import 'components/summary';
@import 'components/popover';
//Layout
@import 'layout/base';

View File

@ -51,27 +51,44 @@
}
}
.user-settings {
}
.user {
width: 80px;
padding: 0 10px;
position: absolute;
bottom: 1em;
a {
text-align: center;
color: $white;
@extend .medium;
.popover {
@include popover(150px, "", 30px, 30px);
a{
text-align: left;
@extend .small;
color: $white;
&:hover {
color: $freshTaiga;
@include transition (color .2s linear);
}
}
}
img{
border: 1px solid transparent;
&:hover {
border: 2px solid $freshTaiga;
@include transition (all .6s ease-in-out);
.user-settings{
position: relative;
img{
border: 1px solid transparent;
width: 100%;
border-radius: 50%;
&:hover {
border: 2px solid $freshTaiga;
@include transition (all .6s ease-in-out);
}
}
}
.settings {
text-align: center;
a {
margin-right: .5em;
color: $whitish;
&:hover {
@include transition (color .3s linear);
color: $freshTaiga;

View File

@ -28,8 +28,16 @@ nav.menu
span.icon.icon-video
span.item Video
div.user
a.avatar(href="", title="User preferences")
img(src="http://thecodeplayer.com/u/uifaces/12.jpg", alt="username")
div.user-settings
ul.popover
li
a(href="", title="Change profile photo") Change profile photo
li
a(href="", title="Account settings") Account settings
li
a(href="", title="Logout") Logout
a.avatar(href="", title="User preferences")
img(src="http://thecodeplayer.com/u/uifaces/12.jpg", alt="username")
div.settings
a(href="", title="User preferences") Pilar
a(href="", title="Site preferences")