_menu.scss
ASCII text
1/* Popovers/Menus */ 2 3// the popover itself 4.popup-menu-boxpointer { 5-arrow-base: 0; 6-arrow-rise: 0; 7-arrow-border-width: 0; 8-arrow-border-color: transparent; 9-arrow-border-radius: 20px; // This is necessary for the weird bug: materia-theme#296 10-arrow-box-shadow: none; // dreaming bugzilla #689995 11-arrow-background-color: transparent; 12} 13 14// container of the popover menu 15.popup-menu { 16min-width: 15em; 17border-color: transparent; 18color: inherit; 19 20// dunno what that is 21.popup-status-menu-item { 22// font-weight: normal; 23// color: pink; 24} 25 26&.panel-menu { 27-boxpointer-gap: 0; // distance from the panel 28margin-bottom: 1.75em; 29} 30} 31 32.popup-menu-content { 33margin: 8px; 34padding: 8px 0; 35border-radius: $corner-radius; 36box-shadow: $shadow-z4; 37background-color: $surface-z8; 38color: $on-surface; 39} 40 41// menu items 42.popup-menu-item { 43// min-height: $menuitem-size - 4px * 2; 44spacing: 8px; 45padding: 0; 46transition-duration: $duration; 47 48&:ltr { 49padding: 0.4em; 50padding-right: 24px; 51padding-left: 0; 52} 53 54&:rtl { 55padding: 0.4em; 56padding-right: 0; 57padding-left: 24px; 58} 59 60&.selected { 61background-color: hover-overlay($on-surface); 62transition-duration: 0ms; 63 64&, 65&:active { 66color: $on-surface; 67} 68} 69 70&:active { 71background-color: pressed-overlay($on-surface); 72color: $on-surface; 73transition-duration: $duration-ripple; 74} 75 76&:checked { 77box-shadow: none; 78background-color: $selected-overlay; 79font-weight: normal; 80 81&.selected { 82background-color: hover-overlay($primary, $on: $selected-overlay); 83} 84 85&:active { 86background-color: pressed-overlay($primary, $on: $selected-overlay); 87} 88} 89 90&:insensitive { 91color: disabled($on-surface); 92} 93 94.toggle-switch { 95width: 20px; 96height: 20px; 97background-image: url("assets/menu-item-toggle-off.svg"); 98 99&:checked { 100background-image: url("assets/menu-item-toggle-on.svg"); 101} 102} 103} 104 105// all icons and other graphical elements 106.popup-inactive-menu-item { 107color: $on-surface; 108 109&:insensitive { 110color: disabled($on-surface); 111} 112} 113 114// symbolic icons in popover 115 116.popup-menu-arrow { 117@if $version >= 3.32 { 118icon-size: 16px; 119} @else { 120width: 16px; 121height: 16px; 122} 123 124.popup-menu-content & { 125color: hint($on-surface); 126} 127} 128 129.popup-menu-icon { 130icon-size: 16px; 131color: hint($on-surface); 132} 133 134// popover submenus 135.popup-sub-menu { 136border-top: 0; 137border-bottom: 0; 138padding-bottom: 0; 139box-shadow: none; 140background-color: entry-fill($on-surface); 141} 142 143// container for radio and check boxes 144.popup-menu-ornament { 145text-align: right; 146width: 16px; 147height: 16px; 148 149&:ltr { 150text-align: right; 151} 152 153&:rtl { 154text-align: left; 155} 156} 157 158// separator 159@if $version >= 3.36 { 160.popup-separator-menu-item { 161padding: 0; 162 163.popup-separator-menu-item-separator { 164// -margin-horizontal: 24px; 165height: 1px; // not really the whole box 166margin: 8px 0; 167background-color: divider($on-surface); 168 169// submenu separators 170.popup-sub-menu & { 171margin: 8px 0; 172background-color: divider($on-surface); 173 174&:ltr { 175margin-right: 32px; 176} 177 178&:rtl { 179margin-left: 32px; 180} 181} 182} 183} 184} @else { 185.popup-separator-menu-item { 186// -margin-horizontal: 24px; 187height: 1px; // not really the whole box 188margin: 8px 64px - 24px; 189border: 0; 190background-color: divider($on-surface); 191} 192} 193 194// desktop background menu 195.background-menu { 196-boxpointer-gap: 4px; 197-arrow-rise: 0; // hide the beak on the menu 198} 199 200// system status menu 201.aggregate-menu { 202min-width: 21em; 203 204// lock screen, shutdown, etc. buttons 205.popup-menu-icon { 206padding: 0; 207margin: 0 4px; 208-st-icon-style: symbolic; // >= 3.36 209} 210 211.popup-sub-menu .popup-menu-item > :first-child { 212// account for icons in submenus with padding 213&:ltr { 214padding-left: 16px; 215margin-left: 16px; 216} 217 218&:rtl { 219padding-right: 16px; 220margin-right: 16px; 221} 222} 223} 224 225@if $version == 3.32 { 226.system-switch-user-submenu-icon { 227icon-size: 16px; 228padding: 0 4px; 229} 230} @else if $version < 3.32 { 231.system-switch-user-submenu-icon.user-icon { 232icon-size: 20px; 233padding: 0 2px; 234} 235 236.system-switch-user-submenu-icon.default-icon { 237icon-size: 16px; 238padding: 0 4px; 239} 240} 241 242@if $version < 3.36 { 243.system-menu-action { 244-st-icon-style: symbolic; // >= 3.30 245padding: ($large-size - 16px) / 2; 246border: 0; 247border-radius: $large-size / 2; // wish we could do 50% 248color: hint($on-surface); 249transition-duration: $duration; 250 251&:hover, 252&:focus { 253padding: ($large-size - 16px) / 2; 254border: 0; 255color: hint($on-surface); 256} 257 258&:focus { 259background-color: focus-overlay($on-surface); 260} 261 262&:hover { 263background-color: hover-overlay($on-surface); 264} 265 266&:active { 267background-color: pressed-overlay($on-surface); 268color: hint($on-surface); 269transition-duration: $duration-ripple; 270} 271 272> StIcon { 273icon-size: 16px; 274} 275} 276} 277