discourse-header-submenus/common/common.scss

130 lines
2.5 KiB
SCSS
Raw Permalink Normal View History

2020-05-14 02:23:49 -04:00
@function fallback($setting, $color) {
@if not $setting or $setting == "" {
@return $color;
} @else {
@return $setting;
}
2018-08-13 04:04:49 -04:00
}
2020-05-14 02:23:49 -04:00
$item-height: 40px;
$icon-opacity: 0.7;
2018-08-13 04:04:49 -04:00
2018-08-12 01:05:41 -04:00
.top-menu {
2020-05-14 02:23:49 -04:00
background: fallback($Menu_background, $primary);
width: 100%;
2018-08-12 01:05:41 -04:00
2020-05-14 02:23:49 -04:00
.menu-content {
2018-08-12 01:05:41 -04:00
display: flex;
align-items: center;
2020-05-14 02:23:49 -04:00
justify-content: if($Invert_position == "true", flex-end, flex-start);
}
2018-08-12 01:05:41 -04:00
2020-05-14 02:23:49 -04:00
.menu-items {
display: flex;
height: $item-height;
2018-08-12 01:05:41 -04:00
}
2020-05-14 02:23:49 -04:00
.menu-item {
position: relative;
color: fallback($Menu_item_color, $secondary);
2018-08-12 01:05:41 -04:00
border: none;
2020-05-14 02:23:49 -04:00
padding: 0 0.5em;
2018-08-12 01:05:41 -04:00
font-size: $font-up-1;
transition: all 0.15s;
display: flex;
align-items: center;
2020-05-14 10:51:05 -04:00
white-space: nowrap;
2018-08-12 01:05:41 -04:00
2020-05-14 02:23:49 -04:00
&:hover,
&:active,
&:focus {
background: fallback($Menu_item-active_background, $primary-low);
color: fallback($Menu-item-active-color, $primary);
2020-05-14 02:23:49 -04:00
cursor: default;
.d-icon-caret-right {
transform: rotate(90deg);
}
.d-header-dropdown {
display: block;
top: $item-height;
left: 0;
z-index: z("header") + 1;
.rtl & {
left: unset;
right: 0;
}
2018-08-12 01:05:41 -04:00
}
@if $Invert_position == "true" {
&:last-child {
.d-header-dropdown {
left: unset;
right: 0;
.rtl & {
right: unset;
left: 0;
}
}
}
}
2018-08-12 01:05:41 -04:00
}
2020-05-14 02:23:49 -04:00
.d-icon-caret-right {
margin-left: 0.25em;
transition: transform 0.15s ease-in-out;
2018-08-12 01:05:41 -04:00
2020-05-14 02:23:49 -04:00
.rtl & {
margin-left: 0em;
margin-right: 0.25em;
}
2018-08-12 01:05:41 -04:00
}
}
2020-05-14 02:23:49 -04:00
.d-header-dropdown {
position: absolute;
display: none;
2018-08-12 01:05:41 -04:00
}
.d-dropdown-menu {
min-width: 160px;
2020-05-14 02:23:49 -04:00
background: fallback($Submenu_background, $secondary);
2023-06-15 10:17:54 -04:00
box-shadow: var(--shadow-menu-panel);
2018-08-12 01:05:41 -04:00
margin: 0;
list-style: none;
}
2020-05-14 02:23:49 -04:00
.submenu-link {
display: flex;
align-items: center;
2020-05-14 02:23:49 -04:00
color: fallback($Submenu_item_color, $primary);
padding: 0.5em;
font-size: $font-down-1;
2018-08-12 01:05:41 -04:00
white-space: nowrap;
&:hover {
2020-05-14 02:23:49 -04:00
color: fallback($Submenu_item_hover_color, $primary);
background-color: fallback($Submenu_item_hover_background, $tertiary-low);
2018-08-12 01:05:41 -04:00
}
}
2020-05-14 02:23:49 -04:00
.divider {
border-top: solid 1px fallback($Divider_color, $primary-low);
margin: 0.25em auto;
}
.d-icon {
opacity: $icon-opacity;
min-width: 1em;
&:not(.d-icon-caret-right) {
margin-right: 0.5em;
.rtl & {
margin-right: 0;
margin-left: 0.5em;
}
}
2018-08-12 01:05:41 -04:00
}
}