annotate static/bootstrap/less/forms.less @ 158:e53a3b64dfd8

Renamed main Wikked script.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 09 Jan 2014 20:59:41 -0800
parents d29e2f337b00
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
1 //
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
2 // Forms
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
3 // --------------------------------------------------
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
4
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
5
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
6 // Normalize non-controls
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
7 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
8 // Restyle and baseline non-control form elements.
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
9
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
10 fieldset {
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
11 padding: 0;
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
12 margin: 0;
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
13 border: 0;
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
14 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
15
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
16 legend {
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
17 display: block;
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
18 width: 100%;
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
19 padding: 0;
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
20 margin-bottom: @line-height-computed;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
21 font-size: (@font-size-base * 1.5);
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
22 line-height: inherit;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
23 color: @legend-color;
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
24 border: 0;
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
25 border-bottom: 1px solid @legend-border-color;
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
26 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
27
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
28 label {
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
29 display: inline-block;
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
30 margin-bottom: 5px;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
31 font-weight: bold;
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
32 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
33
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
34
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
35 // Normalize form controls
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
36
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
37 // Override content-box in Normalize (* isn't specific enough)
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
38 input[type="search"] {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
39 .box-sizing(border-box);
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
40 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
41
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
42 // Position radios and checkboxes better
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
43 input[type="radio"],
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
44 input[type="checkbox"] {
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
45 margin: 4px 0 0;
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
46 margin-top: 1px \9; /* IE8-9 */
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
47 line-height: normal;
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
48 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
49
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
50 // Set the height of select and file controls to match text inputs
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
51 input[type="file"] {
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
52 display: block;
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
53 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
54
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
55 // Make multiple select elements height not fixed
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
56 select[multiple],
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
57 select[size] {
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
58 height: auto;
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
59 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
60
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
61 // Fix optgroup Firefox bug per https://github.com/twbs/bootstrap/issues/7611
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
62 select optgroup {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
63 font-size: inherit;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
64 font-style: inherit;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
65 font-family: inherit;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
66 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
67
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
68 // Focus for select, file, radio, and checkbox
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
69 input[type="file"]:focus,
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
70 input[type="radio"]:focus,
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
71 input[type="checkbox"]:focus {
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
72 .tab-focus();
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
73 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
74
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
75 // Fix for Chrome number input
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
76 // Setting certain font-sizes causes the `I` bar to appear on hover of the bottom increment button.
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
77 // See https://github.com/twbs/bootstrap/issues/8350 for more.
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
78 input[type="number"] {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
79 &::-webkit-outer-spin-button,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
80 &::-webkit-inner-spin-button {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
81 height: auto;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
82 }
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
83 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
84
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
85 // Adjust output element
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
86 output {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
87 display: block;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
88 padding-top: (@padding-base-vertical + 1);
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
89 font-size: @font-size-base;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
90 line-height: @line-height-base;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
91 color: @input-color;
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
92 vertical-align: middle;
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
93 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
94
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
95
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
96 // Common form controls
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
97 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
98 // Shared size and type resets for form controls. Apply `.form-control` to any
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
99 // of the following form controls:
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
100 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
101 // select
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
102 // textarea
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
103 // input[type="text"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
104 // input[type="password"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
105 // input[type="datetime"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
106 // input[type="datetime-local"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
107 // input[type="date"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
108 // input[type="month"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
109 // input[type="time"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
110 // input[type="week"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
111 // input[type="number"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
112 // input[type="email"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
113 // input[type="url"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
114 // input[type="search"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
115 // input[type="tel"]
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
116 // input[type="color"]
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
117
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
118 .form-control {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
119 display: block;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
120 width: 100%;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
121 height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
122 padding: @padding-base-vertical @padding-base-horizontal;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
123 font-size: @font-size-base;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
124 line-height: @line-height-base;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
125 color: @input-color;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
126 vertical-align: middle;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
127 background-color: @input-bg;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
128 background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
129 border: 1px solid @input-border;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
130 border-radius: @input-border-radius;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
131 .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
132 .transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s");
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
133
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
134 // Customize the `:focus` state to imitate native WebKit styles.
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
135 .form-control-focus();
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
136
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
137 // Placeholder
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
138 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
139 // Placeholder text gets special styles because when browsers invalidate entire
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
140 // lines if it doesn't understand a selector/
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
141 .placeholder();
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
142
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
143 // Disabled and read-only inputs
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
144 // Note: HTML5 says that controls under a fieldset > legend:first-child won't
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
145 // be disabled if the fieldset is disabled. Due to implementation difficulty,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
146 // we don't honor that edge case; we style them as disabled anyway.
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
147 &[disabled],
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
148 &[readonly],
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
149 fieldset[disabled] & {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
150 cursor: not-allowed;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
151 background-color: @input-bg-disabled;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
152 }
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
153
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
154 // Reset height for `textarea`s
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
155 textarea& {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
156 height: auto;
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
157 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
158 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
159
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
160
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
161 // Form groups
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
162 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
163 // Designed to help with the organization and spacing of vertical forms. For
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
164 // horizontal forms, use the predefined grid classes.
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
165
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
166 .form-group {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
167 margin-bottom: 15px;
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
168 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
169
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
170
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
171 // Checkboxes and radios
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
172 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
173 // Indent the labels to position radios/checkboxes as hanging controls.
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
174
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
175 .radio,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
176 .checkbox {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
177 display: block;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
178 min-height: @line-height-computed; // clear the floating input if there is no label text
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
179 margin-top: 10px;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
180 margin-bottom: 10px;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
181 padding-left: 20px;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
182 vertical-align: middle;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
183 label {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
184 display: inline;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
185 margin-bottom: 0;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
186 font-weight: normal;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
187 cursor: pointer;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
188 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
189 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
190 .radio input[type="radio"],
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
191 .radio-inline input[type="radio"],
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
192 .checkbox input[type="checkbox"],
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
193 .checkbox-inline input[type="checkbox"] {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
194 float: left;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
195 margin-left: -20px;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
196 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
197 .radio + .radio,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
198 .checkbox + .checkbox {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
199 margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
200 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
201
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
202 // Radios and checkboxes on same line
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
203 .radio-inline,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
204 .checkbox-inline {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
205 display: inline-block;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
206 padding-left: 20px;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
207 margin-bottom: 0;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
208 vertical-align: middle;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
209 font-weight: normal;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
210 cursor: pointer;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
211 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
212 .radio-inline + .radio-inline,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
213 .checkbox-inline + .checkbox-inline {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
214 margin-top: 0;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
215 margin-left: 10px; // space out consecutive inline controls
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
216 }
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
217
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
218 // Apply same disabled cursor tweak as for inputs
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
219 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
220 // Note: Neither radios nor checkboxes can be readonly.
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
221 input[type="radio"],
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
222 input[type="checkbox"],
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
223 .radio,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
224 .radio-inline,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
225 .checkbox,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
226 .checkbox-inline {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
227 &[disabled],
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
228 fieldset[disabled] & {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
229 cursor: not-allowed;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
230 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
231 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
232
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
233 // Form control sizing
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
234 .input-sm {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
235 .input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
236 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
237
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
238 .input-lg {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
239 .input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
240 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
241
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
242
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
243 // Form control feedback states
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
244 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
245 // Apply contextual and semantic states to individual form controls.
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
246
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
247 // Warning
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
248 .has-warning {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
249 .form-control-validation(@state-warning-text; @state-warning-text; @state-warning-bg);
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
250 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
251 // Error
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
252 .has-error {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
253 .form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg);
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
254 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
255 // Success
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
256 .has-success {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
257 .form-control-validation(@state-success-text; @state-success-text; @state-success-bg);
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
258 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
259
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
260
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
261 // Static form control text
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
262 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
263 // Apply class to a `p` element to make any string of text align with labels in
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
264 // a horizontal form layout.
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
265
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
266 .form-control-static {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
267 margin-bottom: 0; // Remove default margin from `p`
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
268 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
269
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
270
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
271 // Help text
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
272 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
273 // Apply to any element you wish to create light text for placement immediately
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
274 // below a form control. Use for general help, formatting, or instructional text.
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
275
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
276 .help-block {
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
277 display: block; // account for any element using help-block
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
278 margin-top: 5px;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
279 margin-bottom: 10px;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
280 color: lighten(@text-color, 25%); // lighten the text some for contrast
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
281 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
282
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
283
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
284
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
285 // Inline forms
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
286 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
287 // Make forms appear inline(-block) by adding the `.form-inline` class. Inline
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
288 // forms begin stacked on extra small (mobile) devices and then go inline when
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
289 // viewports reach <768px.
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
290 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
291 // Requires wrapping inputs and labels with `.form-group` for proper display of
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
292 // default HTML form controls and our custom form controls (e.g., input groups).
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
293 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
294 // Heads up! This is mixin-ed into `.navbar-form` in navbars.less.
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
295
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
296 .form-inline {
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
297
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
298 // Kick in the inline
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
299 @media (min-width: @screen-sm) {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
300 // Inline-block all the things for "inline"
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
301 .form-group {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
302 display: inline-block;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
303 margin-bottom: 0;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
304 vertical-align: middle;
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
305 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
306
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
307 // In navbar-form, allow folks to *not* use `.form-group`
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
308 .form-control {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
309 display: inline-block;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
310 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
311
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
312 // Override `width: 100%;` when not within a `.form-group`
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
313 select.form-control {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
314 width: auto;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
315 }
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
316
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
317 // Remove default margin on radios/checkboxes that were used for stacking, and
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
318 // then undo the floating of radios and checkboxes to match (which also avoids
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
319 // a bug in WebKit: https://github.com/twbs/bootstrap/issues/1969).
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
320 .radio,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
321 .checkbox {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
322 display: inline-block;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
323 margin-top: 0;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
324 margin-bottom: 0;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
325 padding-left: 0;
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
326 }
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
327 .radio input[type="radio"],
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
328 .checkbox input[type="checkbox"] {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
329 float: none;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
330 margin-left: 0;
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
331 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
332 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
333 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
334
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
335
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
336 // Horizontal forms
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
337 //
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
338 // Horizontal forms are built on grid classes and allow you to create forms with
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
339 // labels on the left and inputs on the right.
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
340
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
341 .form-horizontal {
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
342
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
343 // Consistent vertical alignment of labels, radios, and checkboxes
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
344 .control-label,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
345 .radio,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
346 .checkbox,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
347 .radio-inline,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
348 .checkbox-inline {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
349 margin-top: 0;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
350 margin-bottom: 0;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
351 padding-top: (@padding-base-vertical + 1); // Default padding plus a border
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
352 }
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
353 // Account for padding we're adding to ensure the alignment and of help text
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
354 // and other content below items
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
355 .radio,
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
356 .checkbox {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
357 min-height: @line-height-computed + (@padding-base-vertical + 1);
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
358 }
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
359
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
360 // Make form groups behave like rows
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
361 .form-group {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
362 .make-row();
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
363 }
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
364
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
365 .form-control-static {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
366 padding-top: (@padding-base-vertical + 1);
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
367 }
149
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
368
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
369 // Only right align form labels here when the columns stop stacking
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
370 @media (min-width: @screen-sm-min) {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
371 .control-label {
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
372 text-align: right;
d29e2f337b00 Updated to Bootstrap 3.0.
Ludovic Chabant <ludovic@chabant.com>
parents: 88
diff changeset
373 }
61
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
374 }
130eccd396d8 Now using Boostrap with LESS.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
375 }