mediawiki.ui: checkbox: Render "on top of" the label
[lhc/web/wiklou.git] / resources / src / mediawiki.ui / components / checkbox.less
index 089504a..ac5becb 100644 (file)
@@ -42,7 +42,7 @@
 .client-js .mw-ui-checkbox:not(#noop) {
        // Position relatively so we can make use of absolute pseudo elements
        position: relative;
-       line-height: @checkboxSize;
+       display: table;
 
        * {
                // reset font sizes (see bug 72727)
@@ -54,6 +54,9 @@
                // we hide the input element as instead we will style the label that follows
                // we use opacity so that VoiceOver software can still identify it
                opacity: 0;
+               // Render "on top of" the label, so that it's still clickable (T98905)
+               z-index: 1;
+               position: relative;
                // ensure the invisible checkbox takes up the required width
                width: @checkboxSize;
                height: @checkboxSize;
                max-width: none;
                margin: 0;
                margin-right: 0.4em;
+               display: table-cell;
+
+               & + label {
+                       display: table-cell;
+               }
 
                // the pseudo before element of the label after the checkbox now looks like a checkbox
                & + label::before {
                        border-radius: @borderRadius;
                        width: @checkboxSize;
                        height: @checkboxSize;
+                       line-height: @checkboxSize;
                        background-color: #fff;
                        border: 1px solid @colorGray7;
+                       // align the checkbox to middle of the text
+                       top: 50%;
+                       margin-top: -1em;
                        .background-image-svg('images/checked.svg', 'images/checked.png');
                        .background-size( @checkboxSize - 0.2em, @checkboxSize - 0.2em );
                        background-repeat: no-repeat;