|
| 1 | +@import "colors"; |
| 2 | + |
| 3 | +@mixin menubar { |
| 4 | + menu { |
| 5 | + list-style: none; |
| 6 | + box-sizing: border-box; |
| 7 | + display: flex; |
| 8 | + flex-wrap: wrap; |
| 9 | + margin: 0 14px; |
| 10 | + padding: 0; |
| 11 | + |
| 12 | + li { |
| 13 | + display: list-item; |
| 14 | + list-style: none; |
| 15 | + padding: 0; |
| 16 | + |
| 17 | + &:not(:empty) { |
| 18 | + cursor: pointer; |
| 19 | + border-radius: 4px; |
| 20 | + width: 32px; |
| 21 | + height: 32px; |
| 22 | + } |
| 23 | + |
| 24 | + &:hover:not(.disabled):not(.search-field) { |
| 25 | + background-color: $selected-bg-color; |
| 26 | + } |
| 27 | + |
| 28 | + &.active { |
| 29 | + background-color: $selected-row-color; |
| 30 | + } |
| 31 | + |
| 32 | + &.disabled { |
| 33 | + opacity: 0.5; |
| 34 | + cursor: not-allowed; |
| 35 | + } |
| 36 | + |
| 37 | + &.erase svg { |
| 38 | + color: var(--delete-button-bg); |
| 39 | + } |
| 40 | + |
| 41 | + &.search-field { |
| 42 | + display: inline-flex; |
| 43 | + width: calc(100% - 400px); |
| 44 | + max-width: 400px; |
| 45 | + |
| 46 | + > input { |
| 47 | + width: calc(100% - 48px); |
| 48 | + min-width: 100px; |
| 49 | + height: 100%; |
| 50 | + display: block; |
| 51 | + color: $body-fg-color; |
| 52 | + background-color: $body-bg-color; |
| 53 | + margin: 0; |
| 54 | + padding: 2px 8px; |
| 55 | + border: 1px solid $border-color; |
| 56 | + border-right: none; |
| 57 | + border-top-left-radius: 5px; |
| 58 | + border-bottom-left-radius: 5px; |
| 59 | + |
| 60 | + &:focus-visible { |
| 61 | + outline: none; |
| 62 | + } |
| 63 | + |
| 64 | + & + div { |
| 65 | + border: 1px solid $border-color; |
| 66 | + border-left: none; |
| 67 | + border-top-right-radius: 5px; |
| 68 | + border-bottom-right-radius: 5px; |
| 69 | + padding: 0 5px 0 10px; |
| 70 | + display: flex; |
| 71 | + |
| 72 | + span { |
| 73 | + color: $body-fg-color; |
| 74 | + |
| 75 | + &:hover { |
| 76 | + background-color: $selected-bg-color; |
| 77 | + } |
| 78 | + } |
| 79 | + |
| 80 | + .search-icon { |
| 81 | + svg { |
| 82 | + transform: scale(0.8); |
| 83 | + } |
| 84 | + } |
| 85 | + |
| 86 | + //.search-realm { |
| 87 | + // [role="combobox"] { |
| 88 | + // li:nth-child(2) { |
| 89 | + // padding-bottom: 4px; |
| 90 | + // border-bottom: 1px solid $border-color; |
| 91 | + // margin-bottom: 4px; |
| 92 | + // } |
| 93 | + // } |
| 94 | + //} |
| 95 | + } |
| 96 | + } |
| 97 | + |
| 98 | + &:has(> input:focus-visible) { |
| 99 | + box-shadow: $focus-visible-box-shadow; |
| 100 | + } |
| 101 | + } |
| 102 | + |
| 103 | + &[aria-haspopup="true"]:has(>[role="combobox"]) { |
| 104 | + width: auto; |
| 105 | + |
| 106 | + &.with-caret { |
| 107 | + padding-right: 0.25rem; |
| 108 | + } |
| 109 | + } |
| 110 | + |
| 111 | + &.filter-by-label { |
| 112 | + ul { |
| 113 | + li:not(:has(span.label-dot)) { |
| 114 | + justify-content: center; |
| 115 | + padding-bottom: 4px; |
| 116 | + border-bottom: 1px solid $border-color; |
| 117 | + margin-bottom: 4px; |
| 118 | + } |
| 119 | + |
| 120 | + li span.label-dot { |
| 121 | + width: 12px; |
| 122 | + height: 12px; |
| 123 | + display: inline-block; |
| 124 | + border-radius: 50%; |
| 125 | + margin-left: 0.5rem; |
| 126 | + margin-right: 0.5rem; |
| 127 | + } |
| 128 | + } |
| 129 | + } |
| 130 | + |
| 131 | + &.extra-menu [role="combobox"] { |
| 132 | + right: 0; |
| 133 | + margin-inline-end: inherit; |
| 134 | + |
| 135 | + //> li:nth-child(5):not(:last-child) { |
| 136 | + // padding-bottom: 4px; |
| 137 | + // border-bottom: 1px solid $border-color; |
| 138 | + // margin-bottom: 4px; |
| 139 | + //} |
| 140 | + } |
| 141 | + |
| 142 | + svg { |
| 143 | + display: inline-block; |
| 144 | + width: 30px; |
| 145 | + height: 30px; |
| 146 | + margin: 1px; |
| 147 | + } |
| 148 | + } |
| 149 | + |
| 150 | + hr { |
| 151 | + margin: 0.25rem; |
| 152 | + } |
| 153 | + |
| 154 | + [aria-haspopup="true"]:has([role="combobox"]) { |
| 155 | + position: relative; |
| 156 | + display: flex; |
| 157 | + |
| 158 | + &.with-caret::after { |
| 159 | + content: " "; |
| 160 | + align-self: center; |
| 161 | + border: 5px solid transparent; |
| 162 | + border-top-color: $body-fg-color; |
| 163 | + margin-top: 10px; |
| 164 | + } |
| 165 | + } |
| 166 | + |
| 167 | + [role="combobox"] { |
| 168 | + position: absolute; |
| 169 | + z-index: 1; |
| 170 | + background-color: $body-bg-color; |
| 171 | + top: 100%; |
| 172 | + left: -250px; |
| 173 | + right: -250px; |
| 174 | + margin-inline: auto; |
| 175 | + border: 1px solid $border-color; |
| 176 | + border-radius: 4px; |
| 177 | + box-shadow: 0 0 8px $border-color; |
| 178 | + display: flex; |
| 179 | + flex-direction: column; |
| 180 | + width: max-content; |
| 181 | + padding-top: 3px; |
| 182 | + padding-bottom: 3px; |
| 183 | + padding-inline-start: 3px; |
| 184 | + padding-inline-end: 3px; |
| 185 | + |
| 186 | + &[aria-expanded="false"] { |
| 187 | + display: none; |
| 188 | + } |
| 189 | + |
| 190 | + li { |
| 191 | + padding: 0 2rem 0 0.5rem; |
| 192 | + width: auto; |
| 193 | + cursor: pointer; |
| 194 | + display: flex; |
| 195 | + align-items: center; |
| 196 | + line-height: 32px; |
| 197 | + font-size: 16px; |
| 198 | + |
| 199 | + &.active::after { |
| 200 | + content: "✔"; |
| 201 | + position: absolute; |
| 202 | + right: 10px; |
| 203 | + } |
| 204 | + } |
| 205 | + |
| 206 | + svg { |
| 207 | + color: $body-fg-color; |
| 208 | + } |
| 209 | + |
| 210 | + svg + span { |
| 211 | + margin-left: 0.5rem; |
| 212 | + } |
| 213 | + } |
| 214 | + } |
| 215 | +} |
0 commit comments