Debian Codegraph @

skins/Vector/resources/skins.vector.styles.legacy/components/MenuDropdown.less

raw
1 // Flips the chevron so it points up when the dropdown is open.
2 .vector-menu-checkbox:checked + .vector-menu-heading::after {
3 transform: scaleY( -1 );
4 }
5
6 /**
7 * Dropdown menus that only appear in the tab bar in legacy Vector.
8 */
9 .vector-menu-dropdown {
10 direction: ltr;
11 float: left;
12 cursor: pointer;
13 position: relative;
14 line-height: 1.125em;
15
16 // menu label with chevron icon.
17 .vector-menu-heading {
18 display: flex;
19 color: @color-subtle;
20 font-size: @font-size-tabs;
21 // Tab separator: Outer end (right in LTR) border of "Actions" menu.
22 background-position: right bottom;
23 margin: 0 -@border-width-base 0 0;
24 // `padding-top` needs to scale with font-size.
25 padding: 1.25em 8px 6px;
26 font-weight: normal;
27
28 &::after {
29 .mixin-vector-legacy-menu-heading-arrow();
30 // Modify the color of the image from the default #202122 to approx. #404244 to match the text.
31 opacity: @opacity-icon-base;
32 }
33
34 &:hover,
35 &:focus {
36 color: @color-base;
37
38 &::after {
39 opacity: @opacity-icon-base--selected;
40 }
41 }
42 }
43
44 /**
45 * Dropdown container. Hidden by default until checkbox is checked.
46 */
47 .vector-menu-content {
48 position: absolute;
49 top: 100%;
50 left: -@border-width-base;
51 opacity: 0;
52 height: 0;
53 visibility: hidden;
54 overflow: hidden;
55 margin: 0;
56 padding: 0;
57 z-index: @z-index-dropdown;
58 line-height: 1.125em;
59 background-color: @background-color-base;
60 border: @border-width-base @border-style-base @border-color-base;
61 border-top-width: 0;
62 box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
63 transition-property: opacity;
64 transition-duration: @transition-duration-base;
65 // The menu content should not be narrower than the menu button.
66 min-width: 100%;
67 }
68
69 // Dropdown <ul> element.
70 > .vector-menu-content-list {
71 list-style: none;
72 }
73
74 // Open the dropdown container via hover.
75 &:hover .vector-menu-content {
76 opacity: @opacity-base;
77 visibility: visible;
78 height: auto;
79 }
80
81 .mw-list-item {
82 padding: 0;
83 margin: 0;
84 text-align: left;
85 line-height: 1em;
86
87 a:not( .vector-icon ) {
88 font-size: @font-size-tabs;
89 }
90
91 a {
92 cursor: pointer;
93 // displays all links in a single column.
94 display: block;
95 white-space: nowrap;
96 padding: 0.625em;
97 color: @color-link;
98 }
99
100 &.selected a,
101 &.selected a:visited {
102 color: @color-link-selected;
103 text-decoration: none;
104 }
105 }
106 }
107
108 /**
109 * Invisible checkbox covering the dropdown menu handle.
110 */
111 .vector-menu-checkbox {
112 cursor: pointer;
113 position: absolute;
114 top: 0;
115 left: 0;
116 z-index: @z-index-stacking-1;
117 opacity: 0;
118 width: 100%;
119 height: 100%;
120 margin: 0;
121 padding: 0;
122 // Hide the checkbox completely in browsers that don't support :checked
123 display: none;
124
125 // Hide and show menu content based off checked status.
126 &:checked ~ .vector-menu-content {
127 opacity: 1;
128 visibility: visible;
129 height: auto;
130 }
131
132 :not( :checked ) > & {
133 // When the browser supports :checked, display it
134 display: block;
135 }
136
137 // Add focus state to menu dropdown buttons (i.e. #p-variants, #p-cactions)
138 &:focus + .vector-menu-heading:not( .cdx-button ) {
139 // Simulate browser focus ring
140 outline: dotted 1px; // Firefox style
141 outline: auto -webkit-focus-ring-color; // Webkit style
142 }
143 }