From f5fd5e752329d92d3fde2e3f37f3406db62c400b Mon Sep 17 00:00:00 2001 From: Giuliano Velli Date: Fri, 20 Apr 2012 17:54:51 +0200 Subject: Added Medias code and documentation Added media.less and edited bootstrap.less and responsive.less to manage media components. Added a section to the documentation (Media, in components.html) outlining how Medias work. Edited bootstrap.css and bootstrap-responsive.css to add the code for the demos Signed-off-by: Giuliano Velli --- less/bootstrap.less | 1 + less/media.less | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ less/responsive.less | 14 +++++++++++ 3 files changed, 83 insertions(+) create mode 100644 less/media.less (limited to 'less') diff --git a/less/bootstrap.less b/less/bootstrap.less index d115e9567..4802fb4f6 100644 --- a/less/bootstrap.less +++ b/less/bootstrap.less @@ -52,6 +52,7 @@ // Components: Misc @import "thumbnails.less"; +@import "media.less"; @import "labels.less"; @import "badges.less"; @import "progress-bars.less"; diff --git a/less/media.less b/less/media.less new file mode 100644 index 000000000..87ea1bc1e --- /dev/null +++ b/less/media.less @@ -0,0 +1,68 @@ +// COMMON STYLES +// ------------- + +.media, .media-body { + overflow:hidden; + *overflow:visible; + zoom:1; +} +.media { + margin-bottom: 10px; +} +.media .media { + margin-top: 20px; +} +.media .pull-left { + margin-right: 10px; +} +.media .pull-right { + margin-left: 10px; +} +.media .media-object { + display: block; +} + +// Media list +.medias { + margin-top: 20px; + margin-left: 0; + list-style-type: none; +} +.medias .media { + padding-bottom: 10px; + border-bottom: 1px solid rgba(0, 0, 0, .07); +} +.medias > .media:last-child { + margin: 0; + border-bottom: none; +} +.medias > .media .media { + margin-bottom: 0; + padding-bottom: 0; + border-bottom: none; +} + +// Media box +.media-box { + margin-bottom: 19px; + padding: 10px; + background-color: #fff; + border: 1px solid rgba(0,0,0,.09); + .border-radius(4px); + .box-shadow(1px 1px 2px rgba(0, 0, 0, 0.1)); +} + +@media (max-width: 480px) { + .media .pull-left, + .media .pull-right { + float: none; + display: block; + margin-bottom: 10px; + } + .media .pull-left { + margin-right: 0; + } + .media .pull-right { + margin-left: 0; + } +} \ No newline at end of file diff --git a/less/responsive.less b/less/responsive.less index 98485eebd..b72aa90e2 100644 --- a/less/responsive.less +++ b/less/responsive.less @@ -106,6 +106,20 @@ padding-left: 10px; padding-right: 10px; } + + // Medias + .media .pull-left, + .media .pull-right { + float: none; + display: block; + margin-bottom: 10px; + } + .media .pull-left { + margin-right: 0; + } + .media .pull-right { + margin-left: 0; + } // Modals .modal { -- cgit v1.2.3 From 4fbb400754986b969b40fc12eacfd332ace1a174 Mon Sep 17 00:00:00 2001 From: Giuliano Velli Date: Fri, 20 Apr 2012 17:54:51 +0200 Subject: Added Medias code and documentation Fix for Issue #1711 Added media.less and edited bootstrap.less and responsive.less to manage media components. Added a section to the documentation (Media, in components.html) outlining how Medias work. Edited bootstrap.css and bootstrap-responsive.css to add the code for the demos Signed-off-by: Giuliano Velli --- less/bootstrap.less | 1 + less/media.less | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ less/responsive.less | 14 +++++++++++ 3 files changed, 83 insertions(+) create mode 100644 less/media.less (limited to 'less') diff --git a/less/bootstrap.less b/less/bootstrap.less index d115e9567..4802fb4f6 100644 --- a/less/bootstrap.less +++ b/less/bootstrap.less @@ -52,6 +52,7 @@ // Components: Misc @import "thumbnails.less"; +@import "media.less"; @import "labels.less"; @import "badges.less"; @import "progress-bars.less"; diff --git a/less/media.less b/less/media.less new file mode 100644 index 000000000..87ea1bc1e --- /dev/null +++ b/less/media.less @@ -0,0 +1,68 @@ +// COMMON STYLES +// ------------- + +.media, .media-body { + overflow:hidden; + *overflow:visible; + zoom:1; +} +.media { + margin-bottom: 10px; +} +.media .media { + margin-top: 20px; +} +.media .pull-left { + margin-right: 10px; +} +.media .pull-right { + margin-left: 10px; +} +.media .media-object { + display: block; +} + +// Media list +.medias { + margin-top: 20px; + margin-left: 0; + list-style-type: none; +} +.medias .media { + padding-bottom: 10px; + border-bottom: 1px solid rgba(0, 0, 0, .07); +} +.medias > .media:last-child { + margin: 0; + border-bottom: none; +} +.medias > .media .media { + margin-bottom: 0; + padding-bottom: 0; + border-bottom: none; +} + +// Media box +.media-box { + margin-bottom: 19px; + padding: 10px; + background-color: #fff; + border: 1px solid rgba(0,0,0,.09); + .border-radius(4px); + .box-shadow(1px 1px 2px rgba(0, 0, 0, 0.1)); +} + +@media (max-width: 480px) { + .media .pull-left, + .media .pull-right { + float: none; + display: block; + margin-bottom: 10px; + } + .media .pull-left { + margin-right: 0; + } + .media .pull-right { + margin-left: 0; + } +} \ No newline at end of file diff --git a/less/responsive.less b/less/responsive.less index 98485eebd..b72aa90e2 100644 --- a/less/responsive.less +++ b/less/responsive.less @@ -106,6 +106,20 @@ padding-left: 10px; padding-right: 10px; } + + // Medias + .media .pull-left, + .media .pull-right { + float: none; + display: block; + margin-bottom: 10px; + } + .media .pull-left { + margin-right: 0; + } + .media .pull-right { + margin-left: 0; + } // Modals .modal { -- cgit v1.2.3 From 5ff5d351bfbdf13ea93ccfed79743e62f50f9747 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 5 Sep 2012 19:07:53 +0300 Subject: Do not force white icons in active tab links Active `.nav-tabs` elements are not blue (like pills), so forcing a white icon there is not appropriate. --- less/sprites.less | 2 -- 1 file changed, 2 deletions(-) (limited to 'less') diff --git a/less/sprites.less b/less/sprites.less index 9bf970fa9..6d3aaef32 100644 --- a/less/sprites.less +++ b/less/sprites.less @@ -30,8 +30,6 @@ /* White icons with optional class, or on hover/active states of certain elements */ .icon-white, -.nav-tabs > .active > a > [class^="icon-"], -.nav-tabs > .active > a > [class*=" icon-"], .nav-pills > .active > a > [class^="icon-"], .nav-pills > .active > a > [class*=" icon-"], .nav-list > .active > a > [class^="icon-"], -- cgit v1.2.3 From 08b8571cb842e9fc668d9faf6c305a51523b27fb Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 5 Sep 2012 10:00:57 -0700 Subject: version bump to get this started --- less/bootstrap.less | 2 +- less/responsive.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'less') diff --git a/less/bootstrap.less b/less/bootstrap.less index aaa3d8a6f..3055c5cc4 100644 --- a/less/bootstrap.less +++ b/less/bootstrap.less @@ -1,5 +1,5 @@ /*! - * Bootstrap v2.1.1 + * Bootstrap v2.1.2 * * Copyright 2012 Twitter, Inc * Licensed under the Apache License v2.0 diff --git a/less/responsive.less b/less/responsive.less index 87b347085..e56042e4e 100644 --- a/less/responsive.less +++ b/less/responsive.less @@ -1,5 +1,5 @@ /*! - * Bootstrap Responsive v2.1.1 + * Bootstrap Responsive v2.1.2 * * Copyright 2012 Twitter, Inc * Licensed under the Apache License v2.0 -- cgit v1.2.3 From d4a16d35eb031cc4cffa4a3c4456fab406e286e5 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 5 Sep 2012 10:05:54 -0700 Subject: fixes #4996: incorrect border radius on a table --- less/tables.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'less') diff --git a/less/tables.less b/less/tables.less index 13c37c6e8..e5b3f3979 100644 --- a/less/tables.less +++ b/less/tables.less @@ -133,7 +133,7 @@ table { colgroup + tbody tr:first-child td:last-child { -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; - -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; } } -- cgit v1.2.3 From cc4f8b9f6c735400d76357884f8aa35d26e81574 Mon Sep 17 00:00:00 2001 From: "Dionysios G. Arvanitis" Date: Fri, 7 Sep 2012 17:54:15 +0300 Subject: remove offset margin in row-fluid mobile layout --- less/responsive-767px-max.less | 3 +++ 1 file changed, 3 insertions(+) (limited to 'less') diff --git a/less/responsive-767px-max.less b/less/responsive-767px-max.less index 79c7eaa82..6e4261047 100644 --- a/less/responsive-767px-max.less +++ b/less/responsive-767px-max.less @@ -70,6 +70,9 @@ width: 100%; .box-sizing(border-box); } + .row-fluid [class*="offset"]:first-child { + margin-left: 0; + } // FORM FIELDS // ----------- -- cgit v1.2.3 From 7a0f5c6c00ab7f70346e59503f850c5b5623f908 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 7 Sep 2012 11:04:51 -0700 Subject: fixes #5010: .pager span selector should be scoped to immediate children only --- less/pager.less | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'less') diff --git a/less/pager.less b/less/pager.less index a7629d3db..da2425367 100644 --- a/less/pager.less +++ b/less/pager.less @@ -12,28 +12,29 @@ .pager li { display: inline; } -.pager a, -.pager span { +.pager li > a, +.pager li > span { display: inline-block; padding: 5px 14px; background-color: #fff; border: 1px solid #ddd; .border-radius(15px); } -.pager a:hover { +.pager li > a:hover { text-decoration: none; background-color: #f5f5f5; } -.pager .next a, -.pager .next span { +.pager .next > a, +.pager .next > span { float: right; } -.pager .previous a { +.pager .previous > a, +.pager .previous > span { float: left; } -.pager .disabled a, -.pager .disabled a:hover, -.pager .disabled span { +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > span { color: @grayLight; background-color: #fff; cursor: default; -- cgit v1.2.3 From f2bd7d9f276753a8a2ab27490d06c2a081abb3af Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 7 Sep 2012 11:10:00 -0700 Subject: fixes #5018: .btn-block in .modal-footer no longer has left margin --- less/modals.less | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'less') diff --git a/less/modals.less b/less/modals.less index 81cacb7ab..a0401c4d1 100644 --- a/less/modals.less +++ b/less/modals.less @@ -95,4 +95,8 @@ .btn-group .btn + .btn { margin-left: -1px; } + // and override it for block buttons as well + .btn-block + .btn-block { + margin-left: 0; + } } -- cgit v1.2.3 From 61332d727e6e1d67def803b2f8d61047d79db0cc Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 7 Sep 2012 11:34:05 -0700 Subject: fixes #5020: submenu support in dropup --- less/dropdowns.less | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'less') diff --git a/less/dropdowns.less b/less/dropdowns.less index 390c37497..bed158612 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -163,6 +163,8 @@ .dropdown-submenu { position: relative; } + +// Default dropdowns .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; @@ -176,6 +178,18 @@ display: block; } +// Dropups +.dropup .dropdown-submenu > .dropdown-menu { + top: auto; + bottom: 0; + margin-top: 0; + margin-bottom: -2px; + -webkit-border-radius: 5px 5px 5px 0; + -moz-border-radius: 5px 5px 5px 0; + border-radius: 5px 5px 5px 0; +} + +// Caret to indicate there is a submenu .dropdown-submenu > a:after { display: block; content: " "; -- cgit v1.2.3 From cd2b12f788f9c1d32ae20929f7deefb5ad2d99e8 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 10 Sep 2012 22:41:14 -0700 Subject: fixes #5064 manually: remove fancy quote mark --- less/forms.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'less') diff --git a/less/forms.less b/less/forms.less index f8d8562b6..fe1e46d53 100644 --- a/less/forms.less +++ b/less/forms.less @@ -210,7 +210,7 @@ input[type="checkbox"]:focus { // Placeholder // ------------------------- -// Placeholder text gets special styles because when browsers invalidate entire lines if it doesn’t understand a selector +// Placeholder text gets special styles because when browsers invalidate entire lines if it doesn't understand a selector input, textarea { .placeholder(); -- cgit v1.2.3 From 0489c708c7104fffa7bddad18399f46db78e56fa Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 10 Sep 2012 22:51:16 -0700 Subject: fixes #5040 manually: remove overflow: auto; from .modal to resolve sporadic modal right padding issues with scrollbars --- less/modals.less | 1 - 1 file changed, 1 deletion(-) (limited to 'less') diff --git a/less/modals.less b/less/modals.less index a0401c4d1..5f7b43ef6 100644 --- a/less/modals.less +++ b/less/modals.less @@ -36,7 +36,6 @@ top: 50%; left: 50%; z-index: @zindexModal; - overflow: auto; width: 560px; margin: -250px 0 0 -280px; background-color: @white; -- cgit v1.2.3 From 2c8eff0eecb92b7e1b585afe3b59bf907a3e3a78 Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Wed, 12 Sep 2012 14:10:03 -0600 Subject: Updated pagination to support .pagination-large, .pagination-small, .pagination-mini matching button sizes. Updated related docs. --- less/pagination.less | 54 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 6 deletions(-) (limited to 'less') diff --git a/less/pagination.less b/less/pagination.less index 61a760be5..57771824a 100644 --- a/less/pagination.less +++ b/less/pagination.less @@ -3,10 +3,6 @@ // -------------------------------------------------- -.pagination { - height: @baseLineHeight * 2; - margin: @baseLineHeight 0; - } .pagination ul { display: inline-block; .ie7-inline-block(); @@ -21,8 +17,6 @@ .pagination ul > li > a, .pagination ul > li > span { float: left; - padding: 0 14px; - line-height: (@baseLineHeight * 2) - 2; text-decoration: none; background-color: @paginationBackground; border: 1px solid @paginationBorder; @@ -62,3 +56,51 @@ .pagination-right { text-align: right; } + +// Pagination Sizes +// -------------------------------------------------- + +// Default +.pagination { + margin: (@baseLineHeight - 3) 0; + height: @baseLineHeight + 10; + font-size: @baseFontSize; + ul > li > a, + ul > li > span { + padding: 0 12px; + line-height: @baseLineHeight + 8; + } +} +// Large +.pagination-large { + margin: @baseLineHeight 0; + height: @baseLineHeight + 18; + font-size: @baseFontSize + 2px; + ul > li > a, + ul > li > span { + padding: 0 15px; + line-height: (@baseLineHeight * 2) - 4; + } +} +// Small +.pagination-small { + margin: (@baseLineHeight - 5) 0; + height: @baseLineHeight + 6; + font-size: @baseFontSize - 2px; + ul > li > a, + ul > li > span { + padding: 0 10px; + line-height: @baseLineHeight + 2; + } +} +// Mini +.pagination-mini { + margin: (@baseLineHeight - 10) 0; + height: @baseLineHeight + 3; + font-size: @baseFontSize - 3px; + ul > li > a, + ul > li > span { + padding: 0 8px; + line-height: @baseLineHeight + 1; + } +} -- cgit v1.2.3 From bbadd429a8e4704c55ac0d9a228decf4a77f484a Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 12 Sep 2012 15:48:56 -0700 Subject: change up box-shadow mixin usage everywhere to use escaping again, or local var if necessary for further var evaluation --- less/button-groups.less | 4 ++-- less/buttons.less | 4 ++-- less/forms.less | 2 +- less/navbar.less | 2 +- less/progress-bars.less | 2 +- less/responsive-navbar.less | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'less') diff --git a/less/button-groups.less b/less/button-groups.less index 62e53f373..7bd639aac 100644 --- a/less/button-groups.less +++ b/less/button-groups.less @@ -120,7 +120,7 @@ .btn-group > .btn + .dropdown-toggle { padding-left: 8px; padding-right: 8px; - .box-shadow(inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)); + .box-shadow(~"inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)"); *padding-top: 5px; *padding-bottom: 5px; } @@ -147,7 +147,7 @@ // Remove the gradient and set the same inset shadow as the :active state .dropdown-toggle { background-image: none; - .box-shadow(inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)); + .box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)"); } // Keep the hover's background when dropdown is open diff --git a/less/buttons.less b/less/buttons.less index 3fd1e95f5..c80986ea7 100644 --- a/less/buttons.less +++ b/less/buttons.less @@ -24,7 +24,7 @@ border-bottom-color: darken(@btnBorder, 10%); .border-radius(4px); .ie7-restore-left-whitespace(); // Give IE7 some love - .box-shadow(inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)); + .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)"); // Hover state &:hover { @@ -51,7 +51,7 @@ background-color: darken(@white, 15%) e("\9"); background-image: none; outline: 0; - .box-shadow(inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)); + .box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)"); } // Disabled state diff --git a/less/forms.less b/less/forms.less index fe1e46d53..74fb6189e 100644 --- a/less/forms.less +++ b/less/forms.less @@ -126,7 +126,7 @@ input[type="color"], border-color: rgba(82,168,236,.8); outline: 0; outline: thin dotted \9; /* IE6-9 */ - .box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)); + .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)"); } } diff --git a/less/navbar.less b/less/navbar.less index 3514c40e0..c1203df35 100644 --- a/less/navbar.less +++ b/less/navbar.less @@ -274,7 +274,7 @@ margin-left: 5px; margin-right: 5px; .buttonBackground(darken(@navbarBackgroundHighlight, 5%), darken(@navbarBackground, 5%)); - .box-shadow(inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075)); + .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075)"); } .navbar .btn-navbar .icon-bar { display: block; diff --git a/less/progress-bars.less b/less/progress-bars.less index 0486371aa..36744d89c 100644 --- a/less/progress-bars.less +++ b/less/progress-bars.less @@ -66,7 +66,7 @@ .transition(width .6s ease); } .progress .bar + .bar { - .box-shadow(inset 1px 0 0 rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.15)); + .box-shadow(~"inset 1px 0 0 rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.15)"); } // Striped bars diff --git a/less/responsive-navbar.less b/less/responsive-navbar.less index c454dd5e3..4ffa5a9fe 100644 --- a/less/responsive-navbar.less +++ b/less/responsive-navbar.less @@ -129,7 +129,7 @@ margin: (@baseLineHeight / 2) 0; border-top: 1px solid @navbarBackground; border-bottom: 1px solid @navbarBackground; - .box-shadow(inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1)); + .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1)"); } .navbar-inverse .nav-collapse .navbar-form, .navbar-inverse .nav-collapse .navbar-search { -- cgit v1.2.3 From 38303dd9975a8f1bca89b9f0f8ef06a26dd3f1e0 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 12 Sep 2012 15:53:29 -0700 Subject: revert the js evaluation in .box-shadow mixin, fix last mixin usages to escape if using >1 shadows --- less/mixins.less | 12 +++++------- less/navbar.less | 6 +++--- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'less') diff --git a/less/mixins.less b/less/mixins.less index 67f1c0af7..9204d8cde 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -183,7 +183,7 @@ .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work &:focus { border-color: darken(@borderColor, 10%); - .box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@borderColor, 20%)); + .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@borderColor, 20%)"); } } // Give a small background color for input-prepend/-append @@ -248,12 +248,10 @@ } // Drop shadows -.box-shadow(@shadowA, @shadowB:X, ...){ - // Multiple shadow solution from http://toekneestuck.com/blog/2012/05/15/less-css-arguments-variable/ - @props: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`; - -webkit-box-shadow: @props; - -moz-box-shadow: @props; - box-shadow: @props; +.box-shadow(@shadow){ + -webkit-box-shadow: @shadow; + -moz-box-shadow: @shadow; + box-shadow: @shadow; } // Transitions diff --git a/less/navbar.less b/less/navbar.less index c1203df35..25651b14a 100644 --- a/less/navbar.less +++ b/less/navbar.less @@ -202,7 +202,7 @@ .navbar-fixed-top, .navbar-static-top { .navbar-inner { - .box-shadow(inset 0 -1px 0 rgba(0,0,0,.1), 0 1px 10px rgba(0,0,0,.1)); + .box-shadow(~"inset 0 -1px 0 rgba(0,0,0,.1), 0 1px 10px rgba(0,0,0,.1)"); } } @@ -210,7 +210,7 @@ .navbar-fixed-bottom { bottom: 0; .navbar-inner { - .box-shadow(inset 0 1px 0 rgba(0,0,0,.1), 0 -1px 10px rgba(0,0,0,.1)); + .box-shadow(~"inset 0 1px 0 rgba(0,0,0,.1), 0 -1px 10px rgba(0,0,0,.1)"); } } @@ -446,7 +446,7 @@ color: @white; background-color: @navbarInverseSearchBackground; border-color: @navbarInverseSearchBorder; - .box-shadow(inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15)); + .box-shadow(~"inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15)"); .transition(none); .placeholder(@navbarInverseSearchPlaceholderColor); -- cgit v1.2.3 From 65d322958ca9b4217548807c54414606182666fb Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 12 Sep 2012 16:11:03 -0700 Subject: add space --- less/mixins.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'less') diff --git a/less/mixins.less b/less/mixins.less index 9204d8cde..f6cde1966 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -248,7 +248,7 @@ } // Drop shadows -.box-shadow(@shadow){ +.box-shadow(@shadow) { -webkit-box-shadow: @shadow; -moz-box-shadow: @shadow; box-shadow: @shadow; -- cgit v1.2.3 From 537c5cc33dd91772d51c1b767eb31afbc1e9c6cf Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 12 Sep 2012 16:18:52 -0700 Subject: use local var for a few other .box-shadow mixins to fix CSS not compiling --- less/forms.less | 3 ++- less/mixins.less | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'less') diff --git a/less/forms.less b/less/forms.less index 74fb6189e..7030ac3c1 100644 --- a/less/forms.less +++ b/less/forms.less @@ -364,7 +364,8 @@ select:focus:required:invalid { border-color: #ee5f5b; &:focus { border-color: darken(#ee5f5b, 10%); - .box-shadow(0 0 6px lighten(#ee5f5b, 20%)); + @shadow: 0 0 6px lighten(#ee5f5b, 20%); + .box-shadow(@shadow); } } diff --git a/less/mixins.less b/less/mixins.less index f6cde1966..c146e4005 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -183,7 +183,8 @@ .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work &:focus { border-color: darken(@borderColor, 10%); - .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@borderColor, 20%)"); + @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@borderColor, 20%); + .box-shadow(@shadow); } } // Give a small background color for input-prepend/-append -- cgit v1.2.3 From 15bb78ce800dc74dfd5eed98f3d256ce095ccab0 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 12 Sep 2012 16:37:41 -0700 Subject: fixes #5107: make all .btn-group inline-block by default instead of just within a .btn-toolbar --- less/button-groups.less | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'less') diff --git a/less/button-groups.less b/less/button-groups.less index 7bd639aac..dcae11336 100644 --- a/less/button-groups.less +++ b/less/button-groups.less @@ -6,6 +6,8 @@ // Make the div behave like a button .btn-group { position: relative; + display: inline-block; + .ie7-inline-block(); font-size: 0; // remove as part 1 of font-size inline-block hack vertical-align: middle; // match .btn alignment given font-size hack above white-space: nowrap; // prevent buttons from wrapping when in tight spaces (e.g., the table on the tests page) @@ -22,10 +24,6 @@ font-size: 0; // Hack to remove whitespace that results from using inline-block margin-top: @baseLineHeight / 2; margin-bottom: @baseLineHeight / 2; - .btn-group { - display: inline-block; - .ie7-inline-block(); - } .btn + .btn, .btn-group + .btn, .btn + .btn-group { -- cgit v1.2.3 From 5331fe39df7bf0f010d0001a91a2ff796e3989b5 Mon Sep 17 00:00:00 2001 From: Adrien Cahen Date: Thu, 13 Sep 2012 12:16:18 -0700 Subject: fix active tab bg on non-white body --- less/navs.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'less') diff --git a/less/navs.less b/less/navs.less index 4c38f7dbf..0836cd512 100644 --- a/less/navs.less +++ b/less/navs.less @@ -123,7 +123,7 @@ .nav-tabs > .active > a, .nav-tabs > .active > a:hover { color: @gray; - background-color: @white; + background-color: @bodyBackground; border: 1px solid #ddd; border-bottom-color: transparent; cursor: default; -- cgit v1.2.3 From 6aa15eb01f2e50e394ae172ff41e5bc0583de6da Mon Sep 17 00:00:00 2001 From: Robert McLaws Date: Sun, 16 Sep 2012 03:02:31 -0400 Subject: Support for left-opening dropdown submenus Adds a new class called .dropdown-submenu-left. It is useful when you have a .pull-right DropDown that has submenus. Without this, the menu opens left past the page boundary, which can trigger the scrollbars and cause other nastiness. --- less/dropdowns.less | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'less') diff --git a/less/dropdowns.less b/less/dropdowns.less index bed158612..9622d2d46 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -163,7 +163,6 @@ .dropdown-submenu { position: relative; } - // Default dropdowns .dropdown-submenu > .dropdown-menu { top: 0; @@ -207,6 +206,40 @@ border-left-color: @dropdownLinkColorHover; } +// Left-opening Sub menus +// --------------------------- +.dropdown-submenu-left { + position: relative; +} +.dropdown-submenu-left > .dropdown-menu { + top: 0; + left: -100%; + margin-top: -6px; + margin-left: -1px; + -webkit-border-radius: 6px 0px 6px 6px; + -moz-border-radius: 6px 0px 6px 6px; + border-radius: 6px 0px 6px 6px; +} +.dropdown-submenu-left:hover > .dropdown-menu { + display: block; +} + +.dropdown-submenu-left > a:before { + display: block; + content: " "; + float: left; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 5px 5px 0px; + border-right-color: darken(@dropdownBackground, 20%); + margin-top: 5px; + margin-left: -10px; +} +.dropdown-submenu-left:hover > a:after { + border-right-color: @dropdownLinkColorHover; +} // Tweak nav headers // ----------------- -- cgit v1.2.3 From 1ea09b751eca711a65f881a58ba67c71ee6b47e0 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 17 Sep 2012 08:52:19 -0700 Subject: fixes #5163: add new var for navbar collapse's default view, use that in responsive navbar css --- less/responsive-navbar.less | 2 +- less/variables.less | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'less') diff --git a/less/responsive-navbar.less b/less/responsive-navbar.less index 4ffa5a9fe..9cc6e258e 100644 --- a/less/responsive-navbar.less +++ b/less/responsive-navbar.less @@ -166,7 +166,7 @@ // DEFAULT DESKTOP // --------------- -@media (min-width: 980px) { +@media (min-width: @navbarCollapseDesktopWidth) { // Required to make the collapsing navbar work on regular desktops .nav-collapse.collapse { diff --git a/less/variables.less b/less/variables.less index 7d6efe005..734664316 100644 --- a/less/variables.less +++ b/less/variables.less @@ -157,6 +157,7 @@ // Navbar // ------------------------- @navbarCollapseWidth: 979px; +@navbarCollapseDesktopWidth: @navbarCollapseWidth + 1; @navbarHeight: 40px; @navbarBackgroundHighlight: #ffffff; -- cgit v1.2.3 From 03a406d920c0255533aa0f5bb7c3fe4569b8f687 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 17 Sep 2012 15:49:22 -0700 Subject: fixes #5041: add new navbar css tests for each variation, remove width: 100%; from .navbar-static-top --- less/navbar.less | 1 - less/tests/navbar-fixed-top.html | 92 +++++++++++++++++++++++++++++++++++++ less/tests/navbar-static-top.html | 95 +++++++++++++++++++++++++++++++++++++++ less/tests/navbar.html | 57 +++++++++-------------- 4 files changed, 209 insertions(+), 36 deletions(-) create mode 100644 less/tests/navbar-fixed-top.html create mode 100644 less/tests/navbar-static-top.html (limited to 'less') diff --git a/less/navbar.less b/less/navbar.less index 25651b14a..33c90694e 100644 --- a/less/navbar.less +++ b/less/navbar.less @@ -152,7 +152,6 @@ .navbar-static-top { position: static; - width: 100%; margin-bottom: 0; // remove 18px margin for default navbar .navbar-inner { .border-radius(0); diff --git a/less/tests/navbar-fixed-top.html b/less/tests/navbar-fixed-top.html new file mode 100644 index 000000000..d454b65f8 --- /dev/null +++ b/less/tests/navbar-fixed-top.html @@ -0,0 +1,92 @@ + + + + + Bootstrap, from Twitter + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

Navbar example

+

This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.

+

+ View navbar docs » +

+
+ +
+ + + + + + + + + + + + + + + + + + + diff --git a/less/tests/navbar-static-top.html b/less/tests/navbar-static-top.html new file mode 100644 index 000000000..ea131d453 --- /dev/null +++ b/less/tests/navbar-static-top.html @@ -0,0 +1,95 @@ + + + + + Bootstrap, from Twitter + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

Navbar example

+

This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.

+

+ View navbar docs » +

+
+ +
+ + + + + + + + + + + + + + + + + + + diff --git a/less/tests/navbar.html b/less/tests/navbar.html index 17754bf6e..342b92167 100644 --- a/less/tests/navbar.html +++ b/less/tests/navbar.html @@ -11,9 +11,12 @@ @@ -32,27 +35,6 @@ - - -
@@ -71,6 +53,11 @@
  • About
  • Contact
  • +
    @@ -90,19 +77,19 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + -- cgit v1.2.3 From 6881c193ca838844cacaf343d5918fb166bdd437 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 17 Sep 2012 16:09:36 -0700 Subject: fixes #5039: properly set .row-fluid margins for .controls-row --- less/forms.less | 8 ++++++-- less/mixins.less | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'less') diff --git a/less/forms.less b/less/forms.less index 7030ac3c1..d4e0f3487 100644 --- a/less/forms.less +++ b/less/forms.less @@ -304,8 +304,12 @@ textarea[class*="span"], .controls-row { .clearfix(); // Clear the float from controls } -.controls-row [class*="span"] { - float: left; // Float to collapse white-space for proper grid alignment + +// Float to collapse white-space for proper grid alignment +.controls-row [class*="span"], +// Redeclare the fluid grid collapse since we undo the float for inputs +.row-fluid .controls-row [class*="span"] { + float: left; } diff --git a/less/mixins.less b/less/mixins.less index c146e4005..4650d4790 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -642,6 +642,11 @@ margin-left: 0; } + // Space grid-sized controls properly if multiple per line + .controls-row [class*="span"] + [class*="span"] { + margin-left: @fluidGridGutterWidth; + } + // generate .spanX and .offsetX .spanX (@gridColumns); .offsetX (@gridColumns); -- cgit v1.2.3 From 143fef9f95daca088c1a910fccd07f2b520d8b0b Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 17 Sep 2012 18:15:39 -0700 Subject: overhaul the docs and css to merge into 2.1.2 since this was against master --- less/media.less | 86 ++++++++++++++++++------------------------ less/responsive-767px-max.less | 8 ++-- 2 files changed, 40 insertions(+), 54 deletions(-) (limited to 'less') diff --git a/less/media.less b/less/media.less index dbcc212a0..1decab71d 100644 --- a/less/media.less +++ b/less/media.less @@ -1,69 +1,55 @@ -// COMMON STYLES -// ------------- +// Media objects +// Source: http://stubbornella.org/content/?p=497 +// -------------------------------------------------- -.media, + +// Common styles +// ------------------------- + +// Clear the floats +.media, .media-body { overflow: hidden; *overflow: visible; zoom: 1; } -.media { - margin-bottom: 10px; -} + +// Proper spacing between instances of .media +.media, .media .media { - margin-top: 20px; -} -.media .pull-left { - margin-right: 10px; + margin-top: 15px; } -.media .pull-right { - margin-left: 10px; +.media:first-child { + margin-top: 0; } -.media .media-object { + +// For images and videos, set to block +.media-object { display: block; } -// Media list -.medias { - margin-top: 20px; - margin-left: 0; - list-style-type: none; -} -.medias .media { - padding-bottom: 10px; - border-bottom: 1px solid rgba(0,0,0,.07); +// Reset margins on headings for tighter default spacing +.media-heading { + margin: 0 0 5px; } -.medias > .media.last { - margin: 0; - border-bottom: none; -} -.medias > .media .media { - margin-bottom: 0; - padding-bottom: 0; - border-bottom: none; -} -// Media box -.media-box { - margin-bottom: 19px; - padding: 10px; - background-color: #fff; - border: 1px solid rgba(0,0,0,.09); - .border-radius(4px); - .box-shadow(1px 1px 2px rgba(0,0,0,.1)); -} -@media (max-width: 480px) { -.media .pull-left, -.media .pull-right { - float: none; - display: block; - margin-bottom: 10px; -} +// Media image alignment +// ------------------------- + .media .pull-left { - margin-right: 0; // we stack the components so the indent is not needed anymore + margin-right: 10px; } .media .pull-right { - margin-left: 0; // we stack the components so the indent is not needed anymore + margin-left: 10px; +} + + +// Media list variation +// ------------------------- + +// Undo default ul/ol styles +.media-list { + margin-left: 0; + list-style: none; } -} \ No newline at end of file diff --git a/less/responsive-767px-max.less b/less/responsive-767px-max.less index 322acae21..5a23fc683 100644 --- a/less/responsive-767px-max.less +++ b/less/responsive-767px-max.less @@ -156,16 +156,16 @@ } // Medias + // Reset float and spacing to stack .media .pull-left, - .media .pull-right { + .media .pull-right { float: none; display: block; margin-bottom: 10px; } - .media .pull-left { + // Remove side margins since we stack instead of indent + .media-object { margin-right: 0; - } - .media .pull-right { margin-left: 0; } -- cgit v1.2.3 From cedb3c7c56887d4ca42296ee193f2ff08dfe9ac4 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 17 Sep 2012 23:03:18 -0700 Subject: fixes #5173: proper popover offsets; added docs examples to enable tests in the future --- less/popovers.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'less') diff --git a/less/popovers.less b/less/popovers.less index 2b3f1b059..a4c4bb0e0 100644 --- a/less/popovers.less +++ b/less/popovers.less @@ -21,10 +21,10 @@ .box-shadow(0 5px 10px rgba(0,0,0,.2)); // Offset the popover to account for the popover arrow - &.top { margin-bottom: 10px; } + &.top { margin-top: -10px; } &.right { margin-left: 10px; } &.bottom { margin-top: 10px; } - &.left { margin-right: 10px; } + &.left { margin-left: -10px; } } -- cgit v1.2.3 From 239e6a7d210a69413d0f4b4b000f2f38f53e1c44 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 17 Sep 2012 23:11:49 -0700 Subject: fixes #5082 manually: reset font-size for .dropdown-menu within .input-prepend/-append --- less/forms.less | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'less') diff --git a/less/forms.less b/less/forms.less index d4e0f3487..a48d6cb58 100644 --- a/less/forms.less +++ b/less/forms.less @@ -418,16 +418,23 @@ select:focus:required:invalid { .input-append, .input-prepend { margin-bottom: 5px; - font-size: 0; + font-size: 0; // white space collapse hack white-space: nowrap; // Prevent span and input from separating + // Reset the white space collapse hack + input, + select, + .uneditable-input, + .dropdown-menu { + font-size: @baseFontSize; + } + input, select, .uneditable-input { position: relative; // placed here by default so that on :focus we can place the input above the .add-on for full border and box-shadow goodness margin-bottom: 0; // prevent bottom margin from screwing up alignment in stacked forms *margin-left: 0; - font-size: @baseFontSize; vertical-align: top; .border-radius(0 @inputBorderRadius @inputBorderRadius 0); // Make input on top when focused so blue border and shadow always show -- cgit v1.2.3 From 3b3def4898b7d60e9a8b9b95707ee56323b23f36 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 17 Sep 2012 23:19:52 -0700 Subject: fixes #5087: add hover states to text emphasis classes for links --- less/type.less | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'less') diff --git a/less/type.less b/less/type.less index 2e0f386ee..78ccb8119 100644 --- a/less/type.less +++ b/less/type.less @@ -39,15 +39,27 @@ cite { } .text-warning { color: @warningText; + &:hover { + color: darken(@warningText, 10%); + } } .text-error { color: @errorText; + &:hover { + color: darken(@errorText, 10%); + } } .text-info { color: @infoText; + &:hover { + color: darken(@infoText, 10%); + } } .text-success { color: @successText; + &:hover { + color: darken(@successText, 10%); + } } -- cgit v1.2.3 From 78992bbf42b93464737860948223e9f852a9f8e8 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 18 Sep 2012 11:23:16 -0700 Subject: fixes #5178: update normalize to avoid resetting audio and video elements in android --- less/reset.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'less') diff --git a/less/reset.less b/less/reset.less index 2901a85c8..ed3fecf41 100644 --- a/less/reset.less +++ b/less/reset.less @@ -115,11 +115,11 @@ input::-moz-focus-inner { // Inner padding and border oddities in FF3/4 border: 0; } button, -input[type="button"], +html input[type="button"], // Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` and `video` controls. input[type="reset"], input[type="submit"] { - cursor: pointer; // Cursors on all buttons applied consistently - -webkit-appearance: button; // Style clickable inputs in iOS + -webkit-appearance: button; // Corrects inability to style clickable `input` types in iOS. + cursor: pointer; // Improves usability and consistency of cursor style between image-type `input` and others. } input[type="search"] { // Appearance in Safari/Chrome -webkit-box-sizing: content-box; -- cgit v1.2.3 From cc3de8bd6eefe0c3edf3d3ef843276e0f4daae1e Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 18 Sep 2012 12:00:57 -0700 Subject: fixes #5177: remove color on .btn-large .caret, but keep sizing change; also start to add CSS tests for buttons --- less/button-groups.less | 3 +- less/tests/buttons.html | 139 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 less/tests/buttons.html (limited to 'less') diff --git a/less/button-groups.less b/less/button-groups.less index dcae11336..46837e628 100644 --- a/less/button-groups.less +++ b/less/button-groups.less @@ -191,8 +191,7 @@ } // Upside down carets for .dropup .dropup .btn-large .caret { - border-bottom: 5px solid @black; - border-top: 0; + border-bottom-width: 5px; } diff --git a/less/tests/buttons.html b/less/tests/buttons.html new file mode 100644 index 000000000..5fe7f664b --- /dev/null +++ b/less/tests/buttons.html @@ -0,0 +1,139 @@ + + + + + Buttons · Bootstrap + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Dropups

    + + + +
    + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 2769241aeb5e9eba4a34ddbd9d495f7f8271e360 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 18 Sep 2012 20:56:20 -0700 Subject: add new vars for common font-sizes and paddings with large, small, and mini components; resize pagination and buttons to better match each other --- less/buttons.less | 22 +++++++++++++--------- less/pagination.less | 48 +++++++++++++++++++----------------------------- less/variables.less | 14 ++++++++++++++ 3 files changed, 46 insertions(+), 38 deletions(-) (limited to 'less') diff --git a/less/buttons.less b/less/buttons.less index c80986ea7..1fa33d1e5 100644 --- a/less/buttons.less +++ b/less/buttons.less @@ -71,11 +71,17 @@ // Button Sizes // -------------------------------------------------- +// Reset line-heights +.btn-large, +.btn-small, +.btn-mini { + line-height: 1; +} + // Large .btn-large { - padding: 9px 14px; - font-size: @baseFontSize + 2px; - line-height: normal; + padding: @paddingLarge; + font-size: @fontSizeLarge; .border-radius(5px); } .btn-large [class^="icon-"] { @@ -84,9 +90,8 @@ // Small .btn-small { - padding: 3px 9px; - font-size: @baseFontSize - 2px; - line-height: @baseLineHeight - 2px; + padding: @paddingSmall; + font-size: @fontSizeSmall; } .btn-small [class^="icon-"] { margin-top: 0; @@ -94,9 +99,8 @@ // Mini .btn-mini { - padding: 2px 6px; - font-size: @baseFontSize - 3px; - line-height: @baseLineHeight - 3px; + padding: @paddingMini; + font-size: @fontSizeMini; } diff --git a/less/pagination.less b/less/pagination.less index 57771824a..2c823e149 100644 --- a/less/pagination.less +++ b/less/pagination.less @@ -2,21 +2,30 @@ // Pagination (multiple pages) // -------------------------------------------------- +// Space out pagination from surrounding content +.pagination { + margin: @baseLineHeight 0; +} .pagination ul { + // Allow for text-based alignment display: inline-block; .ie7-inline-block(); + // Reset default ul styles margin-left: 0; margin-bottom: 0; - .border-radius(3px); + // Visuals + .border-radius(4px); .box-shadow(0 1px 2px rgba(0,0,0,.05)); } .pagination ul > li { - display: inline; + display: inline; // Remove list-style and block-level defaults } .pagination ul > li > a, .pagination ul > li > span { - float: left; + float: left; // Collapse white-space + padding: 10px 14px; + line-height: 1; text-decoration: none; background-color: @paginationBackground; border: 1px solid @paginationBorder; @@ -57,50 +66,31 @@ text-align: right; } + // Pagination Sizes // -------------------------------------------------- -// Default -.pagination { - margin: (@baseLineHeight - 3) 0; - height: @baseLineHeight + 10; - font-size: @baseFontSize; - ul > li > a, - ul > li > span { - padding: 0 12px; - line-height: @baseLineHeight + 8; - } -} // Large .pagination-large { - margin: @baseLineHeight 0; - height: @baseLineHeight + 18; - font-size: @baseFontSize + 2px; + font-size: @fontSizeLarge; ul > li > a, ul > li > span { - padding: 0 15px; - line-height: (@baseLineHeight * 2) - 4; + padding: @paddingLarge; } } // Small .pagination-small { - margin: (@baseLineHeight - 5) 0; - height: @baseLineHeight + 6; - font-size: @baseFontSize - 2px; + font-size: @fontSizeSmall; ul > li > a, ul > li > span { - padding: 0 10px; - line-height: @baseLineHeight + 2; + padding: @paddingSmall; } } // Mini .pagination-mini { - margin: (@baseLineHeight - 10) 0; - height: @baseLineHeight + 3; - font-size: @baseFontSize - 3px; + font-size: @fontSizeMini; ul > li > a, ul > li > span { - padding: 0 8px; - line-height: @baseLineHeight + 1; + padding: @paddingMini; } } diff --git a/less/variables.less b/less/variables.less index 734664316..5fb685377 100644 --- a/less/variables.less +++ b/less/variables.less @@ -57,6 +57,7 @@ @headingsFontWeight: bold; // instead of browser default, bold @headingsColor: inherit; // empty to use BS default, @textColor + // Tables // ------------------------- @tableBackground: transparent; // overall background-color @@ -97,6 +98,7 @@ @inputDisabledBackground: @grayLighter; @formActionsBackground: #f5f5f5; + // Dropdowns // ------------------------- @dropdownBackground: @white; @@ -116,6 +118,7 @@ // COMPONENT VARIABLES // -------------------------------------------------- + // Z-index master list // ------------------------- // Used for a bird's eye view of components dependent on the z-axis @@ -128,6 +131,17 @@ @zindexModal: 1050; +// Component size variations +// ------------------------- +@fontSizeLarge: @baseFontSize * 1.25; // ~18px +@fontSizeSmall: @baseFontSize * 0.85; // ~12px +@fontSizeMini: @baseFontSize * 0.75; // ~11px + +@paddingLarge: 10px 19px; +@paddingSmall: 6px 10px; +@paddingMini: 5px 6px; + + // Sprite icons path // ------------------------- @iconSpritePath: "../img/glyphicons-halflings.png"; -- cgit v1.2.3 From 2d90c816accea106cbf70c988ddd866268851595 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 18 Sep 2012 21:16:08 -0700 Subject: add new vars for common border-radius, upping border-radius of inputs to 4px; add border-radius changes to -large, -small, -mini for buttons and paginations --- less/buttons.less | 13 ++++--------- less/pagination.less | 45 +++++++++++++++++++++++++++++++++++---------- less/variables.less | 30 ++++++++++++++++++------------ 3 files changed, 57 insertions(+), 31 deletions(-) (limited to 'less') diff --git a/less/buttons.less b/less/buttons.less index 1fa33d1e5..223d7439b 100644 --- a/less/buttons.less +++ b/less/buttons.less @@ -10,7 +10,7 @@ .btn { display: inline-block; .ie7-inline-block(); - padding: 4px 14px; + padding: 4px 12px; margin-bottom: 0; // For input.btn font-size: @baseFontSize; line-height: @baseLineHeight; @@ -71,18 +71,11 @@ // Button Sizes // -------------------------------------------------- -// Reset line-heights -.btn-large, -.btn-small, -.btn-mini { - line-height: 1; -} - // Large .btn-large { padding: @paddingLarge; font-size: @fontSizeLarge; - .border-radius(5px); + .border-radius(@borderRadiusLarge); } .btn-large [class^="icon-"] { margin-top: 2px; @@ -92,6 +85,7 @@ .btn-small { padding: @paddingSmall; font-size: @fontSizeSmall; + .border-radius(@borderRadiusSmall); } .btn-small [class^="icon-"] { margin-top: 0; @@ -101,6 +95,7 @@ .btn-mini { padding: @paddingMini; font-size: @fontSizeMini; + .border-radius(@borderRadiusSmall); } diff --git a/less/pagination.less b/less/pagination.less index 2c823e149..88065aa22 100644 --- a/less/pagination.less +++ b/less/pagination.less @@ -15,7 +15,7 @@ margin-left: 0; margin-bottom: 0; // Visuals - .border-radius(4px); + .border-radius(@baseBorderRadius); .box-shadow(0 1px 2px rgba(0,0,0,.05)); } .pagination ul > li { @@ -24,8 +24,8 @@ .pagination ul > li > a, .pagination ul > li > span { float: left; // Collapse white-space - padding: 10px 14px; - line-height: 1; + padding: 4px 12px; + line-height: @baseLineHeight; text-decoration: none; background-color: @paginationBackground; border: 1px solid @paginationBorder; @@ -51,14 +51,17 @@ .pagination ul > li:first-child > a, .pagination ul > li:first-child > span { border-left-width: 1px; - .border-radius(3px 0 0 3px); + .border-left-radius(@baseBorderRadius); } .pagination ul > li:last-child > a, .pagination ul > li:last-child > span { - .border-radius(0 3px 3px 0); + .border-right-radius(@baseBorderRadius); } -// Centered + +// Alignment +// -------------------------------------------------- + .pagination-centered { text-align: center; } @@ -67,30 +70,52 @@ } -// Pagination Sizes +// Sizing // -------------------------------------------------- // Large .pagination-large { - font-size: @fontSizeLarge; ul > li > a, ul > li > span { padding: @paddingLarge; + font-size: @fontSizeLarge; + } + ul > li:first-child > a, + ul > li:first-child > span { + .border-left-radius(@borderRadiusLarge); + } + ul > li:last-child > a, + ul > li:last-child > span { + .border-right-radius(@borderRadiusLarge); } } + +// Small and mini +.pagination-mini, +.pagination-small { + ul > li:first-child > a, + ul > li:first-child > span { + .border-left-radius(@borderRadiusSmall); + } + ul > li:last-child > a, + ul > li:last-child > span { + .border-right-radius(@borderRadiusSmall); + } +} + // Small .pagination-small { - font-size: @fontSizeSmall; ul > li > a, ul > li > span { padding: @paddingSmall; + font-size: @fontSizeSmall; } } // Mini .pagination-mini { - font-size: @fontSizeMini; ul > li > a, ul > li > span { padding: @paddingMini; + font-size: @fontSizeMini; } } diff --git a/less/variables.less b/less/variables.less index 5fb685377..fcb85c009 100644 --- a/less/variables.less +++ b/less/variables.less @@ -58,6 +58,23 @@ @headingsColor: inherit; // empty to use BS default, @textColor +// Component sizing +// ------------------------- +// Based on 14px font-size and 20px line-height + +@fontSizeLarge: @baseFontSize * 1.25; // ~18px +@fontSizeSmall: @baseFontSize * 0.85; // ~12px +@fontSizeMini: @baseFontSize * 0.75; // ~11px + +@paddingLarge: 11px 19px; // 44px +@paddingSmall: 2px 10px; // 26px +@paddingMini: 1px 6px; // 24px + +@baseBorderRadius: 4px; +@borderRadiusLarge: 5px; +@borderRadiusSmall: 3px; + + // Tables // ------------------------- @tableBackground: transparent; // overall background-color @@ -94,7 +111,7 @@ // ------------------------- @inputBackground: @white; @inputBorder: #ccc; -@inputBorderRadius: 3px; +@inputBorderRadius: @baseBorderRadius; @inputDisabledBackground: @grayLighter; @formActionsBackground: #f5f5f5; @@ -131,17 +148,6 @@ @zindexModal: 1050; -// Component size variations -// ------------------------- -@fontSizeLarge: @baseFontSize * 1.25; // ~18px -@fontSizeSmall: @baseFontSize * 0.85; // ~12px -@fontSizeMini: @baseFontSize * 0.75; // ~11px - -@paddingLarge: 10px 19px; -@paddingSmall: 6px 10px; -@paddingMini: 5px 6px; - - // Sprite icons path // ------------------------- @iconSpritePath: "../img/glyphicons-halflings.png"; -- cgit v1.2.3 From 6c3cd6fd9d0c35d1d033dd97d22ec44cf74d0021 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 20 Sep 2012 09:06:43 -0700 Subject: fixes #5212: text emphasis classes only get hover with links --- less/type.less | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) (limited to 'less') diff --git a/less/type.less b/less/type.less index 78ccb8119..512ead99e 100644 --- a/less/type.less +++ b/less/type.less @@ -37,30 +37,17 @@ cite { .muted { color: @grayLight; } -.text-warning { - color: @warningText; - &:hover { - color: darken(@warningText, 10%); - } -} -.text-error { - color: @errorText; - &:hover { - color: darken(@errorText, 10%); - } -} -.text-info { - color: @infoText; - &:hover { - color: darken(@infoText, 10%); - } -} -.text-success { - color: @successText; - &:hover { - color: darken(@successText, 10%); - } -} +.text-warning { color: @warningText; } +a.text-warning:hover { color: darken(@warningText, 10%); } + +.text-error { color: @errorText; } +a.text-error:hover { color: darken(@errorText, 10%); } + +.text-info { color: @infoText; } +a.text-info:hover { color: darken(@infoText, 10%); } + +.text-success { color: @successText; } +a.text-success:hover { color: darken(@successText, 10%); } // Headings -- cgit v1.2.3 From 67585bd34e8e122c6a143c434c8dfdc7ba8de619 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 20 Sep 2012 09:07:48 -0700 Subject: fixes #5211 manually: spacing in mixins to match others --- less/mixins.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'less') diff --git a/less/mixins.less b/less/mixins.less index 4650d4790..7dd6670e2 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -324,7 +324,7 @@ } // Background sizing -.background-size(@size){ +.background-size(@size) { -webkit-background-size: @size; -moz-background-size: @size; -o-background-size: @size; @@ -446,7 +446,7 @@ background-repeat: no-repeat; filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback } - .radial(@innerColor: #555, @outerColor: #333) { + .radial(@innerColor: #555, @outerColor: #333) { background-color: @outerColor; background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor)); background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor); -- cgit v1.2.3 From 443c43f6c4bd98f1d35fffb59e0078b8b49791b4 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 20 Sep 2012 10:27:59 -0700 Subject: fixes #5102, #5166, #5194, #5205: add overflow: visible; to .nav-collapse.collapse so that dropdowns overflow correctly in the navbar in IE7-8 --- less/navbar.less | 1 + less/tests/navbar-fixed-top.html | 14 +++++++++++++- less/tests/navbar-static-top.html | 14 +++++++++++++- less/tests/navbar.html | 14 +++++++++++++- 4 files changed, 40 insertions(+), 3 deletions(-) (limited to 'less') diff --git a/less/navbar.less b/less/navbar.less index 33c90694e..58621b473 100644 --- a/less/navbar.less +++ b/less/navbar.less @@ -41,6 +41,7 @@ // Override the default collapsed state .nav-collapse.collapse { height: auto; + overflow: visible; } diff --git a/less/tests/navbar-fixed-top.html b/less/tests/navbar-fixed-top.html index d454b65f8..97b86fdef 100644 --- a/less/tests/navbar-fixed-top.html +++ b/less/tests/navbar-fixed-top.html @@ -42,11 +42,23 @@ Project name -