// stylelint-disable selector-no-qualifying-type, property-no-vendor-prefix, media-feature-name-no-vendor-prefix // Form validation states // // Used in forms.less to generate the form validation CSS for warnings, errors, // and successes. .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) { // Color the label and help text .help-block, .control-label, .radio, .checkbox, .radio-inline, .checkbox-inline, &.radio label, &.checkbox label, &.radio-inline label, &.checkbox-inline label { color: @text-color; } // Set the border and box shadow on specific inputs to match .form-control { border-color: @border-color; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); // Redeclare so transitions work &:focus { border-color: darken(@border-color, 10%); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px lighten(@border-color, 20%); } } // Optional feedback icon .form-control-feedback { color: @text-color; } } // Form control focus state // // Generate a customized focus state and for any input with the specified color, // which defaults to the `@input-border-focus` variable. // // We highly encourage you to not customize the default value, but instead use // this to tweak colors on an as-needed basis. This aesthetic change is based on // WebKit's default styles, but applicable to a wider range of browsers. Its // usability and accessibility should be taken into account with any change. // // Example usage: change the default blue border and shadow to white for better // contrast against a dark gray background. .form-control-focus(@color: @input-border-focus) { @color-rgba: rgba(red(@color), green(@color), blue(@color), 0.6); &:focus { border-color: @color; outline: 0; box-shadow: ~'inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px @{color-rgba}'; } } // Form control sizing // // Relative text size, padding, and border-radii changes for form controls. For // horizontal sizing, wrap controls in the predefined grid classes. `s in some browsers, due to the limited stylability of `s in IE10+. &::-ms-expand { background-color: transparent; border: 0; } // Disabled and read-only inputs // // HTML5 says that controls under a fieldset > legend:first-child won't be // disabled if the fieldset is disabled. Due to implementation difficulty, we // don't honor that edge case; we style them as disabled anyway. &[disabled], &[readonly], fieldset[disabled] & { background-color: @input-bg-disabled; opacity: 1; // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655 } &[disabled], fieldset[disabled] & { cursor: @cursor-disabled; } // Reset height for `textarea`s textarea& { height: auto; } } // Special styles for iOS temporal inputs // // In Mobile Safari, setting `display: block` on temporal inputs causes the // text within the input to become vertically misaligned. As a workaround, we // set a pixel line-height that matches the given height of the input, but only // for Safari. See https://bugs.webkit.org/show_bug.cgi?id=139848 // // Note that as of 9.3, iOS doesn't support `week`. @media screen and (-webkit-min-device-pixel-ratio: 0) { input[type='date'], input[type='time'], input[type='datetime-local'], input[type='month'] { &.form-control { line-height: @input-height-base; } &.input-sm { line-height: @input-height-small; } &.input-lg { line-height: @input-height-large; } } } // Form groups // // Designed to help with the organization and spacing of vertical forms. For // horizontal forms, use the predefined grid classes. .form-group { margin-bottom: @form-group-margin-bottom; } // Checkboxes and radios // // Indent the labels to position radios/checkboxes as hanging controls. .radio, .checkbox { position: relative; display: block; margin-top: 10px; margin-bottom: 10px; // These are used on elements with