Add explanatory comment to unexpected line of code
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / styles / mw.rcfilters.ui.FilterTagMultiselectWidget.less
1 @import 'mediawiki.mixins';
2 @import 'mediawiki.ui/variables';
3 @import 'mw.rcfilters.variables';
4
5 .mw-rcfilters-ui-filterTagMultiselectWidget {
6 max-width: none;
7
8 .oo-ui-tagMultiselectWidget-input input {
9 // Make sure this uses the interface direction, not the content direction
10 direction: ltr;
11 border-bottom-right-radius: 0;
12 height: 2.5em;
13 }
14
15 &.oo-ui-widget-enabled {
16 .oo-ui-tagMultiselectWidget-handle {
17 border: 1px solid @colorGray10;
18 border-bottom: 0;
19 background-color: @colorGray15;
20 border-radius: 2px 2px 0 0;
21 padding: 0 0.6em 0.6em 0.6em;
22 margin-top: 1em;
23 line-height: normal;
24 }
25
26 // Hamburger menu for dropdown.
27 .oo-ui-tagMultiselectWidget-input > .oo-ui-icon-menu {
28 cursor: pointer;
29 }
30 }
31
32 .mw-rcfilters-collapsed & {
33 // Taking from the handle, since border-bottom is set on the
34 // filters view which is hidden when collapsed
35 border-bottom: 1px solid @colorGray10;
36
37 &.mw-rcfilters-ui-filterTagMultiselectWidget.oo-ui-widget-enabled .oo-ui-tagMultiselectWidget-handle {
38 padding-bottom: 0;
39 padding-top: 0;
40 }
41
42 .mw-rcfilters-ui-filterTagMultiselectWidget-wrapper-hideshow {
43 border-left: 1px solid @colorGray10;
44 }
45
46 &.oo-ui-tagMultiselectWidget-outlined {
47 // per T177206#4271707 we avoid keeping the collapsed element to take the whole width of the screen
48 // we are providing enough cues (keeping the labels) for it to be clear that the panel gets compacted
49 // to the left and the user not to feel lost with the transition.
50 width: unset;
51 max-width: 100%;
52 }
53
54 // Hide inner elements
55 .mw-rcfilters-ui-filterTagMultiselectWidget-wrapper-filters,
56 .mw-rcfilters-ui-filterTagMultiselectWidget-views {
57 display: none;
58 }
59 }
60
61 .oo-ui-tagMultiselectWidget.oo-ui-widget-enabled &-animate.oo-ui-tagMultiselectWidget-handle {
62 .transition( background-color 500ms ease-out );
63 }
64
65 .oo-ui-tagMultiselectWidget.oo-ui-widget-enabled &-emphasize.oo-ui-tagMultiselectWidget-handle {
66 background-color: @background-color-primary;
67 }
68
69 &-hideshowButton.oo-ui-buttonElement > .oo-ui-buttonElement-button {
70 // Override the OOUI default for buttons
71 font-weight: normal;
72 }
73
74 &-wrapper {
75 &-top {
76 display: flex;
77 flex-wrap: nowrap;
78 justify-content: space-between;
79
80 &-title {
81 padding: 0.6em 0; // Same top padding as the handle
82 flex: 0 0 auto;
83 }
84
85 &-queryName {
86 flex: 1 1 auto;
87 padding: 0.6em 0; // Same top padding as the handle
88 white-space: nowrap;
89 min-width: 0; // This has to be here to enable the text truncation
90 overflow: hidden;
91 text-overflow: ellipsis;
92 }
93
94 &-hideshow {
95 flex: 0 0 auto;
96 margin-left: 0.5em;
97 padding-left: 0.5em;
98 }
99 }
100
101 &-content {
102 &-title {
103 font-weight: bold;
104 color: @colorGray5;
105 white-space: nowrap;
106 }
107
108 &-savedQueryTitle {
109 color: @colorGray2;
110 padding-left: 1em;
111 font-weight: bold;
112 vertical-align: top;
113 overflow: hidden;
114 text-overflow: ellipsis;
115 white-space: nowrap;
116 // This is necessary for Firefox to be able to
117 // truncate the text. Without this rule, the label
118 // is treated as if it's full-width, and while it is
119 // being truncated with the overflow:hidden,
120 // the ellipses isn't showing properly.
121 // This rule seems to convince Firefox to re-render,
122 // fix the label's width properly, and add the ellipses
123 max-width: 100%;
124 }
125 }
126 }
127
128 &-views {
129 &-input {
130 width: 100%;
131 }
132
133 &-select {
134 width: 1em;
135
136 &-widget.oo-ui-widget {
137 display: block;
138 .box-sizing( border-box );
139 height: 2.5em;
140 border: 1px solid @colorGray10;
141 border-left-width: 0;
142 border-radius: 0 0 @borderRadius 0;
143 // For `padding-right` using the 'left' value from
144 // .oo-ui-buttonElement-frameless.oo-ui-iconElement >
145 // .oo-ui-buttonElement-button > .oo-ui-iconElement-icon
146 padding-right: 0.35714286em;
147 text-align: right;
148 white-space: nowrap;
149
150 .oo-ui-buttonOptionWidget:first-child {
151 margin-left: 0;
152 }
153 }
154 }
155 }
156
157 &-emptyFilters {
158 color: @colorGray7;
159 }
160
161 &-cell-filters {
162 width: 100%;
163
164 div.oo-ui-tagMultiselectWidget-group {
165 margin-top: 0.2em;
166 display: block;
167 }
168 }
169
170 &-cell-reset {
171 text-align: right;
172 padding-left: 0.5em;
173 }
174 }