vendor/assets/stylesheets/twbs/bootstrap/mixins.less in twbs_less_rails-2.7.2 vs vendor/assets/stylesheets/twbs/bootstrap/mixins.less in twbs_less_rails-2.8.1
- old
+ new
@@ -113,10 +113,14 @@
border-bottom-left-radius: @radius;
border-top-left-radius: @radius;
}
// Drop shadows
+//
+// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's
+// supported browsers that have box shadow capabilities now support the
+// standard `box-shadow` property.
.box-shadow(@shadow) {
-webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
box-shadow: @shadow;
}
@@ -145,21 +149,21 @@
}
// Transformations
.rotate(@degrees) {
-webkit-transform: rotate(@degrees);
- -ms-transform: rotate(@degrees); // IE9+
+ -ms-transform: rotate(@degrees); // IE9 only
transform: rotate(@degrees);
}
-.scale(@ratio) {
- -webkit-transform: scale(@ratio);
- -ms-transform: scale(@ratio); // IE9+
- transform: scale(@ratio);
+.scale(@ratio; @ratio-y...) {
+ -webkit-transform: scale(@ratio, @ratio-y);
+ -ms-transform: scale(@ratio, @ratio-y); // IE9 only
+ transform: scale(@ratio, @ratio-y);
}
.translate(@x; @y) {
-webkit-transform: translate(@x, @y);
- -ms-transform: translate(@x, @y); // IE9+
+ -ms-transform: translate(@x, @y); // IE9 only
transform: translate(@x, @y);
}
.skew(@x; @y) {
-webkit-transform: skew(@x, @y);
-ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
@@ -170,16 +174,16 @@
transform: translate3d(@x, @y, @z);
}
.rotateX(@degrees) {
-webkit-transform: rotateX(@degrees);
- -ms-transform: rotateX(@degrees); // IE9+
+ -ms-transform: rotateX(@degrees); // IE9 only
transform: rotateX(@degrees);
}
.rotateY(@degrees) {
-webkit-transform: rotateY(@degrees);
- -ms-transform: rotateY(@degrees); // IE9+
+ -ms-transform: rotateY(@degrees); // IE9 only
transform: rotateY(@degrees);
}
.perspective(@perspective) {
-webkit-perspective: @perspective;
-moz-perspective: @perspective;
@@ -191,18 +195,43 @@
perspective-origin: @perspective;
}
.transform-origin(@origin) {
-webkit-transform-origin: @origin;
-moz-transform-origin: @origin;
+ -ms-transform-origin: @origin; // IE9 only
transform-origin: @origin;
}
// Animations
.animation(@animation) {
-webkit-animation: @animation;
animation: @animation;
}
+.animation-name(@name) {
+ -webkit-animation-name: @name;
+ animation-name: @name;
+}
+.animation-duration(@duration) {
+ -webkit-animation-duration: @duration;
+ animation-duration: @duration;
+}
+.animation-timing-function(@timing-function) {
+ -webkit-animation-timing-function: @timing-function;
+ animation-timing-function: @timing-function;
+}
+.animation-delay(@delay) {
+ -webkit-animation-delay: @delay;
+ animation-delay: @delay;
+}
+.animation-iteration-count(@iteration-count) {
+ -webkit-animation-iteration-count: @iteration-count;
+ animation-iteration-count: @iteration-count;
+}
+.animation-direction(@direction) {
+ -webkit-animation-direction: @direction;
+ animation-direction: @direction;
+}
// Backface visibility
// Prevent browsers from flickering when using CSS 3D transforms.
// Default value is `visible`, but can be changed to `hidden`
.backface-visibility(@visibility){
@@ -351,11 +380,11 @@
// Responsive image
//
// Keep images from scaling beyond the width of their parents.
-.img-responsive(@display: block;) {
+.img-responsive(@display: block) {
display: @display;
max-width: 100%; // Part 1: Set a maximum relative to the parent
height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
}
@@ -412,33 +441,61 @@
// Tables
// -------------------------
.table-row-variant(@state; @background) {
// Exact selectors below required to override `.table-striped` and prevent
// inheritance to nested tables.
- .table {
- > thead,
- > tbody,
- > tfoot {
- > tr > .@{state},
- > .@{state} > td,
- > .@{state} > th {
- background-color: @background;
- }
+ .table > thead > tr,
+ .table > tbody > tr,
+ .table > tfoot > tr {
+ > td.@{state},
+ > th.@{state},
+ &.@{state} > td,
+ &.@{state} > th {
+ background-color: @background;
}
}
// Hover states for `.table-hover`
// Note: this is not available for cells or rows within `thead` or `tfoot`.
- .table-hover > tbody {
- > tr > .@{state}:hover,
- > .@{state}:hover > td,
- > .@{state}:hover > th {
+ .table-hover > tbody > tr {
+ > td.@{state}:hover,
+ > th.@{state}:hover,
+ &.@{state}:hover > td,
+ &.@{state}:hover > th {
background-color: darken(@background, 5%);
}
}
}
+// List Groups
+// -------------------------
+.list-group-item-variant(@state; @background; @color) {
+ .list-group-item-@{state} {
+ color: @color;
+ background-color: @background;
+
+ a& {
+ color: @color;
+
+ .list-group-item-heading { color: inherit; }
+
+ &:hover,
+ &:focus {
+ color: @color;
+ background-color: darken(@background, 5%);
+ }
+ &.active,
+ &.active:hover,
+ &.active:focus {
+ color: #fff;
+ background-color: @color;
+ border-color: @color;
+ }
+ }
+ }
+}
+
// Button variants
// -------------------------
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons
.button-variant(@color; @background; @border) {
@@ -473,11 +530,11 @@
}
}
.badge {
color: @background;
- background-color: #fff;
+ background-color: @color;
}
}
// Button sizes
// -------------------------
@@ -522,10 +579,28 @@
background-color: darken(@color, 10%);
}
}
}
+// Contextual backgrounds
+// -------------------------
+.bg-variant(@color) {
+ background-color: @color;
+ a&:hover {
+ background-color: darken(@color, 10%);
+ }
+}
+
+// Typography
+// -------------------------
+.text-emphasis-variant(@color) {
+ color: @color;
+ a&:hover {
+ color: darken(@color, 10%);
+ }
+}
+
// Navbar vertical align
// -------------------------
// Vertically center elements in the navbar.
// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
.navbar-vertical-align(@element-height) {
@@ -568,49 +643,58 @@
.container-fixed() {
margin-right: auto;
margin-left: auto;
padding-left: (@grid-gutter-width / 2);
padding-right: (@grid-gutter-width / 2);
- .clearfix();
+ &:extend(.clearfix all);
}
// Creates a wrapper for a series of columns
.make-row(@gutter: @grid-gutter-width) {
margin-left: (@gutter / -2);
margin-right: (@gutter / -2);
- .clearfix();
+ &:extend(.clearfix all);
}
// Generate the extra small columns
.make-xs-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
float: left;
width: percentage((@columns / @grid-columns));
- // Prevent columns from collapsing when empty
min-height: 1px;
- // Inner gutter via padding
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
}
+.make-xs-column-offset(@columns) {
+ @media (min-width: @screen-xs-min) {
+ margin-left: percentage((@columns / @grid-columns));
+ }
+}
+.make-xs-column-push(@columns) {
+ @media (min-width: @screen-xs-min) {
+ left: percentage((@columns / @grid-columns));
+ }
+}
+.make-xs-column-pull(@columns) {
+ @media (min-width: @screen-xs-min) {
+ right: percentage((@columns / @grid-columns));
+ }
+}
+
// Generate the small columns
.make-sm-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
- // Prevent columns from collapsing when empty
min-height: 1px;
- // Inner gutter via padding
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
- // Calculate width based on number of columns available
@media (min-width: @screen-sm-min) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
-
-// Generate the small column offsets
.make-sm-column-offset(@columns) {
@media (min-width: @screen-sm-min) {
margin-left: percentage((@columns / @grid-columns));
}
}
@@ -623,60 +707,52 @@
@media (min-width: @screen-sm-min) {
right: percentage((@columns / @grid-columns));
}
}
+
// Generate the medium columns
.make-md-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
- // Prevent columns from collapsing when empty
min-height: 1px;
- // Inner gutter via padding
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
- // Calculate width based on number of columns available
@media (min-width: @screen-md-min) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
-
-// Generate the medium column offsets
.make-md-column-offset(@columns) {
@media (min-width: @screen-md-min) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-md-column-push(@columns) {
- @media (min-width: @screen-md) {
+ @media (min-width: @screen-md-min) {
left: percentage((@columns / @grid-columns));
}
}
.make-md-column-pull(@columns) {
@media (min-width: @screen-md-min) {
right: percentage((@columns / @grid-columns));
}
}
+
// Generate the large columns
.make-lg-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
- // Prevent columns from collapsing when empty
min-height: 1px;
- // Inner gutter via padding
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
- // Calculate width based on number of columns available
@media (min-width: @screen-lg-min) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
-
-// Generate the large column offsets
.make-lg-column-offset(@columns) {
@media (min-width: @screen-lg-min) {
margin-left: percentage((@columns / @grid-columns));
}
}
@@ -699,15 +775,15 @@
.make-grid-columns() {
// Common styles for all sizes of grid columns, widths 1-12
.col(@index) when (@index = 1) { // initial
@item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
- .col(@index + 1, @item);
+ .col((@index + 1), @item);
}
.col(@index, @list) when (@index =< @grid-columns) { // general; "=<" isn't a typo
@item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
- .col(@index + 1, ~"@{list}, @{item}");
+ .col((@index + 1), ~"@{list}, @{item}");
}
.col(@index, @list) when (@index > @grid-columns) { // terminal
@{list} {
position: relative;
// Prevent columns from collapsing when empty
@@ -721,15 +797,15 @@
}
.make-grid-columns-float(@class) {
.col(@index) when (@index = 1) { // initial
@item: ~".col-@{class}-@{index}";
- .col(@index + 1, @item);
+ .col((@index + 1), @item);
}
.col(@index, @list) when (@index =< @grid-columns) { // general
@item: ~".col-@{class}-@{index}";
- .col(@index + 1, ~"@{list}, @{item}");
+ .col((@index + 1), ~"@{list}, @{item}");
}
.col(@index, @list) when (@index > @grid-columns) { // terminal
@{list} {
float: left;
}
@@ -760,11 +836,11 @@
// Basic looping in LESS
.make-grid(@index, @class, @type) when (@index >= 0) {
.calc-grid(@index, @class, @type);
// next iteration
- .make-grid(@index - 1, @class, @type);
+ .make-grid((@index - 1), @class, @type);
}
// Form validation states
//
@@ -795,10 +871,14 @@
.input-group-addon {
color: @text-color;
border-color: @border-color;
background-color: @background-color;
}
+ // Optional feedback icon
+ .form-control-feedback {
+ color: @text-color;
+ }
}
// Form control focus state
//
// Generate a customized focus state and for any input with the specified color,
@@ -837,9 +917,10 @@
select& {
height: @input-height;
line-height: @input-height;
}
- textarea& {
+ textarea&,
+ select[multiple]& {
height: auto;
}
}