mirror of
https://github.com/jgthms/bulma
synced 2026-03-15 02:04:29 -07:00
128 lines
3.7 KiB
SCSS
128 lines
3.7 KiB
SCSS
@import "../utilities/mixins";
|
|
|
|
$dropdown-menu-min-width: 12rem !default;
|
|
|
|
$dropdown-content-background-color: getVar("scheme-main") !default;
|
|
$dropdown-content-arrow: getVar("link") !default;
|
|
$dropdown-content-offset: 4px !default;
|
|
$dropdown-content-padding-bottom: 0.5rem !default;
|
|
$dropdown-content-padding-top: 0.5rem !default;
|
|
$dropdown-content-radius: getVar("radius") !default;
|
|
$dropdown-content-shadow: getVar("shadow") !default;
|
|
$dropdown-content-z: 20 !default;
|
|
|
|
$dropdown-item-color: getVar("text") !default;
|
|
$dropdown-item-hover-color: getVar("scheme-invert") !default;
|
|
$dropdown-item-hover-background-color: getVar("background") !default;
|
|
$dropdown-item-active-color: getVar("link-invert") !default;
|
|
$dropdown-item-active-background-color: getVar("link") !default;
|
|
|
|
$dropdown-divider-background-color: getVar("border-light") !default;
|
|
|
|
:root {
|
|
@include register-vars(
|
|
(
|
|
dropdown-menu-min-width: #{$dropdown-menu-min-width},
|
|
dropdown-content-background-color: #{$dropdown-content-background-color},
|
|
dropdown-content-arrow: #{$dropdown-content-arrow},
|
|
dropdown-content-offset: #{$dropdown-content-offset},
|
|
dropdown-content-padding-bottom: #{$dropdown-content-padding-bottom},
|
|
dropdown-content-padding-top: #{$dropdown-content-padding-top},
|
|
dropdown-content-radius: #{$dropdown-content-radius},
|
|
dropdown-content-shadow: #{$dropdown-content-shadow},
|
|
dropdown-content-z: #{$dropdown-content-z},
|
|
dropdown-item-color: #{$dropdown-item-color},
|
|
dropdown-item-hover-color: #{$dropdown-item-hover-color},
|
|
dropdown-item-hover-background-color: #{$dropdown-item-hover-background-color},
|
|
dropdown-item-active-color: #{$dropdown-item-active-color},
|
|
dropdown-item-active-background-color: #{$dropdown-item-active-background-color},
|
|
dropdown-divider-background-color: #{$dropdown-divider-background-color},
|
|
)
|
|
);
|
|
}
|
|
|
|
.#{$class-prefix}dropdown {
|
|
display: inline-flex;
|
|
position: relative;
|
|
vertical-align: top;
|
|
|
|
&.is-active,
|
|
&.is-hoverable:hover {
|
|
.#{$class-prefix}dropdown-menu {
|
|
display: block;
|
|
}
|
|
}
|
|
|
|
&.is-right {
|
|
.#{$class-prefix}dropdown-menu {
|
|
left: auto;
|
|
right: 0;
|
|
}
|
|
}
|
|
|
|
&.is-up {
|
|
.#{$class-prefix}dropdown-menu {
|
|
bottom: 100%;
|
|
padding-bottom: getVar("dropdown-content-offset");
|
|
padding-top: initial;
|
|
top: auto;
|
|
}
|
|
}
|
|
}
|
|
|
|
.#{$class-prefix}dropdown-menu {
|
|
display: none;
|
|
|
|
@include ltr-position(0, false);
|
|
|
|
min-width: getVar("dropdown-menu-min-width");
|
|
padding-top: getVar("dropdown-content-offset");
|
|
position: absolute;
|
|
top: 100%;
|
|
z-index: getVar("dropdown-content-z");
|
|
}
|
|
|
|
.#{$class-prefix}dropdown-content {
|
|
background-color: getVar("dropdown-content-background-color");
|
|
border-radius: getVar("dropdown-content-radius");
|
|
box-shadow: getVar("dropdown-content-shadow");
|
|
padding-bottom: getVar("dropdown-content-padding-bottom");
|
|
padding-top: getVar("dropdown-content-padding-top");
|
|
}
|
|
|
|
.#{$class-prefix}dropdown-item {
|
|
color: getVar("dropdown-item-color");
|
|
display: block;
|
|
font-size: 0.875rem;
|
|
line-height: 1.5;
|
|
padding: 0.375rem 1rem;
|
|
position: relative;
|
|
}
|
|
|
|
a.#{$class-prefix}dropdown-item,
|
|
button.#{$class-prefix}dropdown-item {
|
|
@include ltr-property("padding", 3rem);
|
|
|
|
text-align: inherit;
|
|
white-space: nowrap;
|
|
width: 100%;
|
|
|
|
&:hover {
|
|
background-color: getVar("dropdown-item-hover-background-color");
|
|
color: getVar("dropdown-item-hover-color");
|
|
}
|
|
|
|
&.is-active {
|
|
background-color: getVar("dropdown-item-active-background-color");
|
|
color: getVar("dropdown-item-active-color");
|
|
}
|
|
}
|
|
|
|
.#{$class-prefix}dropdown-divider {
|
|
background-color: getVar("dropdown-divider-background-color");
|
|
border: none;
|
|
display: block;
|
|
height: 1px;
|
|
margin: 0.5rem 0;
|
|
}
|