Merge "Add data provider to split MediaHandlerTest::testFitBoxWidth"
[lhc/web/wiklou.git] / resources / src / mediawiki.ui / components / radio.less
index 6d8978e..bb012eb 100644 (file)
 //
 // Markup:
 // <div class="mw-ui-radio">
-//   <input type="radio" id="kss-example-7" name="kss-example-7">
-//   <label for="kss-example-7">Standard radio</label>
+//   <input type="radio" id="kss-example-4" name="kss-example-4">
+//   <label for="kss-example-4">Standard radio</label>
 // </div>
 // <div class="mw-ui-radio">
-//   <input type="radio" id="kss-example-7-checked" name="kss-example-7" checked>
-//   <label for="kss-example-7-checked">Standard checked radio</label>
+//   <input type="radio" id="kss-example-4-checked" name="kss-example-4" checked>
+//   <label for="kss-example-4-checked">Standard checked radio</label>
 // </div>
 // <div class="mw-ui-radio">
-//   <input type="radio" id="kss-example-7-disabled" name="kss-example-7-disabled" disabled>
-//   <label for="kss-example-7-disabled">Disabled radio</label>
+//   <input type="radio" id="kss-example-4-disabled" name="kss-example-4-disabled" disabled>
+//   <label for="kss-example-4-disabled">Disabled radio</label>
 // </div>
 // <div class="mw-ui-radio">
-//   <input type="radio" id="kss-example-7-disabled-checked" name="kss-example-7-disabled" disabled checked>
-//   <label for="kss-example-7-disabled-checked">Disabled checked radio</label>
+//   <input type="radio" id="kss-example-4-disabled-checked" name="kss-example-4-disabled" disabled checked>
+//   <label for="kss-example-4-disabled-checked">Disabled checked radio</label>
 // </div>
 //
-// Styleguide 7.
+// Styleguide 4.
 .mw-ui-radio {
        display: inline-block;
        vertical-align: middle;
@@ -42,6 +42,7 @@
        line-height: @radioSize;
 
        * {
+               // reset font sizes (see bug 72727)
                font: inherit;
                vertical-align: middle;
        }
@@ -59,8 +60,9 @@
 
                // the pseudo before element of the label after the radio now looks like a radio
                & + label::before {
-                       cursor: pointer;
+                       .transition( 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) );
                        content: '';
+                       cursor: pointer;
                        .box-sizing(border-box);
                        position: absolute;
                        left: 0;
                        height: @radioSize;
                        background-color: #fff;
                        border: 1px solid @colorGray7;
-               }
-
-               // when the input is checked, style the label pseudo before element that followed as a checked radio
-               &:checked + label::before {
                        .background-image-svg('images/radio_checked.svg', 'images/radio_checked.png');
                        .background-size( @radioSize, @radioSize );
                        background-repeat: no-repeat;
                        background-position: center center;
                        background-origin: border-box;
+                       background-size: 0 0;
+               }
+
+               // when the input is checked, style the label pseudo before element that followed as a checked radio
+               &:checked + label::before {
+                       background-size: 100% 100%;
+               }
+
+               &:active + label::before {
+                       background-color: @colorGray13;
+                       border-color: @colorGray13;
                }
 
                &:focus + label::before {
                        border-bottom-width: 3px;
                }
 
-               &:active + label::before {
-                       background-color: @colorGray13;
-                       border-color: @colorGray13;
-               }
-
-               // disabled checked boxes have a gray background
+               // disabled radios have a gray background
                &:disabled + label::before {
                        cursor: default;
-                       border-color: @colorGray14;
                        background-color: @colorGray14;
+                       border-color: @colorGray14;
                }
 
-               // disabled and checked boxes have a white circle
+               // disabled and checked radios have a white circle
                &:disabled:checked + label::before {
                        .background-image-svg('images/radio_disabled.svg', 'images/radio_disabled.png');
                }