Ghost/ghost/admin/assets/sass/components/dropdowns.scss

176 lines
3.7 KiB
SCSS
Raw Normal View History

2014-07-29 14:00:29 +04:00
//
// Dropdown Styles
// --------------------------------------------------
// Wrapper
// Does nothing yet...
.dropdown {}
// List
.dropdown-menu {
2014-07-29 20:23:00 +04:00
position: relative;
2014-07-29 14:00:29 +04:00
display: inline-block;
2014-07-29 19:19:00 +04:00
min-width: 160px;
2014-07-29 14:00:29 +04:00
padding: 0.5rem 0;
margin: 0;
2014-07-29 20:23:00 +04:00
font-size: 1.4rem;
line-height: 1;
font-weight: normal;
text-transform: none;
letter-spacing: 0;
2014-07-29 19:19:00 +04:00
background: #fff;
2014-07-29 20:23:00 +04:00
border: #B0BEC4 1px solid;
box-shadow: rgba(0,0,0,0.175) 0 2px 6px;
2014-07-29 19:19:00 +04:00
border-radius: 2px;
2014-07-29 14:00:29 +04:00
2014-07-29 19:19:00 +04:00
// Item Resets - This means we can use any element
2014-07-29 14:00:29 +04:00
li {
list-style: none;
}
2014-07-29 15:46:19 +04:00
&:before {
content: '';
position: absolute;
border-style: solid;
border-color: #fff transparent;
display: block;
width: 0;
} // :before
2014-07-29 14:00:29 +04:00
2014-07-29 15:46:19 +04:00
&:after {
content: '';
position: absolute;
2014-07-31 19:06:25 +04:00
width: ($dropdown_triangle * 1.5);
height: ($dropdown_triangle * 1.5);
background: #B0BEC4;
2014-07-29 15:46:19 +04:00
transform: rotate(45deg);
z-index: -1;
} // :after
2014-07-29 14:00:29 +04:00
2014-07-31 19:06:25 +04:00
} // .dropdown-menu
2014-07-29 20:23:00 +04:00
2014-07-31 19:06:25 +04:00
.dropdown-triangle-top {
2014-07-29 15:46:19 +04:00
&:before {
2014-07-31 19:06:25 +04:00
border-width: 0 $dropdown_triangle $dropdown_triangle $dropdown_triangle;
top: -$dropdown_triangle;
2014-07-29 14:00:29 +04:00
}
2014-07-29 15:46:19 +04:00
&:after {
2014-07-31 19:06:25 +04:00
top: -($dropdown_triangle - 1);
2014-07-29 15:46:19 +04:00
}
2014-07-31 19:06:25 +04:00
}
.dropdown-triangle-bottom {
2014-07-29 15:46:19 +04:00
&:before {
2014-07-31 19:06:25 +04:00
border-width: $dropdown_triangle $dropdown_triangle 0 $dropdown_triangle;
bottom: -$dropdown_triangle;
2014-07-29 15:46:19 +04:00
}
&:after {
2014-07-31 19:06:25 +04:00
bottom: -($dropdown_triangle - 1);
2014-07-29 15:46:19 +04:00
}
2014-07-31 19:06:25 +04:00
}
.dropdown-triangle-center {
&:before {
left: 50%;
margin-left: -$dropdown_triangle;
}
&:after {
left: 50%;
margin-left: -($dropdown_triangle * 1.5 / 2);
}
}
// TODO: Make the values here use the $dropdown_triangle var
.dropdown-triangle-left {
&:before {
left: 10px;
}
&:after {
left: 12px;
}
}
.dropdown-triangle-right {
&:before {
left: auto;
right: 10px;
}
&:after {
left: auto;
right: 12px;
}
}
.dropdown-top {
@extend .dropdown-menu;
@extend .dropdown-triangle-center;
@extend .dropdown-triangle-top;
}
.dropdown-top-left {
@extend .dropdown-menu;
@extend .dropdown-triangle-top;
@extend .dropdown-triangle-left;
}
.dropdown-top-right {
@extend .dropdown-menu;
@extend .dropdown-triangle-top;
@extend .dropdown-triangle-right;
}
.dropdown-bottom {
@extend .dropdown-menu;
@extend .dropdown-triangle-center;
@extend .dropdown-triangle-bottom;
}
.dropdown-bottom-left {
@extend .dropdown-menu;
@extend .dropdown-triangle-bottom;
@extend .dropdown-triangle-left;
}
.dropdown-bottom-right {
@extend .dropdown-menu;
@extend .dropdown-triangle-bottom;
@extend .dropdown-triangle-right;
}
2014-07-29 14:00:29 +04:00
// List Item
.dropdown-item {
display: block;
width: 100%;
2014-07-29 20:23:00 +04:00
padding: 0.8rem 2rem;
2014-07-29 19:19:00 +04:00
font-size: 1.4rem;
line-height: 1;
color: #000;
2014-07-29 14:00:29 +04:00
&:not(.divider):hover,
&:not(.divider):focus {
2014-07-29 20:23:00 +04:00
color: #fff;
background: $blue;
2014-07-29 14:00:29 +04:00
}
2014-07-29 19:19:00 +04:00
} // .dropdown-item
2014-07-29 14:00:29 +04:00
2014-07-29 19:19:00 +04:00
// Divider
.dropdown-menu .divider {
display: block;
padding: 0;
margin: 0.9rem 0;
height: 1px;
width: 100%;
position: relative;
2014-07-29 20:23:00 +04:00
background: #D0DADE;
2014-07-29 19:19:00 +04:00
overflow: hidden;
} // .dropdown-menu .divider
// Icons
.dropdown-with-icons {
.dropdown-item:not(.divider) {
padding: 0.6rem 3rem;
&[class*='icon-'] {
position: relative;
&:before {
position: absolute;
top: 50%;
left: 1rem;
font-size: 1.2rem;
line-height: 1;
margin-top: -0.6rem;
}
} // &[class*='icon-']
} // .dropdown-item
} // .dropdown-with-icons