Divide `basic.css` en parciales SCSS bajo `assets/scss/basic/`, integra `normalize.css` en `basic.min.css` y compila `intro.scss` por separado a `intro.min.css`.
93 lines
2.3 KiB
SCSS
93 lines
2.3 KiB
SCSS
.dropdown {
|
|
position: relative;
|
|
display: inline-block;
|
|
}
|
|
|
|
// The base geometry of .dropdown-button/.dropdown-toggle lives at the top of `_buttons.scss`, which
|
|
// is loaded before this partial, so that .button-sm/.button-lg/.button-* win the specificity tie
|
|
// against it (CSS resolves a tie by order of appearance in the file, not by the order of the
|
|
// classes in the HTML).
|
|
.dropdown-toggle::after {
|
|
content: "\25BC";
|
|
display: inline-block;
|
|
margin-left: 0.35em;
|
|
font-size: 0.8em;
|
|
transition: transform .15s ease-in-out;
|
|
}
|
|
.dropdown:has(> .dropdown-menu.show) > .dropdown-toggle::after {
|
|
transform: rotate(180deg);
|
|
}
|
|
|
|
.dropdown-menu {
|
|
position: absolute;
|
|
z-index: 1000;
|
|
top: 100%;
|
|
left: 0;
|
|
min-width: 12rem;
|
|
margin: 0.25rem 0 0;
|
|
padding: 0.5rem 0;
|
|
list-style: none;
|
|
background-color: var(--val-color--bg);
|
|
border: 1px solid color-mix(in srgb, var(--val-color--border) 15%, var(--val-color--bg));
|
|
border-radius: 0.375rem;
|
|
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
|
// Closed by default
|
|
display: none;
|
|
}
|
|
.dropdown-menu.show {
|
|
display: block;
|
|
}
|
|
// Anchors the menu's right edge to the button's right edge, so it opens inwards.
|
|
.dropdown-menu-end {
|
|
left: auto;
|
|
right: 0;
|
|
}
|
|
|
|
// Options and headers stay on one line, so the menu grows to fit the longest one.
|
|
.dropdown-item {
|
|
display: block;
|
|
width: 100%;
|
|
padding: 0.375rem 1rem;
|
|
text-align: left;
|
|
white-space: nowrap;
|
|
color: var(--val-color--text);
|
|
text-decoration: none;
|
|
background-color: transparent;
|
|
border: none;
|
|
font: inherit;
|
|
cursor: pointer;
|
|
}
|
|
.dropdown-item:hover {
|
|
background-color: color-mix(in srgb, var(--val-color--text) 8%, transparent);
|
|
}
|
|
.dropdown-item.active {
|
|
color: var(--val-color--primary);
|
|
font-weight: 600;
|
|
}
|
|
.dropdown-item.disabled {
|
|
color: var(--val-color--text--muted);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.dropdown-item-text {
|
|
display: block;
|
|
padding: 0.375rem 1rem;
|
|
color: var(--val-color--text--muted);
|
|
}
|
|
|
|
.dropdown-header {
|
|
display: block;
|
|
padding: 0.5rem 1rem 0.25rem;
|
|
margin: 0;
|
|
white-space: nowrap;
|
|
font-size: 0.8125rem;
|
|
font-weight: 600;
|
|
color: var(--val-color--text--muted);
|
|
}
|
|
|
|
.dropdown-divider {
|
|
height: 0;
|
|
margin: 0.5rem 0;
|
|
border: none;
|
|
border-top: 1px solid var(--val-color--border);
|
|
}
|