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

171 lines
3.8 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;
min-width: 180px;
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;
z-index: 100;
2026-01-21 16:43:10 +01:00
&::before{
content: "";
transform: rotate(90deg);
font-size: 14px;
position: absolute;
top: -13px;
left: 16px;
}
2026-01-21 16:33:15 +01:00
ul {
list-style: none;
margin: 0;
padding: var(--padding-inner);
}
a, button {
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-01-21 16:43:10 +01:00
&::before{
left: auto;
right: 16px;
}
2026-01-21 16:33:15 +01:00
}
2026-01-23 17:38:08 +01:00
&.is-open {
2026-01-21 16:33:15 +01:00
.dropdown__content {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
}
2026-01-23 17:38:08 +01:00
// PANEL
2026-01-25 19:40:55 +01:00
&--position-mobile .dropdown__content {
2026-01-23 17:38:08 +01:00
top: auto;
2026-01-25 19:40:55 +01:00
bottom: calc(var(--h-block) + var(--padding-inner)*2);
2026-01-23 17:38:08 +01:00
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;
2026-01-25 19:40:55 +01:00
left: auto;
right: 10%;
2026-01-23 17:38:08 +01:00
}
}
2026-01-25 19:40:55 +01:00
&--position-mobile.is-open {
2026-01-23 17:38:08 +01:00
.dropdown__content {
transform: translateX(0);
}
}
2026-01-25 19:40:55 +01:00
2026-01-23 17:38:08 +01:00
@media #{$small-up}{
&--position-panel .dropdown__content {
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;
top: auto;
bottom: 4px;
left: -11px;
}
}
&--position-panel.is-open {
.dropdown__content {
transform: translateX(0);
}
}
}
@media #{$x-small}{
.dropdown__content{
width: calc(100vw - var(--padding-body)*2);
.modal--share{
width: 100%;
}
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-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
@media screen and (max-width: 1280px){
[data-template="investigations"]{
.dropdown .dropdown__content {
left: auto;
right: 0;
&::before{
left: auto;
right: 16px;
}
}
}
}