vendor/toolkit/twitter/bootstrap/mixins.less in twitter-bootstrap-rails-2.0.2 vs vendor/toolkit/twitter/bootstrap/mixins.less in twitter-bootstrap-rails-2.0.3

- old
+ new

@@ -7,11 +7,11 @@ // -------------------------------------------------- // Clearfix // -------- // For clearing floats like a boss h5bp.com/q -.clearfix() { +.clearfix { *zoom: 1; &:before, &:after { display: table; content: ""; @@ -23,11 +23,11 @@ // Webkit-style focus // ------------------ .tab-focus() { // Default - outline: thin dotted; + outline: thin dotted #333; // Webkit outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } @@ -87,12 +87,21 @@ ::-webkit-input-placeholder { color: @color; } } +// Text overflow +// ------------------------- +// Requires inline-block or block for proper styling +.text-overflow() { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + // FONTS // -------------------------------------------------- #font { #family { @@ -197,17 +206,17 @@ // ------------------------- #fluidGridSystem { // Setup the mixins to be used .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, @columns) { width: 1% * (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)); - } + } .gridColumn(@fluidGridGutterWidth) { float: left; margin-left: @fluidGridGutterWidth; } // Take these values and mixins, and make 'em do their thang - .generate(@gridColumns, @fluidGridColumnWidth, @fluidGridGutterWidth) { + .generate(@gridColumns, @fluidGridColumnWidth, @fluidGridGutterWidth) { // Row surrounds the columns .row-fluid { width: 100%; .clearfix(); @@ -217,28 +226,26 @@ } > [class*="span"]:first-child { margin-left: 0; } // Default columns - .span1 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 1); } - .span2 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 2); } - .span3 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 3); } - .span4 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 4); } - .span5 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 5); } - .span6 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 6); } - .span7 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 7); } - .span8 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 8); } - .span9 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 9); } - .span10 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 10); } - .span11 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 11); } - .span12 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 12); } + > .span1 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 1); } + > .span2 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 2); } + > .span3 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 3); } + > .span4 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 4); } + > .span5 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 5); } + > .span6 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 6); } + > .span7 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 7); } + > .span8 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 8); } + > .span9 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 9); } + > .span10 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 10); } + > .span11 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 11); } + > .span12 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 12); } } } } - - // Input grid system // ------------------------- #inputGridSystem { .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, @columns) { width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 10; @@ -261,12 +268,58 @@ &.span12 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 12); } } } } +// Make a Grid +// ------------------------- +// Use .makeRow and .makeColumn to assign semantic layouts grid system behavior +.makeRow() { + margin-left: @gridGutterWidth * -1; + .clearfix(); +} +.makeColumn(@columns: 1) { + float: left; + margin-left: @gridGutterWidth; + width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)); +} + +// Form field states (used in forms.less) +// -------------------------------------------------- + +// Mixin for form field states +.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) { + // Set the text color + > label, + .help-block, + .help-inline { + color: @textColor; + } + // Style inputs accordingly + input, + select, + textarea { + color: @textColor; + border-color: @borderColor; + &:focus { + border-color: darken(@borderColor, 10%); + .box-shadow(0 0 6px lighten(@borderColor, 20%)); + } + } + // Give a small background color for input-prepend/-append + .input-prepend .add-on, + .input-append .add-on { + color: @textColor; + background-color: @backgroundColor; + border-color: @textColor; + } +} + + + // CSS3 PROPERTIES // -------------------------------------------------- // Border Radius .border-radius(@radius: 5px) { @@ -312,23 +365,23 @@ -ms-transform: translate(@x, @y); -o-transform: translate(@x, @y); transform: translate(@x, @y); } .skew(@x: 0, @y: 0) { - -webkit-transform: translate(@x, @y); - -moz-transform: translate(@x, @y); - -ms-transform: translate(@x, @y); - -o-transform: translate(@x, @y); - transform: translate(@x, @y); -} -.skew(@x: 0, @y: 0) { -webkit-transform: skew(@x, @y); -moz-transform: skew(@x, @y); -ms-transform: skew(@x, @y); -o-transform: skew(@x, @y); transform: skew(@x, @y); } +.translate3d(@x: 0, @y: 0, @z: 0) { + -webkit-transform: translate(@x, @y, @z); + -moz-transform: translate(@x, @y, @z); + -ms-transform: translate(@x, @y, @z); + -o-transform: translate(@x, @y, @z); + transform: translate(@x, @y, @z); +} // Background clipping // Heads up: FF 3.6 and under need "padding" instead of "padding-box" .background-clip(@clip) { -webkit-background-clip: @clip; @@ -464,10 +517,10 @@ 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)); 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); 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); background-image: -ms-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); background-image: -o-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); - 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); + background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, rgba(255,255,255,0) 25%, rgba(255,255,255,0) 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, rgba(255,255,255,0) 75%, rgba(255,255,255,0)); } } // Reset filters for IE .reset-filter() { filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));