// The MIT License (MIT) // // Copyright (c) 2011-2014 Webcomm Pty Ltd // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. @import "@{bootstrap-path}/forms.less"; p.control input.checkbox, p.control input.radio { margin-right: 6px; } .input-text { &:extend(.form-control); } .form-list { &:extend(.clearfix all); li { &:extend(.form-group); &:extend(.clearfix all); } label { position: relative; } label.required em { float: right; font-style: normal; color: @alert-danger-text; position: absolute; top: 0; right: -8px; } li.control label { float: none; display: block; } li.control input.radio, li.control input.checkbox { margin-right: 6px; // Reset bootstrap's radio styles display: inline; float: left; margin-top: 2px; } li.control .input-box { clear: none; display: inline; width: auto; } .field { float: left; width: 50%; padding-right: (@grid-gutter-width / 2); padding-left: (@grid-gutter-width / 2); &:first-child, &:first-of-type { padding-left: 0; } &:last-child { padding-right: 0; } } textarea, select { &:extend(.form-control); } select[multiple], textarea { height: auto; } li.additional-row { border-top: 1px solid @legend-border-color; margin-top: 10px; padding-top: 7px; p { &:extend(.clearfix all); } .btn-remove { float: right; margin: 5px 0 0; } } .input-range { input.input-text, span { display: inline-block; } input.input-text { width: 40%; } } } .form-list-narrow { li { margin-bottom: 0; } li .input-box { margin-bottom: 6px; } li.wide .input-box { width: 260px; } li.wide input.input-text, li.wide textarea { width: 254px } li.wide select { width: 260px; } } // Customer .form-list { // Pattern for combinations below is // prefix-FIRSTNAME-middlename-LASTNAME-suffix // where FIRSTNAME and LASTNAME are more important // than prefix, middlename and suffix. Present // item are represented by a number and a dash. // This ensures we hit every concevable combination // 1-1-0-1-0 .customer-name-prefix { .name-prefix { width: 16%; } .name-firstname, .name-lastname { width: 42%; } } // 1-1-1-1-0 .customer-name-prefix-middlename { .name-prefix, .name-middlename, { width: 16%; } .name-firstname, .name-lastname { width: 34%; } } // 1-1-0-1-1 .customer-name-prefix-suffix { .name-prefix, .name-suffix { width: 16%; } .name-firstname, .name-lastname { width: 34%; } } // 1-1-1-1-1 .customer-name-prefix-middlename-suffix { .name-prefix, .name-middlename, .name-suffix { width: 12%; } .name-firstname, .name-lastname { width: 32%; } } // 0-1-1-1-0 .customer-name-middlename { .name-middlename { width: 16%; } .name-firstname, .name-lastname { width: 42%; } } // 0-1-1-1-1 .customer-name-middlename-suffix { .name-middlename, .name-suffix, { width: 16%; } .name-firstname, .name-lastname { width: 34%; } } // 0-1-0-1-1 .customer-name-suffix { .name-suffix { width: 16%; } .name-firstname, .name-lastname { width: 42%; } } // Date of birth is easy, // it's just 30% 30% 40% .customer-dob { .dob-day, .dob-month, .dob-year { float: left; padding-right: (@grid-gutter-width / 2); padding-left: (@grid-gutter-width / 2); &:first-child { padding-left: 0; } } // Unfortunately, the last child is not the // last element. However we can use a clever // selector to find this out. .dob-day + .dob-month + .dob-year, .dob-month + .dob-day + .dob-year, .dob-year + .dob-day + .dob-month, .dob-year + .dob-month + .dob-day { padding-right: 0; } .dob-day, .dob-month { width: 30%; } .dob-year { width: 40%; } } } .fieldset { // &:extend(.clearfix all); } .legend { display: block; width: 100%; padding: 0; margin-bottom: @line-height-computed; font-size: (@font-size-base * 1.5); font-weight: normal; line-height: inherit; color: @legend-color; border: 0; border-bottom: 1px solid @legend-border-color; } // Button sets .buttons-set { &:extend(.clearfix all); margin: 4em 0 0; padding: 8px 0 0; border-top: 1px solid @legend-border-color; line-height: @input-height-base; text-align: right; } .buttons-set p.required { margin: 0 0 10px; } .buttons-set .back-link { float: left; margin: 0; } .buttons-set button.button { float: right; margin-left: 5px; } .buttons-set-order { margin: 10px 0 0; } .buttons-set-order .please-wait { padding: 12px 7px 0 0; } // Form Validation .validation-advice { clear: both; color: @alert-danger-text; } .validation-failed { border-color: @alert-danger-text !important; .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work &:focus { border-color: darken(@alert-danger-text, 10%) !important; @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@alert-danger-text, 20%); -webkit-box-shadow: @shadow !important; box-shadow: @shadow !important; } } p.required { text-align: right; color: @alert-danger-text; } // Expiration date and CVV number validation fix .v-fix { float: left; } .v-fix .validation-advice { display: block; width: 12em; margin-right: -12em; position: relative; }