diff options
| author | Mark Otto <[email protected]> | 2013-12-15 11:16:57 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2013-12-15 11:16:57 -0800 |
| commit | fd62247bf8bbb1bce072f5ee03e996dfc4abed94 (patch) | |
| tree | 487766325e03d40c7af16c58873b70d8638a72ba /less | |
| parent | fbf31f965e27a6665c7e0f2d97eb74c0df7585d4 (diff) | |
| parent | 2b86e05a6150ef13905519070ea82ce895fbae85 (diff) | |
| download | bootstrap-fd62247bf8bbb1bce072f5ee03e996dfc4abed94.tar.xz bootstrap-fd62247bf8bbb1bce072f5ee03e996dfc4abed94.zip | |
Merge branch 'master' into cover_template
Diffstat (limited to 'less')
| -rw-r--r-- | less/button-groups.less | 13 | ||||
| -rw-r--r-- | less/dropdowns.less | 28 | ||||
| -rw-r--r-- | less/grid.less | 4 | ||||
| -rw-r--r-- | less/input-groups.less | 37 | ||||
| -rw-r--r-- | less/jumbotron.less | 8 | ||||
| -rw-r--r-- | less/list-group.less | 2 | ||||
| -rw-r--r-- | less/mixins.less | 72 | ||||
| -rw-r--r-- | less/modals.less | 18 | ||||
| -rw-r--r-- | less/navbar.less | 14 | ||||
| -rw-r--r-- | less/panels.less | 2 | ||||
| -rw-r--r-- | less/responsive-utilities.less | 129 | ||||
| -rw-r--r-- | less/tooltip.less | 2 | ||||
| -rw-r--r-- | less/type.less | 49 | ||||
| -rw-r--r-- | less/variables.less | 33 | ||||
| -rw-r--r-- | less/wells.less | 2 |
15 files changed, 206 insertions, 207 deletions
diff --git a/less/button-groups.less b/less/button-groups.less index ef9c34e77..794839d62 100644 --- a/less/button-groups.less +++ b/less/button-groups.less @@ -37,18 +37,17 @@ // Optional: Group multiple button groups together for a toolbar .btn-toolbar { + margin-left: -5px; // Offset the first child's margin &:extend(.clearfix all); - .btn-group { + .btn-group, + .input-group { float: left; } - // Space out series of button groups > .btn, - > .btn-group { - + .btn, - + .btn-group { - margin-left: 5px; - } + > .btn-group, + > .input-group { + margin-left: 5px; } } diff --git a/less/dropdowns.less b/less/dropdowns.less index 4bdc223fc..dde2038e3 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -46,6 +46,8 @@ background-clip: padding-box; // Aligns the dropdown menu to right + // + // Deprecated as of 3.1 in favor of `.dropdown-menu-[dir]` &.pull-right { right: 0; left: auto; @@ -126,6 +128,25 @@ } } +// Menu positioning +// +// Add extra class to `.dropdown-menu` to flip the alignment of the dropdown +// menu with the parent. +.dropdown-menu-right { + left: auto; // Reset the default from `.dropdown-menu` + right: 0; +} +// With v3, we enabled auto-flipping if you have a dropdown within a right +// aligned nav component. To enable the undoing of that, we provide an override +// to restore the default dropdown menu alignment. +// +// This is only for left-aligning a dropdown menu within a `.navbar-right` or +// `.pull-right` nav component. +.dropdown-menu-left { + left: 0; + right: auto; +} + // Dropdown section headers .dropdown-header { display: block; @@ -180,7 +201,12 @@ @media (min-width: @grid-float-breakpoint) { .navbar-right { .dropdown-menu { - .pull-right > .dropdown-menu(); + .dropdown-menu-right(); + } + // Necessary for overrides of the default right aligned menu. + // Will remove come v4 in all likelihood. + .dropdown-menu-left { + .dropdown-menu-left(); } } } diff --git a/less/grid.less b/less/grid.less index dfae6999b..88957f42a 100644 --- a/less/grid.less +++ b/less/grid.less @@ -10,10 +10,10 @@ .container { .container-fixed(); - @media (min-width: @screen-sm) { + @media (min-width: @screen-sm-min) { width: @container-sm; } - @media (min-width: @screen-md) { + @media (min-width: @screen-md-min) { width: @container-md; } @media (min-width: @screen-lg-min) { diff --git a/less/input-groups.less b/less/input-groups.less index d19c4c64a..39f705ad3 100644 --- a/less/input-groups.less +++ b/less/input-groups.less @@ -17,6 +17,11 @@ } .form-control { + // IE9 fubars the placeholder attribute in text inputs and the arrows on + // select elements in input groups. To fix it, we float the input. Details: + // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855 + float: left; + width: 100%; margin-bottom: 0; } @@ -121,16 +126,26 @@ &:last-child > .btn { margin-left: -1px; } -} -.input-group-btn > .btn { - position: relative; - // Jankily prevent input button groups from wrapping - + .btn { - margin-left: -4px; - } - // Bring the "active" button to the front - &:hover, - &:active { - z-index: 2; + + > .btn { + position: relative; + + &:not(:first-of-type):not(:last-of-type) { + border-radius: 0; + } + + // Jankily prevent input button groups from wrapping + + .btn { + margin-left: -4px; + } + + .btn:last-of-type { + margin-left: -5px; + } + + // Bring the "active" button to the front + &:hover, + &:active { + z-index: 2; + } } } diff --git a/less/jumbotron.less b/less/jumbotron.less index 0460b69d4..a15e16971 100644 --- a/less/jumbotron.less +++ b/less/jumbotron.less @@ -6,19 +6,17 @@ .jumbotron { padding: @jumbotron-padding; margin-bottom: @jumbotron-padding; - font-size: @jumbotron-font-size; - font-weight: 200; - line-height: (@line-height-base * 1.5); color: @jumbotron-color; background-color: @jumbotron-bg; h1, .h1 { - line-height: 1; color: @jumbotron-heading-color; } p { - line-height: 1.4; + margin-bottom: (@jumbotron-padding / 2); + font-size: @jumbotron-font-size; + font-weight: 200; } .container & { diff --git a/less/list-group.less b/less/list-group.less index 35fff05d4..ed3bfa5a5 100644 --- a/less/list-group.less +++ b/less/list-group.less @@ -79,7 +79,7 @@ a.list-group-item { color: inherit; } .list-group-item-text { - color: lighten(@list-group-active-bg, 40%); + color: @list-group-active-text-color; } } } diff --git a/less/mixins.less b/less/mixins.less index b5beaddf2..66026f52a 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -147,17 +147,17 @@ // Transformations .rotate(@degrees) { -webkit-transform: rotate(@degrees); - -ms-transform: rotate(@degrees); // IE9+ + -ms-transform: rotate(@degrees); // IE9 only transform: rotate(@degrees); } .scale(@ratio; @ratio-y...) { -webkit-transform: scale(@ratio, @ratio-y); - -ms-transform: scale(@ratio, @ratio-y); // IE9+ + -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) { @@ -172,12 +172,12 @@ .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) { @@ -193,6 +193,7 @@ .transform-origin(@origin) { -webkit-transform-origin: @origin; -moz-transform-origin: @origin; + -ms-transform-origin: @origin; // IE9 only transform-origin: @origin; } @@ -201,6 +202,30 @@ -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. @@ -353,7 +378,7 @@ // // 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 @@ -613,30 +638,39 @@ 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)); @@ -653,23 +687,19 @@ } } + // 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)); @@ -686,23 +716,19 @@ } } + // 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)); diff --git a/less/modals.less b/less/modals.less index 292b5bd9c..ec1bf55dc 100644 --- a/less/modals.less +++ b/less/modals.less @@ -22,7 +22,11 @@ right: 0; bottom: 0; left: 0; - z-index: @zindex-modal-background; + z-index: @zindex-modal; + + // Prevent Chrome on Windows from adding a focus outline. For details, see + // https://github.com/twbs/bootstrap/pull/10951. + outline: 0; // When fading in the modal, animate it to slide down &.fade .modal-dialog { @@ -37,7 +41,6 @@ position: relative; width: auto; margin: 10px; - z-index: (@zindex-modal-background + 10); } // Actual modal @@ -60,11 +63,11 @@ right: 0; bottom: 0; left: 0; - z-index: (@zindex-modal-background - 10); + z-index: @zindex-modal-background; background-color: @modal-backdrop-bg; // Fade for backdrop &.fade { .opacity(0); } - &.in { .opacity(.5); } + &.in { .opacity(@modal-backdrop-opacity); } } // Modal header @@ -116,8 +119,9 @@ } // Scale up the modal -@media screen and (min-width: @screen-sm-min) { +@media (min-width: @screen-sm-min) { + // Automatically set modal's width for larger viewports .modal-dialog { width: 600px; margin: 30px auto; @@ -126,4 +130,8 @@ .box-shadow(0 5px 15px rgba(0,0,0,.5)); } + // Modal sizes + .modal-sm { width: @modal-sm; } + .modal-lg { width: @modal-lg; } + } diff --git a/less/navbar.less b/less/navbar.less index 51e3df258..d96f85e30 100644 --- a/less/navbar.less +++ b/less/navbar.less @@ -161,6 +161,13 @@ text-decoration: none; } + // Prevent Glyphicons from increasing height of navbar + > .glyphicon { + float: left; + margin-top: -2px; + margin-right: 5px; + } + @media (min-width: @grid-float-breakpoint) { .navbar > .container &, .navbar > .container-fluid & { @@ -329,13 +336,6 @@ .border-bottom-radius(0); } -// Right aligned menus need alt position -.navbar-nav.pull-right > li > .dropdown-menu, -.navbar-nav > li > .dropdown-menu.pull-right { - left: auto; - right: 0; -} - // Buttons in navbars // diff --git a/less/panels.less b/less/panels.less index a6b723c68..ad133ad21 100644 --- a/less/panels.less +++ b/less/panels.less @@ -14,7 +14,7 @@ // Panel contents .panel-body { - padding: 15px; + padding: @panel-body-padding; &:extend(.clearfix all); } diff --git a/less/responsive-utilities.less b/less/responsive-utilities.less index 5823c8fca..5a31816af 100644 --- a/less/responsive-utilities.less +++ b/less/responsive-utilities.less @@ -23,172 +23,51 @@ // Visibility utilities - .visible-xs { .responsive-invisibility(); + @media (max-width: @screen-xs-max) { .responsive-visibility(); } - &.visible-sm { - @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { - .responsive-visibility(); - } - } - &.visible-md { - @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { - .responsive-visibility(); - } - } - &.visible-lg { - @media (min-width: @screen-lg-min) { - .responsive-visibility(); - } - } } .visible-sm { .responsive-invisibility(); - &.visible-xs { - @media (max-width: @screen-xs-max) { - .responsive-visibility(); - } - } + @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { .responsive-visibility(); } - &.visible-md { - @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { - .responsive-visibility(); - } - } - &.visible-lg { - @media (min-width: @screen-lg-min) { - .responsive-visibility(); - } - } } .visible-md { .responsive-invisibility(); - &.visible-xs { - @media (max-width: @screen-xs-max) { - .responsive-visibility(); - } - } - &.visible-sm { - @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { - .responsive-visibility(); - } - } + @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { .responsive-visibility(); } - &.visible-lg { - @media (min-width: @screen-lg-min) { - .responsive-visibility(); - } - } } .visible-lg { .responsive-invisibility(); - &.visible-xs { - @media (max-width: @screen-xs-max) { - .responsive-visibility(); - } - } - &.visible-sm { - @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { - .responsive-visibility(); - } - } - &.visible-md { - @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { - .responsive-visibility(); - } - } + @media (min-width: @screen-lg-min) { .responsive-visibility(); } } .hidden-xs { - .responsive-visibility(); @media (max-width: @screen-xs-max) { .responsive-invisibility(); } - &.hidden-sm { - @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { - .responsive-invisibility(); - } - } - &.hidden-md { - @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { - .responsive-invisibility(); - } - } - &.hidden-lg { - @media (min-width: @screen-lg-min) { - .responsive-invisibility(); - } - } } .hidden-sm { - .responsive-visibility(); - &.hidden-xs { - @media (max-width: @screen-xs-max) { - .responsive-invisibility(); - } - } @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { .responsive-invisibility(); } - &.hidden-md { - @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { - .responsive-invisibility(); - } - } - &.hidden-lg { - @media (min-width: @screen-lg-min) { - .responsive-invisibility(); - } - } } .hidden-md { - .responsive-visibility(); - &.hidden-xs { - @media (max-width: @screen-xs-max) { - .responsive-invisibility(); - } - } - &.hidden-sm { - @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { - .responsive-invisibility(); - } - } @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { .responsive-invisibility(); } - &.hidden-lg { - @media (min-width: @screen-lg-min) { - .responsive-invisibility(); - } - } } .hidden-lg { - .responsive-visibility(); - &.hidden-xs { - @media (max-width: @screen-xs-max) { - .responsive-invisibility(); - } - } - &.hidden-sm { - @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { - .responsive-invisibility(); - } - } - &.hidden-md { - @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { - .responsive-invisibility(); - } - } @media (min-width: @screen-lg-min) { .responsive-invisibility(); } diff --git a/less/tooltip.less b/less/tooltip.less index ce793cb93..bd626996f 100644 --- a/less/tooltip.less +++ b/less/tooltip.less @@ -13,7 +13,7 @@ line-height: 1.4; .opacity(0); - &.in { .opacity(.9); } + &.in { .opacity(@tooltip-opacity); } &.top { margin-top: -3px; padding: @tooltip-arrow-width 0; } &.right { margin-left: 3px; padding: 0 @tooltip-arrow-width; } &.bottom { margin-top: 3px; padding: @tooltip-arrow-width 0; } diff --git a/less/type.less b/less/type.less index 24a581fe8..52f9b5b2b 100644 --- a/less/type.less +++ b/less/type.less @@ -81,7 +81,13 @@ small, // Undo browser default styling cite { font-style: normal; } -// Contextual emphasis +// Alignment +.text-left { text-align: left; } +.text-right { text-align: right; } +.text-center { text-align: center; } +.text-justify { text-align: justify; } + +// Contextual colors .text-muted { color: @text-muted; } @@ -116,11 +122,42 @@ cite { font-style: normal; } } } -// Alignment -.text-left { text-align: left; } -.text-right { text-align: right; } -.text-center { text-align: center; } -.text-justify { text-align: justify; } +// Contextual backgrounds +// For now we'll leave these alongside the text classes until v4 when we can +// safely shift things around (per SemVer rules). +.bg-primary { + // Given the contrast here, this is the only class to have it's color inverted + // automatically. + color: #fff; + background-color: @brand-primary; + a&:hover { + background-color: darken(@brand-primary, 10%); + } +} +.bg-warning { + background-color: @state-warning-bg; + a&:hover { + background-color: darken(@state-warning-bg, 10%); + } +} +.bg-danger { + background-color: @state-danger-bg; + a&:hover { + background-color: darken(@state-danger-bg, 10%); + } +} +.bg-success { + background-color: @state-success-bg; + a&:hover { + background-color: darken(@state-success-bg, 10%); + } +} +.bg-info { + background-color: @state-info-bg; + a&:hover { + background-color: darken(@state-info-bg, 10%); + } +} // Page header diff --git a/less/variables.less b/less/variables.less index 8122161fd..faccd927c 100644 --- a/less/variables.less +++ b/less/variables.less @@ -189,6 +189,9 @@ @dropdown-header-color: @gray-light; +// Note: Deprecated @dropdown-caret-color as of v3.1.0 +@dropdown-caret-color: #000; + // COMPONENT VARIABLES // -------------------------------------------------- @@ -402,6 +405,7 @@ @tooltip-max-width: 200px; @tooltip-color: #fff; @tooltip-bg: #000; +@tooltip-opacity: .9; @tooltip-arrow-width: 5px; @tooltip-arrow-color: @tooltip-bg; @@ -450,9 +454,13 @@ @modal-content-fallback-border-color: #999; @modal-backdrop-bg: #000; +@modal-backdrop-opacity: .5; @modal-header-border-color: #e5e5e5; @modal-footer-border-color: @modal-header-border-color; +@modal-lg: 900px; +@modal-sm: 300px; + // Alerts // ------------------------- @@ -491,24 +499,26 @@ // List group // ------------------------- -@list-group-bg: #fff; -@list-group-border: #ddd; -@list-group-border-radius: @border-radius-base; - -@list-group-hover-bg: #f5f5f5; -@list-group-active-color: @component-active-color; -@list-group-active-bg: @component-active-bg; -@list-group-active-border: @list-group-active-bg; +@list-group-bg: #fff; +@list-group-border: #ddd; +@list-group-border-radius: @border-radius-base; -@list-group-link-color: #555; -@list-group-link-heading-color: #333; +@list-group-hover-bg: #f5f5f5; +@list-group-active-color: @component-active-color; +@list-group-active-bg: @component-active-bg; +@list-group-active-border: @list-group-active-bg; +@list-group-active-text-color: lighten(@list-group-active-bg, 40%); +@list-group-link-color: #555; +@list-group-link-heading-color: #333; // Panels // ------------------------- @panel-bg: #fff; -@panel-inner-border: #ddd; +@panel-body-padding: 15px; @panel-border-radius: @border-radius-base; + +@panel-inner-border: #ddd; @panel-footer-bg: #f5f5f5; @panel-default-text: @gray-dark; @@ -550,6 +560,7 @@ // Wells // ------------------------- @well-bg: #f5f5f5; +@well-border: darken(@well-bg, 7%); // Badges diff --git a/less/wells.less b/less/wells.less index 865abc2eb..15d072b0c 100644 --- a/less/wells.less +++ b/less/wells.less @@ -9,7 +9,7 @@ padding: 19px; margin-bottom: 20px; background-color: @well-bg; - border: 1px solid darken(@well-bg, 7%); + border: 1px solid @well-border; border-radius: @border-radius-base; .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); blockquote { |
