pico/scss/components/_dropdown.scss
2022-02-27 14:58:34 +07:00

94 lines
2.0 KiB
SCSS

details[role='list'] {
position: relative;
padding: 0;
border-bottom: none;
summary {
height: calc(
1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 +
var(--border-width) * 2
);
margin-bottom: 0;
padding: var(--form-element-spacing-vertical)
var(--form-element-spacing-horizontal);
border: var(--border-width) solid var(--form-element-border-color);
border-radius: var(--border-radius);
line-height: inherit;
cursor: pointer;
&::after {
height: 100%;
transform: rotate(0deg);
}
& + ul {
z-index: 100;
position: absolute;
top: auto;
right: 0px;
left: 0px;
margin: 0;
padding: 0;
border: var(--border-width) solid var(--form-element-border-color);
border-top: none;
border-bottom-right-radius: var(--border-radius);
border-bottom-left-radius: var(--border-radius);
background-color: var(--background-color);
list-style: none;
li {
margin-bottom: 0;
&::marker {
content: '';
}
label {
position: relative;
width: 100%;
margin: 0;
padding: var(--form-element-spacing-vertical)
var(--form-element-spacing-horizontal);
cursor: pointer;
&:hover {
background-color: var(--secondary-focus);
}
input[type='radio'],
input[type='checkbox'] {
appearance: none;
}
}
}
}
}
&[disabled] summary,
&.disabled summary {
color: var(--muted-color);
cursor: not-allowed;
pointer-events: none;
}
&[open] summary {
margin-bottom: 0;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
&::before {
display: block;
z-index: 80;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: transparent;
content: ' ';
cursor: default;
}
&::after {
transform: rotate(180deg);
}
}
}