Dropdown styles

stable
Xavier Julián 2015-04-16 12:15:05 +02:00 committed by Juanfran
parent 55120a6e44
commit f4998a3c22
3 changed files with 37 additions and 7 deletions

View File

@ -10,7 +10,8 @@ nav.navbar
div.top-nav-dropdown div.top-nav-dropdown
a(href="", title="Projects") a(href="", title="Projects")
include ../../../../svg/projects.svg include ../../../../svg/projects.svg
ul.project-list div.project-list
ul
- for (var x = 0; x < 5; x++) - for (var x = 0; x < 5; x++)
li li
a(href="#", title="{{ project.title }}") Project 1 a(href="#", title="{{ project.title }}") Project 1

View File

@ -75,3 +75,29 @@
width: #{$arrow-width}; width: #{$arrow-width};
} }
} }
@mixin arrow($arrow-direction, $background-color, $border-color, $border-width, $border-size) {
&:after,
&:before {
#{$arrow-direction}: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
&:after {
border-color: rgba(136, 183, 213, 0);
border-#{$arrow-direction}-color: $background-color;
border-width: $border-size;
margin-left: -$border-size;
}
&:before {
border-color: rgba(0, 0, 0, 0);
border-#{$arrow-direction}-color: $border-color;
border-width: calc($border-size + $border-width);
margin-left: calc(-$border-size + $border-width);
}
}

View File

@ -55,7 +55,7 @@ $top-icon-color: #11241f;
svg path { svg path {
fill: $white; fill: $white;
} }
+.dropdown { +.project-list {
display: block; display: block;
} }
} }
@ -85,8 +85,6 @@ $top-icon-color: #11241f;
position: relative; position: relative;
} }
%dropdown { %dropdown {
background: rgba($black, .85);
border: 1px solid $grayer;
border-radius: 2px; border-radius: 2px;
display: none; display: none;
left: 0; left: 0;
@ -97,5 +95,10 @@ $top-icon-color: #11241f;
} }
.project-list { .project-list {
@extend %dropdown; @extend %dropdown;
background: rgba($blackish, .9);
border: 1px solid $black;
ul {
@include arrow('bottom', rgba($blackish, .9), $black, 2px, 15px);
}
} }
} }