fixed bad label markup

This commit is contained in:
Kevin Ross 2015-11-18 14:53:05 -06:00
parent 4695eda87b
commit 2b6d9ea37b
11 changed files with 285 additions and 200 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -508,34 +508,34 @@
<h2>Validation</h2> <h2>Validation</h2>
<div class="form-group label-floating"> <div class="form-group label-floating">
<label for="111">email</label> <label for="111" class="control-label">email</label>
<input type="email" class="form-control" id="111"> <input type="email" class="form-control" id="111">
</div> </div>
<div class="form-group label-floating"> <div class="form-group label-floating">
<label for="222">number</label> <label for="222" class="control-label">number</label>
<input type="number" class="form-control" id="222"> <input type="number" class="form-control" id="222">
</div> </div>
<h2>Disabled</h2> <h2>Disabled</h2>
<div class="form-group label-floating"> <div class="form-group label-floating">
<label for="333">email</label> <label for="333" class="control-label">email</label>
<input disabled type="text" class="form-control" id="333"> <input disabled type="text" class="form-control" id="333">
</div> </div>
<div class="form-group label-floating"> <div class="form-group label-floating">
<label for="444">number</label> <label for="444" class="control-label">number</label>
<input disabled type="text" class="form-control" id="444"> <input disabled type="text" class="form-control" id="444">
</div> </div>
<h2>Hints</h2> <h2>Hints</h2>
<div class="form-group label-floating"> <div class="form-group label-floating">
<label for="555">label</label> <label for="555" class="control-label">label</label>
<input type="text" class="form-control" id="555"> <input type="text" class="form-control" id="555">
<p class="help-block">Some helpful hint</p> <p class="help-block">Some helpful hint</p>
</div> </div>
<div class="form-group label-floating"> <div class="form-group label-floating">
<label for="676">label</label> <label for="676" class="control-label">label</label>
<input type="email" class="form-control" id="676"> <input type="email" class="form-control" id="676">
<p class="help-block">A valid email contains an @ character</p> <p class="help-block">A valid email contains an @ character</p>
</div> </div>
@ -547,7 +547,7 @@
<input type="text" class="form-control" placeholder="placeholder"> <input type="text" class="form-control" placeholder="placeholder">
</div> </div>
<div class="form-group has-success label-floating"> <div class="form-group has-success label-floating">
<label for="777">floating label</label> <label for="777" class="control-label">floating label</label>
<input type="text" class="form-control" id="777"> <input type="text" class="form-control" id="777">
</div> </div>
</div> </div>

View File

@ -82,11 +82,15 @@
// Switch bg on // Switch bg on
// SASS conversion note: please mirror any content change in _mixins-shared.scss bg-color-variations-content // SASS conversion note: please mirror any content change in _mixins-shared.scss bg-color-variations-content
.generic-variations(~" label input[type=checkbox]:checked + .toggle", @primary, { background-color: fade(@material-color, 50%); }); .generic-variations(~" label input[type=checkbox]:checked + .toggle", @primary, {
background-color: fade(@material-color, 50%);
});
// Handle on // Handle on
// SASS conversion note: please mirror any content change in _mixins-shared.scss variations-content // SASS conversion note: please mirror any content change in _mixins-shared.scss variations-content
.variations(~" label input[type=checkbox]:checked + .toggle:after", background-color, @primary); .variations(~" label input[type=checkbox]:checked + .toggle:after", background-color, @primary);
// Ripple on // Ripple on
.generic-variations(~" label input[type=checkbox]:checked + .toggle:active:after", @primary, { box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px fade(@material-color, 10%); }); .generic-variations(~" label input[type=checkbox]:checked + .toggle:active:after", @primary, {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px fade(@material-color, 10%);
});
} }
} }

View File

@ -138,12 +138,6 @@
// Card // Card
@card-body-text: @lightbg-text; @card-body-text: @lightbg-text;
@card-body-background: #fff; @card-body-background: #fff;

View File

@ -4,11 +4,38 @@
.form-horizontal .checkbox { .form-horizontal .checkbox {
padding-top: 20px; padding-top: 20px;
} }
@mixin form-group-checkbox-variant($placeholder-font-size, $line-height){
.checkbox {
label {
font-size: $placeholder-font-size;
line-height: $line-height;
font-weight: normal;
}
}
}
.form-group {
// default label size/location
@include form-group-checkbox-variant($md-input-font-size-base, $md-input-line-height-base);
// sm label size/location
&.form-group-sm {
@include form-group-checkbox-variant($md-input-font-size-small, $md-input-line-height-small);
}
// lg label size/location
&.form-group-lg {
@include form-group-checkbox-variant($md-input-font-size-large, $md-input-line-height-large);
}
.checkbox { .checkbox {
transform: translateZ(0); // Force 3d rendering transform: translateZ(0); // Force 3d rendering
label { label {
cursor: pointer; cursor: pointer;
padding-left: 0; // Reset for Bootstrap rule padding-left: 0; // Reset for Bootstrap rule
color: $checkbox-label-color;
} }
// Hide native checkbox // Hide native checkbox
@ -48,8 +75,7 @@
display: inline-block; display: inline-block;
width: $checkbox-size; width: $checkbox-size;
height: $checkbox-size; height: $checkbox-size;
border: 2px solid; border: 2px solid $checkbox-border-color;
border-color: rgba(0,0,0,.54);
border-radius: 2px; border-radius: 2px;
overflow: hidden; overflow: hidden;
z-index: 1; z-index: 1;
@ -105,8 +131,10 @@
} }
// Style for disabled inputs // Style for disabled inputs
fieldset[disabled] &,
fieldset[disabled] & input[type=checkbox], fieldset[disabled] & input[type=checkbox],
input[type=checkbox][disabled]:not(:checked) ~ .checkbox-material .check:before, input[type=checkbox][disabled]:not(:checked) ~ .checkbox-material .check:before,
input[type=checkbox][disabled]:not(:checked) ~ .checkbox-material .check,
input[type=checkbox][disabled] + .circle { input[type=checkbox][disabled] + .circle {
opacity: 0.5; opacity: 0.5;
} }
@ -116,11 +144,11 @@
} }
@include variations(unquote(" input[type=checkbox]:checked + .checkbox-material .check:after"), background-color, $success); @include variations(unquote(" input[type=checkbox]:checked + .checkbox-material .check:after"), background-color, $success);
@include variations(unquote(" input[type=checkbox]:checked + .checkbox-material .check:before"), color, #4caf50); @include variations(unquote(" input[type=checkbox]:checked + .checkbox-material .check:before"), color, $checkbox-checked-color);
@include variations(unquote(" input[type=checkbox]:checked + .checkbox-material .check"), color, #4caf50); @include variations(unquote(" input[type=checkbox]:checked + .checkbox-material .check"), color, $checkbox-checked-color);
@include variations(unquote(" input[type=checkbox]:checked + .checkbox-material .check"), border-color, #4caf50); @include variations(unquote(" input[type=checkbox]:checked + .checkbox-material .check"), border-color, $checkbox-checked-color);
}
} }
@keyframes checkbox-on { @keyframes checkbox-on {
0% { 0% {

View File

@ -3,11 +3,40 @@
.form-horizontal .radio { .form-horizontal .radio {
margin-bottom: 10px; margin-bottom: 10px;
} }
@mixin form-group-radio-variant($placeholder-font-size, $line-height){
.radio {
label {
font-size: $placeholder-font-size;
line-height: $line-height;
font-weight: normal;
}
}
}
.form-group {
// default label size/location
@include form-group-radio-variant($md-input-font-size-base, $md-input-line-height-base);
// sm label size/location
&.form-group-sm {
@include form-group-radio-variant($md-input-font-size-small, $md-input-line-height-small);
}
// lg label size/location
&.form-group-lg {
@include form-group-radio-variant($md-input-font-size-large, $md-input-line-height-large);
}
}
.radio { .radio {
label { label {
cursor: pointer; cursor: pointer;
padding-left: 45px; padding-left: 45px;
position: relative; position: relative;
color: $radio-label-color;
span { span {
display: block; display: block;
position: absolute; position: absolute;
@ -16,7 +45,7 @@
transition-duration: 0.2s; transition-duration: 0.2s;
} }
.circle { .circle {
border: 2px solid $lightbg-text; border: 2px solid $radio-border-color;
height: 15px; height: 15px;
width: 15px; width: 15px;
border-radius: 100%; border-radius: 100%;
@ -74,7 +103,6 @@
input[type=radio][disabled] ~ .check { input[type=radio][disabled] ~ .check {
background-color: $lightbg-text; background-color: $lightbg-text;
} }
} }
@keyframes rippleOn { @keyframes rippleOn {

View File

@ -1,13 +1,39 @@
// This file has been autogenerated by grunt task lessToSass. Any changes will be overwritten. // This file has been autogenerated by grunt task lessToSass. Any changes will be overwritten.
@mixin form-group-toggle-variant($placeholder-font-size, $line-height){
.togglebutton {
label {
font-size: $placeholder-font-size;
line-height: $line-height;
font-weight: normal;
}
}
}
.form-group {
// default label size/location
@include form-group-toggle-variant($md-input-font-size-base, $md-input-line-height-base);
// sm label size/location
&.form-group-sm {
@include form-group-toggle-variant($md-input-font-size-small, $md-input-line-height-small);
}
// lg label size/location
&.form-group-lg {
@include form-group-toggle-variant($md-input-font-size-large, $md-input-line-height-large);
}
.togglebutton { .togglebutton {
vertical-align: middle; vertical-align: middle;
&, label, input, .toggle { &, label, input, .toggle {
user-select: none; user-select: none;
} }
label { label {
font-weight: 400;
cursor: pointer; cursor: pointer;
color: $togglebutton-label-color;
// Hide original checkbox // Hide original checkbox
input[type=checkbox] { input[type=checkbox] {
opacity: 0; opacity: 0;
@ -65,3 +91,4 @@
// Ripple on // Ripple on
@include bg-box-shadow-variations(unquote(" label input[type=checkbox]:checked + .toggle:active:after"), $primary); @include bg-box-shadow-variations(unquote(" label input[type=checkbox]:checked + .toggle:active:after"), $primary);
} }
}

View File

@ -140,12 +140,6 @@ $md-input-height-small: (floor($md-input-font-size-small * $md-input
// Card // Card
$card-body-text: $lightbg-text !default; $card-body-text: $lightbg-text !default;
$card-body-background: #fff !default; $card-body-background: #fff !default;
@ -158,6 +152,9 @@ $background-disabled: #eaeaea !default;
$checkbox-size: 20px !default; $checkbox-size: 20px !default;
$checkbox-animation-ripple: 500ms !default; $checkbox-animation-ripple: 500ms !default;
$checkbox-animation-check: 0.3s !default; $checkbox-animation-check: 0.3s !default;
$checkbox-checked-color: #4caf50 !default;
$checkbox-label-color: rgba(0, 0, 0, .54) !default;
$checkbox-border-color: $checkbox-label-color !default;
// Popovers and Popups // Popovers and Popups
$popover-background: rgba(101, 101, 101, 0.9) !default; $popover-background: rgba(101, 101, 101, 0.9) !default;
@ -166,3 +163,10 @@ $popover-color: #ececec !default;
// Dropdown Menu // Dropdown Menu
$dropdown-radius: 2px !default; $dropdown-radius: 2px !default;
$dropdown-font-size: 16px !default; $dropdown-font-size: 16px !default;
// Toggle
$togglebutton-label-color: $checkbox-label-color !default;
// Radio:
$radio-label-color: $checkbox-label-color !default;
$radio-border-color: $checkbox-border-color !default;