|
1 |
|
2 // |
|
3 // Load core variables and mixins |
|
4 // -------------------------------------------------- |
|
5 |
|
6 @import "variables.less"; |
|
7 @import "mixins.less"; |
|
8 |
|
9 |
|
10 // |
|
11 // Buttons |
|
12 // -------------------------------------------------- |
|
13 |
|
14 // Common styles |
|
15 .btn-default, |
|
16 .btn-primary, |
|
17 .btn-success, |
|
18 .btn-info, |
|
19 .btn-warning, |
|
20 .btn-danger { |
|
21 text-shadow: 0 -1px 0 rgba(0,0,0,.2); |
|
22 @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075); |
|
23 .box-shadow(@shadow); |
|
24 |
|
25 // Reset the shadow |
|
26 &:active, |
|
27 &.active { |
|
28 .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); |
|
29 } |
|
30 |
|
31 .badge { |
|
32 text-shadow: none; |
|
33 } |
|
34 } |
|
35 |
|
36 // Mixin for generating new styles |
|
37 .btn-styles(@btn-color: #555) { |
|
38 #gradient > .vertical(@start-color: @btn-color; @end-color: darken(@btn-color, 12%)); |
|
39 .reset-filter(); // Disable gradients for IE9 because filter bleeds through rounded corners |
|
40 background-repeat: repeat-x; |
|
41 border-color: darken(@btn-color, 14%); |
|
42 |
|
43 &:hover, |
|
44 &:focus { |
|
45 background-color: darken(@btn-color, 12%); |
|
46 background-position: 0 -15px; |
|
47 } |
|
48 |
|
49 &:active, |
|
50 &.active { |
|
51 background-color: darken(@btn-color, 12%); |
|
52 border-color: darken(@btn-color, 14%); |
|
53 } |
|
54 |
|
55 &:disabled, |
|
56 &[disabled] { |
|
57 background-color: darken(@btn-color, 12%); |
|
58 background-image: none; |
|
59 } |
|
60 } |
|
61 |
|
62 // Common styles |
|
63 .btn { |
|
64 // Remove the gradient for the pressed/active state |
|
65 &:active, |
|
66 &.active { |
|
67 background-image: none; |
|
68 } |
|
69 } |
|
70 |
|
71 // Apply the mixin to the buttons |
|
72 .btn-default { .btn-styles(@btn-default-bg); text-shadow: 0 1px 0 #fff; border-color: #ccc; } |
|
73 .btn-primary { .btn-styles(@btn-primary-bg); } |
|
74 .btn-success { .btn-styles(@btn-success-bg); } |
|
75 .btn-info { .btn-styles(@btn-info-bg); } |
|
76 .btn-warning { .btn-styles(@btn-warning-bg); } |
|
77 .btn-danger { .btn-styles(@btn-danger-bg); } |
|
78 |
|
79 |
|
80 // |
|
81 // Images |
|
82 // -------------------------------------------------- |
|
83 |
|
84 .thumbnail, |
|
85 .img-thumbnail { |
|
86 .box-shadow(0 1px 2px rgba(0,0,0,.075)); |
|
87 } |
|
88 |
|
89 |
|
90 // |
|
91 // Dropdowns |
|
92 // -------------------------------------------------- |
|
93 |
|
94 .dropdown-menu > li > a:hover, |
|
95 .dropdown-menu > li > a:focus { |
|
96 #gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%)); |
|
97 background-color: darken(@dropdown-link-hover-bg, 5%); |
|
98 } |
|
99 .dropdown-menu > .active > a, |
|
100 .dropdown-menu > .active > a:hover, |
|
101 .dropdown-menu > .active > a:focus { |
|
102 #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%)); |
|
103 background-color: darken(@dropdown-link-active-bg, 5%); |
|
104 } |
|
105 |
|
106 |
|
107 // |
|
108 // Navbar |
|
109 // -------------------------------------------------- |
|
110 |
|
111 // Default navbar |
|
112 .navbar-default { |
|
113 #gradient > .vertical(@start-color: lighten(@navbar-default-bg, 10%); @end-color: @navbar-default-bg); |
|
114 .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered |
|
115 border-radius: @navbar-border-radius; |
|
116 @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075); |
|
117 .box-shadow(@shadow); |
|
118 |
|
119 .navbar-nav > .open > a, |
|
120 .navbar-nav > .active > a { |
|
121 #gradient > .vertical(@start-color: darken(@navbar-default-link-active-bg, 5%); @end-color: darken(@navbar-default-link-active-bg, 2%)); |
|
122 .box-shadow(inset 0 3px 9px rgba(0,0,0,.075)); |
|
123 } |
|
124 } |
|
125 .navbar-brand, |
|
126 .navbar-nav > li > a { |
|
127 text-shadow: 0 1px 0 rgba(255,255,255,.25); |
|
128 } |
|
129 |
|
130 // Inverted navbar |
|
131 .navbar-inverse { |
|
132 #gradient > .vertical(@start-color: lighten(@navbar-inverse-bg, 10%); @end-color: @navbar-inverse-bg); |
|
133 .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered |
|
134 |
|
135 .navbar-nav > .open > a, |
|
136 .navbar-nav > .active > a { |
|
137 #gradient > .vertical(@start-color: @navbar-inverse-link-active-bg; @end-color: lighten(@navbar-inverse-link-active-bg, 2.5%)); |
|
138 .box-shadow(inset 0 3px 9px rgba(0,0,0,.25)); |
|
139 } |
|
140 |
|
141 .navbar-brand, |
|
142 .navbar-nav > li > a { |
|
143 text-shadow: 0 -1px 0 rgba(0,0,0,.25); |
|
144 } |
|
145 } |
|
146 |
|
147 // Undo rounded corners in static and fixed navbars |
|
148 .navbar-static-top, |
|
149 .navbar-fixed-top, |
|
150 .navbar-fixed-bottom { |
|
151 border-radius: 0; |
|
152 } |
|
153 |
|
154 // Fix active state of dropdown items in collapsed mode |
|
155 @media (max-width: @grid-float-breakpoint-max) { |
|
156 .navbar .navbar-nav .open .dropdown-menu > .active > a { |
|
157 &, |
|
158 &:hover, |
|
159 &:focus { |
|
160 color: #fff; |
|
161 #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%)); |
|
162 } |
|
163 } |
|
164 } |
|
165 |
|
166 |
|
167 // |
|
168 // Alerts |
|
169 // -------------------------------------------------- |
|
170 |
|
171 // Common styles |
|
172 .alert { |
|
173 text-shadow: 0 1px 0 rgba(255,255,255,.2); |
|
174 @shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05); |
|
175 .box-shadow(@shadow); |
|
176 } |
|
177 |
|
178 // Mixin for generating new styles |
|
179 .alert-styles(@color) { |
|
180 #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 7.5%)); |
|
181 border-color: darken(@color, 15%); |
|
182 } |
|
183 |
|
184 // Apply the mixin to the alerts |
|
185 .alert-success { .alert-styles(@alert-success-bg); } |
|
186 .alert-info { .alert-styles(@alert-info-bg); } |
|
187 .alert-warning { .alert-styles(@alert-warning-bg); } |
|
188 .alert-danger { .alert-styles(@alert-danger-bg); } |
|
189 |
|
190 |
|
191 // |
|
192 // Progress bars |
|
193 // -------------------------------------------------- |
|
194 |
|
195 // Give the progress background some depth |
|
196 .progress { |
|
197 #gradient > .vertical(@start-color: darken(@progress-bg, 4%); @end-color: @progress-bg) |
|
198 } |
|
199 |
|
200 // Mixin for generating new styles |
|
201 .progress-bar-styles(@color) { |
|
202 #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 10%)); |
|
203 } |
|
204 |
|
205 // Apply the mixin to the progress bars |
|
206 .progress-bar { .progress-bar-styles(@progress-bar-bg); } |
|
207 .progress-bar-success { .progress-bar-styles(@progress-bar-success-bg); } |
|
208 .progress-bar-info { .progress-bar-styles(@progress-bar-info-bg); } |
|
209 .progress-bar-warning { .progress-bar-styles(@progress-bar-warning-bg); } |
|
210 .progress-bar-danger { .progress-bar-styles(@progress-bar-danger-bg); } |
|
211 |
|
212 // Reset the striped class because our mixins don't do multiple gradients and |
|
213 // the above custom styles override the new `.progress-bar-striped` in v3.2.0. |
|
214 .progress-bar-striped { |
|
215 #gradient > .striped(); |
|
216 } |
|
217 |
|
218 |
|
219 // |
|
220 // List groups |
|
221 // -------------------------------------------------- |
|
222 |
|
223 .list-group { |
|
224 border-radius: @border-radius-base; |
|
225 .box-shadow(0 1px 2px rgba(0,0,0,.075)); |
|
226 } |
|
227 .list-group-item.active, |
|
228 .list-group-item.active:hover, |
|
229 .list-group-item.active:focus { |
|
230 text-shadow: 0 -1px 0 darken(@list-group-active-bg, 10%); |
|
231 #gradient > .vertical(@start-color: @list-group-active-bg; @end-color: darken(@list-group-active-bg, 7.5%)); |
|
232 border-color: darken(@list-group-active-border, 7.5%); |
|
233 |
|
234 .badge { |
|
235 text-shadow: none; |
|
236 } |
|
237 } |
|
238 |
|
239 |
|
240 // |
|
241 // Panels |
|
242 // -------------------------------------------------- |
|
243 |
|
244 // Common styles |
|
245 .panel { |
|
246 .box-shadow(0 1px 2px rgba(0,0,0,.05)); |
|
247 } |
|
248 |
|
249 // Mixin for generating new styles |
|
250 .panel-heading-styles(@color) { |
|
251 #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 5%)); |
|
252 } |
|
253 |
|
254 // Apply the mixin to the panel headings only |
|
255 .panel-default > .panel-heading { .panel-heading-styles(@panel-default-heading-bg); } |
|
256 .panel-primary > .panel-heading { .panel-heading-styles(@panel-primary-heading-bg); } |
|
257 .panel-success > .panel-heading { .panel-heading-styles(@panel-success-heading-bg); } |
|
258 .panel-info > .panel-heading { .panel-heading-styles(@panel-info-heading-bg); } |
|
259 .panel-warning > .panel-heading { .panel-heading-styles(@panel-warning-heading-bg); } |
|
260 .panel-danger > .panel-heading { .panel-heading-styles(@panel-danger-heading-bg); } |
|
261 |
|
262 |
|
263 // |
|
264 // Wells |
|
265 // -------------------------------------------------- |
|
266 |
|
267 .well { |
|
268 #gradient > .vertical(@start-color: darken(@well-bg, 5%); @end-color: @well-bg); |
|
269 border-color: darken(@well-bg, 10%); |
|
270 @shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1); |
|
271 .box-shadow(@shadow); |
|
272 } |