index-main/assets/css/components/_dropdown.scss

206 lines
4.3 KiB
SCSS
Raw Normal View History

2026-01-21 16:33:15 +01:00
.dropdown {
position: relative;
display: inline-block;
&__trigger {
cursor: pointer;
}
&__content {
position: absolute;
top: 100%;
left: 0;
2026-02-25 17:00:54 +01:00
2026-01-21 16:43:10 +01:00
margin-top: var(--padding-inner);
2026-01-21 16:33:15 +01:00
background-color: var(--color-bg);
border: var(--border);
border-radius: var(--radius-btn);
opacity: 0;
visibility: hidden;
transform: translateY(-4px);
transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
2026-02-25 16:40:53 +01:00
z-index: calc(var(--z-header) - 100);
2026-01-21 16:33:15 +01:00
2026-02-25 17:00:54 +01:00
&::before {
2026-01-21 16:43:10 +01:00
content: "";
transform: rotate(90deg);
font-size: 14px;
position: absolute;
top: -13px;
left: 16px;
}
2026-02-25 17:00:54 +01:00
2026-01-21 16:33:15 +01:00
ul {
list-style: none;
margin: 0;
padding: var(--padding-inner);
2026-02-25 17:00:54 +01:00
min-width: 180px;
2026-01-21 16:33:15 +01:00
}
2026-02-25 17:00:54 +01:00
a,
button {
2026-01-21 16:33:15 +01:00
display: block;
width: 100%;
padding: 0.75em 1ch;
font-size: var(--fs-small);
text-align: left;
text-decoration: none;
color: var(--color-txt);
background: none;
border: none;
cursor: pointer;
&:hover {
background-color: var(--grey-800);
}
}
}
// Positionnement par défaut : sous le bouton, aligné à gauche
// Variante : aligné à droite
&--align-right .dropdown__content {
left: auto;
right: 0;
2026-02-25 17:00:54 +01:00
&::before {
2026-01-21 16:43:10 +01:00
left: auto;
right: 16px;
}
2026-01-21 16:33:15 +01:00
}
2026-02-25 17:00:54 +01:00
&.is-open {
2026-01-21 16:33:15 +01:00
.dropdown__content {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
}
2026-02-25 17:00:54 +01:00
&--position-mobile .dropdown__content {
background-color: red;
}
2026-02-25 16:40:53 +01:00
// PANEL
2026-02-25 17:00:54 +01:00
// &--position-mobile .dropdown__content {
// top: auto;
// bottom: calc(var(--h-block) + var(--padding-inner)*2);
// left: auto;
// right: 0;
// margin-top: 0;
// margin-left: 4px;
2026-01-23 17:38:08 +01:00
2026-02-25 17:00:54 +01:00
// &::before{
// font-family: Arial;
// content: "◀";
// transform: rotate(-90deg);
// font-size: 14px;
// position: absolute;
// top: auto;
// bottom: -13px;
// left: auto;
// right: 10%;
// }
// }
2026-02-25 16:40:53 +01:00
2026-01-23 17:38:08 +01:00
2026-02-25 17:00:54 +01:00
// &--position-mobile.is-open {
// .dropdown__content {
// transform: translateX(0);
// }
// }
2026-01-23 17:38:08 +01:00
2026-01-25 19:40:55 +01:00
2026-01-23 17:38:08 +01:00
2026-02-25 17:00:54 +01:00
@media #{$small-up} {
2026-01-23 17:38:08 +01:00
&--position-panel .dropdown__content {
2026-02-25 17:00:54 +01:00
top: auto;
bottom: 0;
left: calc(100% + var(--padding-inner));
margin-top: 0;
margin-left: 4px;
&::before {
font-family: Arial;
content: "";
transform: rotate(0deg);
font-size: 14px;
position: absolute;
2026-01-23 17:38:08 +01:00
top: auto;
2026-02-25 17:00:54 +01:00
bottom: 4px;
left: -11px;
2026-01-23 17:38:08 +01:00
}
2026-02-25 17:00:54 +01:00
}
2026-01-23 17:38:08 +01:00
2026-02-25 16:40:53 +01:00
2026-01-23 17:38:08 +01:00
2026-02-25 17:00:54 +01:00
&--position-panel.is-open {
.dropdown__content {
transform: translateX(0);
2026-01-23 17:38:08 +01:00
}
2026-02-25 17:00:54 +01:00
}
2026-01-23 17:38:08 +01:00
}
2026-02-25 17:00:54 +01:00
@media #{$x-small} {
2026-01-23 17:38:08 +01:00
2026-02-25 17:00:54 +01:00
.dropdown__content {
width: calc(100vw - var(--padding-body)*2);
left: auto;
right: 0;
.modal--share {
width: 100%;
}
2026-01-21 16:33:15 +01:00
}
2026-01-23 17:38:08 +01:00
2026-02-25 16:40:53 +01:00
2026-01-21 16:33:15 +01:00
}
2026-01-23 17:38:08 +01:00
2026-01-21 16:33:15 +01:00
}
2026-01-21 16:43:10 +01:00
2026-01-27 16:55:02 +01:00
2026-02-25 17:00:54 +01:00
#bottom-bar {
.dropdown .dropdown__content {
top: auto;
bottom: calc(var(--h-block) + var(--padding-inner)*2);
left: auto;
right: 0;
margin-top: 0;
margin-left: 4px;
&::before {
font-family: Arial;
content: "";
transform: rotate(-90deg);
font-size: 14px;
position: absolute;
top: auto;
bottom: -13px;
left: auto;
right: 10%;
2026-02-25 17:13:46 +01:00
@media #{$x-small} {
left: 20%;
right: auto;
}
2026-01-27 16:55:02 +01:00
}
2026-02-25 17:13:46 +01:00
2026-01-27 16:55:02 +01:00
}
2026-02-25 17:00:54 +01:00
.dropdown.is-open {
.dropdown__content {
transform: translateX(0);
}
}
2026-01-27 16:55:02 +01:00
}
2026-02-25 17:00:54 +01:00