123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- // stylelint-disable declaration-no-important
- .sidebar-menu-item {
- $root: &;
- @include transition(border-color $menu-transition-duration ease);
- position: relative;
- &__link {
- @apply w-text-14;
- @include transition(
- border-color $menu-transition-duration ease,
- background-color $menu-transition-duration ease
- );
- position: relative;
- display: block;
- width: 100%;
- box-sizing: border-box;
- white-space: nowrap;
- border-inline-start: 3px solid transparent;
- -webkit-font-smoothing: auto;
- border: 0;
- background: transparent;
- text-align: start;
- color: $color-menu-text;
- padding: 11px 20px;
- font-weight: 400;
- // Note, font-weights lower than normal,
- // and font-size smaller than 1em (80% ~= 12.8px),
- // makes the strokes thinner than 1px on non-retina screens
- // making the text semi-transparent
- &:hover,
- &:focus {
- color: $color-white;
- text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3);
- }
- &:before {
- font-size: 1rem;
- vertical-align: -15%;
- margin-inline-end: 0.5em;
- }
- // only really used for spinners and settings menu
- &:after {
- font-size: 1.5em;
- margin: 0;
- position: absolute;
- // Remove once we drop support for Safari 13.
- // stylelint-disable-next-line property-disallowed-list
- right: 0.5em;
- inset-inline-end: 0.5em;
- top: 0.5em;
- margin-top: 0;
- }
- // Disable icon margin, this is instead applied to the left of the .menuitem-label
- // This is because SVG icons and legacy icons apply this margin differently,
- // we could remove this override when we remove legacy icons
- .icon {
- margin-inline-end: 0 !important;
- }
- }
- &--in-sub-menu {
- @apply hover:w-bg-primary;
- #{$root}__link {
- // Links inside a submenu should have normal wrapping
- white-space: normal;
- }
- }
- &--active {
- @apply w-bg-primary-200;
- text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3);
- > a {
- border-inline-start-color: $color-salmon;
- color: $color-white;
- }
- }
- }
- .menuitem-label {
- @include transition(opacity $menu-transition-duration ease);
- margin-inline-start: 0.5em;
- }
- .sidebar--slim {
- .sidebar-menu-item {
- .menuitem-label {
- opacity: 0;
- }
- }
- .sidebar-menu-item--in-sub-menu {
- .menuitem-label {
- opacity: 1;
- }
- }
- }
|