philomena/assets/css/elements/dropdown.css

110 lines
2.2 KiB
CSS
Raw Permalink Normal View History

2024-07-02 21:35:38 +02:00
@define-mixin dropdown-type $type {
.dropdown--$(type) .dropdown__content {
background: var(--$(type)-muted-color);
border-color: var(--$(type)-border-color);
}
.dropdown--$(type) .dropdown__text {
background: var(--$(type)-muted-color);
border-color: var(--$(type)-border-color);
}
.dropdown--$(type) .dropdown__item:hover .dropdown__text {
background: var(--$(type)-color);
}
2024-07-02 21:42:21 +02:00
2024-07-02 21:35:38 +02:00
.dropdown--$(type) .dropdown__icon {
background: var(--$(type)-dark-color);
}
2024-07-02 21:42:21 +02:00
2024-07-02 21:35:38 +02:00
.dropdown--$(type) .dropdown__item:hover .dropdown__icon {
background: var(--$(type)-color);
}
2024-07-02 21:42:21 +02:00
2024-07-02 21:35:38 +02:00
.dropdown--$(type) .dropdown__separator {
border-color: var(--$(type)-border-color);
}
2024-07-02 21:42:21 +02:00
2024-07-02 21:35:38 +02:00
.dropdown--$(type) .dropdown__link:hover {
background: var(--$(type)-color);
}
}
2023-11-23 17:07:49 +01:00
.dropdown {
position: relative;
display: inline-block;
2024-04-30 20:38:28 +02:00
}
2023-11-23 17:07:49 +01:00
.dropdown__content {
background: var(--primary-muted-color);
border: 1px solid var(--primary-border-color);
2024-05-20 23:57:10 +02:00
border-radius: var(--border-radius-inner);
2023-11-23 17:07:49 +01:00
position: absolute;
display: none;
top: 100%;
left: 0;
2024-04-30 20:38:28 +02:00
}
2023-11-23 17:07:49 +01:00
2024-05-20 21:25:43 +02:00
.dropdown:hover .dropdown__content {
2024-05-20 23:57:10 +02:00
display: grid;
2024-05-20 21:25:43 +02:00
min-width: 100%;
z-index: 999;
2024-05-20 23:57:10 +02:00
overflow: hidden;
2024-05-20 21:25:43 +02:00
}
2024-04-30 20:38:28 +02:00
.dropdown__content > :not(.hidden) {
white-space: nowrap;
2023-11-23 17:07:49 +01:00
}
.dropdown__content--right {
left: inherit;
right: 0;
}
.dropdown__item {
display: grid;
grid-template-columns: auto 1fr;
2024-05-20 23:57:10 +02:00
color: var(--text-color) !important;
2024-04-30 20:38:28 +02:00
}
2023-11-23 17:07:49 +01:00
2024-05-20 21:25:43 +02:00
.dropdown__text {
padding: 0 var(--padding-small);
background: var(--primary-muted-color);
border-left: 1px solid var(--primary-border-color);
}
2024-04-30 20:38:28 +02:00
.dropdown__item:hover .dropdown__text {
2024-05-20 23:57:10 +02:00
background: var(--primary-color);
2023-11-23 17:07:49 +01:00
}
.dropdown__icon {
padding: 0 var(--padding-small);
background: var(--primary-dark-color);
2024-05-20 23:57:10 +02:00
}
.dropdown__item:hover .dropdown__icon {
background: var(--primary-color);
2023-11-23 17:07:49 +01:00
}
.dropdown__separator {
margin: 0;
2024-05-20 23:57:10 +02:00
border: 1px solid var(--primary-border-color);
border-top: 0;
2023-11-23 17:07:49 +01:00
}
.dropdown__link {
padding: 0 var(--padding-small);
color: var(--text-color) !important;
2024-04-30 20:38:28 +02:00
}
2023-11-23 17:07:49 +01:00
2024-04-30 20:38:28 +02:00
.dropdown__link:hover {
2024-05-20 23:57:10 +02:00
background: var(--primary-color);
2023-11-23 17:07:49 +01:00
}
2024-07-02 21:35:38 +02:00
@mixin dropdown-type secondary;
@mixin dropdown-type success;
@mixin dropdown-type warning;
@mixin dropdown-type danger;
@mixin dropdown-type information;
@mixin dropdown-type special;