// Forms.less // Base styles for various input types, form layouts, and states // ------------------------------------------------------------- // Form controls // ------------------------- // Shared size and type resets select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { padding: 4px 8px; } // Reset appearance properties for textual inputs and textarea // Declare width for legacy (can't be on input[type=*] selectors or it's too specific) .g-select, input, textarea { width: 210px; } // Reset height since textareas have rows textarea { padding-right: 4px; } // Everything else textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { border: 1px solid #d9d9d9; border-top: 1px solid #c0c0c0; @include border-radius($inputBorderRadius); @include box-shadow(none); @include transition(none); &:hover { border: 1px solid #b9b9b9; border-top: 1px solid #a0a0a0; @include box-shadow(inset 0 1px 2px rgba(0,0,0,0.1)); z-index: 2; } // Focus state &:focus, &.focused { outline: none; border: 1px solid #4d90fe; @include transition(none); @include box-shadow(inset 0 1px 2px rgba(0,0,0,0.3)); } } // CHECKBOXES & RADIOS // ------------------- // Google style input[type="checkbox"], input[type="radio"] { -webkit-appearance: none; appearance: none; width: 13px; height: 13px; background: white; border: 1px solid #dcdcdc; @include border-radius(1px); @include box-sizing(border-box); position: relative; } input[type="radio"] { @include border-radius(1em); width: 15px; height: 15px; } input[type="checkbox"]:hover { border-color: #c6c6c6; @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.1)); } input[type="checkbox"]:active, input[type="radio"]:active { border-color: #c6c6c6; background: #EBEBEB; } input[type="checkbox"]:checked, input[type="radio"]:checked { background: #fff; } input[type="checkbox"]:checked::after { content: asset-url("checkmark.png", image); display: block; position: absolute; top: -6px; left: -5px; } input[type="radio"]:checked::after { content: ''; display: block; position: relative; top: 3px; left: 3px; width: 7px; height: 7px; background: #666; @include border-radius(1em); } input[type="checkbox"]:focus, input[type="radio"]:focus { outline: none; border-color: #4d90fe; } // DISABLED STATE // -------------- // Disabled and read-only inputs input[disabled], select[disabled], textarea[disabled] { cursor: not-allowed; border: 1px solid #e5e5e5; background: #f1f1f1; &:hover { @include box-shadow(none); } } input[readonly], select[readonly], textarea[readonly] { cursor: not-allowed; border: 1px solid #d9d9d9; &:hover, &:focus { @include box-shadow(none); } } // FORM FIELD FEEDBACK STATES // -------------------------- // HTML5 invalid states // Shares styles with the .control-group.error above .g-select:focus:required:invalid, input:focus:required:invalid, textarea:focus:required:invalid, select:focus:required:invalid { color: #b94a48; border-color: #ee5f5b; &:focus { border-color: #4d90fe; @include box-shadow(0); } } // HORIZONTAL & VERTICAL FORMS // --------------------------- // Common properties // ----------------- .form-search, .form-inline, .form-horizontal { .g-select, input, textarea, select, .help-inline, .uneditable-input, .input-prepend, .input-append { display: inline-block; @include ie7-inline-block(); margin-bottom: 0; } // Re-hide hidden elements due to specifity .hide { display: none; } } .btn.g-select { font-weight: bold; text-align: left; padding: 4px 8px; } .btn.g-select:after { content: ""; position: absolute; display: inline-block; top: 9px; right: 6px; width: 7px; height: 11px; background-image: asset-url("grey-disclosure-arrow-up-down.png", image); background-repeat: no-repeat; }