3 // --------------------------------------------------
7 // -------------------------
10 // Source: http://nicolasgallagher.com/micro-clearfix-hack/
12 // For modern browsers
13 // 1. The space content is one way to avoid an Opera bug when the
14 // contenteditable attribute is included anywhere else in the document.
15 // Otherwise it causes space to appear at the top and bottom of elements
16 // that are clearfixed.
17 // 2. The use of `table` rather than `block` is only necessary if using
18 // `:before` to contain the top-margins of child elements.
23 display: table; /* 2 */
33 outline: thin dotted #333;
35 outline: 5px auto -webkit-focus-ring-color;
39 // Center-align a block level element
47 .size(@width, @height) {
56 .placeholder(@color: @input-color-placeholder) {
57 &:-moz-placeholder { color: @color; } // Firefox 4-18
58 &::-moz-placeholder { color: @color; } // Firefox 19+
59 &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+
60 &::-webkit-input-placeholder { color: @color; } // Safari and Chrome
64 // Requires inline-block or block for proper styling
67 text-overflow: ellipsis;
71 // CSS image replacement
72 // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
77 background-color: transparent;
84 // --------------------------------------------------
86 // Single side border-radius
87 .border-top-radius(@radius) {
88 border-top-right-radius: @radius;
89 border-top-left-radius: @radius;
91 .border-right-radius(@radius) {
92 border-bottom-right-radius: @radius;
93 border-top-right-radius: @radius;
95 .border-bottom-radius(@radius) {
96 border-bottom-right-radius: @radius;
97 border-bottom-left-radius: @radius;
99 .border-left-radius(@radius) {
100 border-bottom-left-radius: @radius;
101 border-top-left-radius: @radius;
105 .box-shadow(@shadow) {
106 -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
111 .transition(@transition) {
112 -webkit-transition: @transition;
113 transition: @transition;
115 .transition-delay(@transition-delay) {
116 -webkit-transition-delay: @transition-delay;
117 transition-delay: @transition-delay;
119 .transition-duration(@transition-duration) {
120 -webkit-transition-duration: @transition-duration;
121 transition-duration: @transition-duration;
123 .transition-transform(@transition) {
124 -webkit-transition: -webkit-transform @transition;
125 -moz-transition: -moz-transform @transition;
126 -o-transition: -o-transform @transition;
127 transition: transform @transition;
132 -webkit-transform: rotate(@degrees);
133 -ms-transform: rotate(@degrees);
134 transform: rotate(@degrees);
137 -webkit-transform: scale(@ratio);
138 -ms-transform: scale(@ratio);
139 transform: scale(@ratio);
142 -webkit-transform: translate(@x, @y);
143 -ms-transform: translate(@x, @y);
144 transform: translate(@x, @y);
147 -webkit-transform: skew(@x, @y);
148 -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885
149 transform: skew(@x, @y);
151 .translate3d(@x, @y, @z) {
152 -webkit-transform: translate3d(@x, @y, @z);
153 transform: translate3d(@x, @y, @z);
156 // Backface visibility
157 // Prevent browsers from flickering when using CSS 3D transforms.
158 // Default value is `visible`, but can be changed to `hidden`
159 // See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
160 .backface-visibility(@visibility){
161 -webkit-backface-visibility: @visibility;
162 -moz-backface-visibility: @visibility;
163 backface-visibility: @visibility;
166 // Background clipping
167 .background-clip(@clip) {
168 background-clip: @clip;
172 .background-size(@size) {
173 background-size: @size;
177 .box-sizing(@boxmodel) {
178 -webkit-box-sizing: @boxmodel;
179 -moz-box-sizing: @boxmodel;
180 box-sizing: @boxmodel;
184 // For selecting text on the page
185 .user-select(@select) {
186 -webkit-user-select: @select;
187 -moz-user-select: @select;
188 -ms-user-select: @select;
189 -o-user-select: @select;
190 user-select: @select;
194 .resizable(@direction) {
195 resize: @direction; // Options: horizontal, vertical, both
196 overflow: auto; // Safari fix
199 // CSS3 Content Columns
200 .content-columns(@column-count, @column-gap: @grid-gutter-width) {
201 -webkit-column-count: @column-count;
202 -moz-column-count: @column-count;
203 column-count: @column-count;
204 -webkit-column-gap: @column-gap;
205 -moz-column-gap: @column-gap;
206 column-gap: @column-gap;
209 // Optional hyphenation
210 .hyphens(@mode: auto) {
211 word-wrap: break-word;
212 -webkit-hyphens: @mode;
223 @opacity-ie: (@opacity * 100);
224 filter: ~"alpha(opacity=@{opacity-ie})";
230 // --------------------------------------------------
234 // Horizontal gradient, from left to right
236 // Creates two color stops, start and end, by specifying a color and position for each color stop.
237 // Color stops are not available in IE9 and below.
238 .horizontal(@start-color: #555; @start-percent: 0%; @end-color: #333; @end-percent: 100%) {
239 background-color: @end-color;
240 background-image: -webkit-gradient(linear, @start-percent top, @end-percent top, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+
241 background-image: -webkit-linear-gradient(left, color-stop(@start-color @start-percent), color-stop(@end-color @end-percent)); // Safari 5.1+, Chrome 10+
242 background-image: -moz-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // FF 3.6+
243 background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10
244 background-repeat: repeat-x;
245 filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down
248 // Vertical gradient, from top to bottom
250 // Creates two color stops, start and end, by specifying a color and position for each color stop.
251 // Color stops are not available in IE9 and below.
252 .vertical(@start-color: #555; @start-percent: 0%; @end-color: #333; @end-percent: 100%) {
253 background-color: @end-color;
254 background-image: -webkit-gradient(linear, left @start-percent, left @end-percent, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+
255 background-image: -webkit-linear-gradient(top, @start-color, @start-percent, @end-color, @end-percent); // Safari 5.1+, Chrome 10+
256 background-image: -moz-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // FF 3.6+
257 background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10
258 background-repeat: repeat-x;
259 filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down
262 .directional(@start-color: #555, @end-color: #333, @deg: 45deg) {
263 background-color: @end-color;
264 background-repeat: repeat-x;
265 background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1+, Chrome 10+
266 background-image: -moz-linear-gradient(@deg, @start-color, @end-color); // FF 3.6+
267 background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10
269 .horizontal-three-colors(@start-color: #00b3ee, @mid-color: #7a43b6, @color-stop: 50%, @end-color: #c3325f) {
270 background-color: mix(@mid-color, @end-color, 80%);
271 background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color));
272 background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
273 background-image: -moz-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
274 background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);
275 background-repeat: no-repeat;
276 filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
279 .vertical-three-colors(@start-color: #00b3ee, @mid-color: #7a43b6, @color-stop: 50%, @end-color: #c3325f) {
280 background-color: mix(@mid-color, @end-color, 80%);
281 background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color));
282 background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);
283 background-image: -moz-linear-gradient(top, @start-color, @mid-color @color-stop, @end-color);
284 background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);
285 background-repeat: no-repeat;
286 filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
288 .radial(@inner-color: #555, @outer-color: #333) {
289 background-color: @outer-color;
290 background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@inner-color), to(@outer-color));
291 background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);
292 background-image: -moz-radial-gradient(circle, @inner-color, @outer-color);
293 background-image: radial-gradient(circle, @inner-color, @outer-color);
294 background-repeat: no-repeat;
296 .striped(@color: #555, @angle: 45deg) {
297 background-color: @color;
298 background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
299 background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
300 background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
301 background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
305 // Reset filters for IE
307 // When you need to remove a gradient background, don't forget to use this to reset
308 // the IE filter for IE9 and below.
310 filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
315 // RETINA IMAGE SUPPORT
316 // --------------------------------------------------
318 // Short retina mixin for setting background-image and -size
319 .img-retina(@file-1x, @file-2x, @width-1x, @height-1x) {
320 background-image: url("@{file-1x}");
323 only screen and (-webkit-min-device-pixel-ratio: 2),
324 only screen and ( min--moz-device-pixel-ratio: 2),
325 only screen and ( -o-min-device-pixel-ratio: 2/1),
326 only screen and ( min-device-pixel-ratio: 2),
327 only screen and ( min-resolution: 192dpi),
328 only screen and ( min-resolution: 2dppx) {
329 background-image: url("@{file-2x}");
330 background-size: @width-1x @height-1x;
336 // --------------------------------------------------
338 // Horizontal dividers
339 // -------------------------
340 // Dividers (basically an hr) within dropdowns and nav lists
341 .nav-divider(@color: #e5e5e5) {
343 margin: ((@line-height-computed / 2) - 1) 0;
345 background-color: @color;
349 // -------------------------
350 .alert-variant(@background, @border, @text-color) {
351 background-color: @background;
352 border-color: @border;
355 border-top-color: darken(@border, 5%);
358 color: darken(@text-color, 10%);
362 // Button pseudo states
363 // -------------------------
364 // Easily pump out default styles, as well as :hover, :focus, :active,
365 // and disabled options for all buttons
366 .btn-pseudo-states(@color, @background, @border) {
368 background-color: @background;
369 border-color: @border;
375 background-color: darken(@background, 5%);
376 border-color: darken(@border, 10%);
381 fieldset[disabled] & {
387 background-color: @background;
388 border-color: @border
394 // -------------------------
395 .label-variant(@color) {
396 background-color: @color;
400 background-color: darken(@color, 10%);
405 // Navbar vertical align
406 // -------------------------
407 // Vertically center elements in the navbar.
408 // Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
409 .navbar-vertical-align(@element-height) {
410 margin-top: ((@navbar-height - @element-height) / 2);
411 margin-bottom: ((@navbar-height - @element-height) / 2);
415 // -------------------------
416 .progress-bar-variant(@color) {
417 background-color: @color;
418 .progress-striped & {
419 #gradient > .striped(@color);
423 // Responsive utilities
424 // -------------------------
425 // More easily include all the states for responsive-utilities.less.
426 .responsive-visibility() {
427 display: block !important;
428 tr& { display: table-row !important; }
430 td& { display: table-cell !important; }
433 .responsive-invisibility() {
434 display: none !important;
435 tr& { display: none !important; }
437 td& { display: none !important; }
443 // Centered container element
450 // Creates a wrapper for a series of columns
452 // Then clear the floated columns
455 @media (min-width: @screen-small) {
456 margin-left: (@grid-gutter-width / -2);
457 margin-right: (@grid-gutter-width / -2);
460 // Negative margin nested rows out to align the content of columns
462 margin-left: (@grid-gutter-width / -2);
463 margin-right: (@grid-gutter-width / -2);
467 // Generate the columns
468 .make-column(@columns) {
470 // Prevent columns from collapsing when empty
472 // Inner gutter via padding
473 padding-left: (@grid-gutter-width / 2);
474 padding-right: (@grid-gutter-width / 2);
476 // Calculate width based on number of columns available
477 @media (min-width: @grid-float-breakpoint) {
479 width: percentage((@columns / @grid-columns));
483 // Generate the column offsets
484 .make-column-offset(@columns) {
485 @media (min-width: @grid-float-breakpoint) {
486 margin-left: percentage((@columns / @grid-columns));
489 .make-column-push(@columns) {
490 @media (min-width: @grid-float-breakpoint) {
491 left: percentage((@columns / @grid-columns));
494 .make-column-pull(@columns) {
495 @media (min-width: @grid-float-breakpoint) {
496 right: percentage((@columns / @grid-columns));
500 // Generate the small columns
501 .make-small-column(@columns) {
504 // Prevent columns from collapsing when empty
506 // Inner gutter via padding
507 padding-left: (@grid-gutter-width / 2);
508 padding-right: (@grid-gutter-width / 2);
509 @max-width: (@grid-float-breakpoint - 1);
511 // Calculate width based on number of columns available
512 @media (max-width: @max-width) {
513 width: percentage((@columns / @grid-columns));
518 // Form validation states
520 // Used in forms.less to generate the form validation CSS for warnings, errors,
523 .form-control-validation(@text-color: #555, @border-color: #ccc, @background-color: #f5f5f5) {
524 // Color the label and help text
529 // Set the border and box shadow on specific inputs to match
531 padding-right: 32px; // to account for the feedback icon
532 border-color: @border-color;
533 .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
535 border-color: darken(@border-color, 10%);
536 @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);
537 .box-shadow(@shadow);
540 // Set validation states also for addons
543 border-color: @border-color;
544 background-color: @background-color;