]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Fix no-label checkboxes/radios
authorMark Otto <markdotto@gmail.com>
Wed, 29 Apr 2015 19:01:57 +0000 (12:01 -0700)
committerMark Otto <markdotto@gmail.com>
Wed, 29 Apr 2015 19:01:57 +0000 (12:01 -0700)
Because we use `position: absolute` on our inputs, when there’s no
label the `.checkbox` ends up having no computed height. To avoid
rendering errors when there’s no label text, we reset the `position` to
`static` for normal rendering.

scss/_forms.scss

index 671be46fb9b50b309f403eed50db458770218591..78ca70295f58e7d34a96503cce46b4f3b3469442 100644 (file)
   margin-bottom: ($spacer * .75);
 
   label {
-    // Ensure the input doesn't jump when there is no text
-    min-height: $line-height-computed;
     padding-left: 1.25rem;
     margin-bottom: 0;
     font-weight: normal;
     cursor: pointer;
+
+    // When there's no labels, don't position the input.
+    input:only-child {
+      position: static;
+    }
   }
 }
 .radio input[type="radio"],