aboutsummaryrefslogtreecommitdiff
path: root/less
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2012-01-27 16:35:32 -0800
committerMark Otto <[email protected]>2012-01-27 16:35:32 -0800
commitd9759abeebbca0681054f8da3ff7c3029948284e (patch)
treec78f1198898b07fdc8911a3d3310dd2e5f5ed355 /less
parentf6dc566963c63d5113e72f0098ad9da2c414f33f (diff)
parent84b9a1bfb6ff5d1406f5c0393d6556caff6de40c (diff)
downloadbootstrap-d9759abeebbca0681054f8da3ff7c3029948284e.tar.xz
bootstrap-d9759abeebbca0681054f8da3ff7c3029948284e.zip
Merge branch 'ie_7_components' of https://github.com/phopkins/bootstrap into phopkins-ie_7_components
Conflicts: docs/assets/css/bootstrap.css
Diffstat (limited to 'less')
-rw-r--r--less/button-groups.less31
-rw-r--r--less/buttons.less50
-rw-r--r--less/dropdowns.less21
-rw-r--r--less/forms.less1
-rw-r--r--less/mixins.less45
-rw-r--r--less/navbar.less2
-rw-r--r--less/navs.less2
-rw-r--r--less/sprites.less2
8 files changed, 107 insertions, 47 deletions
diff --git a/less/button-groups.less b/less/button-groups.less
index 5fb0a8e97..a058f0344 100644
--- a/less/button-groups.less
+++ b/less/button-groups.less
@@ -6,6 +6,7 @@
.btn-group {
position: relative;
.clearfix(); // clears the floated buttons
+ .ie7-restore-left-whitespace;
}
// Space out series of button groups
@@ -17,6 +18,7 @@
.btn-toolbar {
.btn-group {
display: inline-block;
+ .ie7-inline-block;
}
}
@@ -83,18 +85,27 @@
padding-right: 8px;
@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(@shadow);
+ *padding-top: 5px;
+ *padding-bottom: 5px;
}
-// Reposition menu on open and round all corners
-.btn-group.open .dropdown-menu {
- display: block;
- margin-top: 1px;
- .border-radius(5px);
-}
-.btn-group.open .dropdown-toggle {
- background-image: none;
- @shadow: inset 0 1px 6px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
- .box-shadow(@shadow);
+.btn-group.open {
+ // IE7's z-index only goes to the nearest positioned ancestor, which would
+ // make the menu appear below buttons that appeared later on the page
+ *z-index: @zindexDropdown;
+
+ // Reposition menu on open and round all corners
+ .dropdown-menu {
+ display: block;
+ margin-top: 1px;
+ .border-radius(5px);
+ }
+
+ .dropdown-toggle {
+ background-image: none;
+ @shadow: inset 0 1px 6px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
+ .box-shadow(@shadow);
+ }
}
// Reposition the caret
diff --git a/less/buttons.less b/less/buttons.less
index 08620a3c3..75fe48f8a 100644
--- a/less/buttons.less
+++ b/less/buttons.less
@@ -35,31 +35,6 @@
}
}
-
-// Mixin for generating button backgrounds
-// ---------------------------------------
-.buttonBackground(@startColor, @endColor) {
- // gradientBar will set the background to a pleasing blend of these, to support IE<=9
- .gradientBar(@startColor, @endColor);
-
- // in these cases the gradient won't cover the background, so we override
- &:hover, &:active, &.active, &.disabled {
- background-color: @endColor;
- }
-
- // called out separately because IE8 would ignore otherwise
- &[disabled] {
- background-color: @endColor;
- }
-
- // IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
- &:active,
- &.active {
- background-color: darken(@endColor, 10%) e("\9");
- }
-}
-
-
// Base styles
// -----------
@@ -67,13 +42,6 @@
// Button Base
display: inline-block;
padding: 4px 10px 4px;
- *padding: 2px 10px;
- // IE7 likes to collapse the whitespace before the button, so bring it back...
- *margin-left: 4px;
- &:first-child {
- // ...but not before the first button
- *margin-left: 0;
- }
font-size: @baseFontSize;
line-height: @baseLineHeight;
color: @grayDark;
@@ -87,6 +55,8 @@
.box-shadow(@shadow);
cursor: pointer;
+ .ie7-restore-left-whitespace;
+
&:hover {
color: @grayDark;
text-decoration: none;
@@ -131,7 +101,7 @@
// Button Sizes
&.large {
- padding: 9px 14px 9px;
+ padding: 9px 14px;
font-size: @baseFontSize + 2px;
line-height: normal;
.border-radius(5px);
@@ -140,7 +110,7 @@
margin-top: 1px;
}
&.small {
- padding: 5px 9px 5px;
+ padding: 5px 9px;
font-size: @baseFontSize - 2px;
line-height: @baseLineHeight - 2px;
}
@@ -156,4 +126,16 @@ input[type=submit].btn {
padding: 0;
border: 0;
}
+
+ // IE7 has some default padding on button controls
+ *padding-top: 2px;
+ *padding-bottom: 2px;
+ &.large {
+ *padding-top: 7px;
+ *padding-bottom: 7px;
+ }
+ &.small {
+ *padding-top: 3px;
+ *padding-bottom: 3px;
+ }
}
diff --git a/less/dropdowns.less b/less/dropdowns.less
index 06114b254..e73b056e9 100644
--- a/less/dropdowns.less
+++ b/less/dropdowns.less
@@ -5,12 +5,19 @@
.dropdown {
position: relative;
}
+.dropdown .dropdown-toggle {
+ // The caret makes the toggle a bit too tall in IE7
+ *margin-bottom: -3px;
+}
// Dropdown arrow/caret
.caret {
display: inline-block;
width: 0;
height: 0;
text-indent: -99999px;
+ // IE7 won't do the border trick if there's a text indent, but it doesn't
+ // do the content that text-indent is hiding, either, so we're ok.
+ *text-indent: 0;
vertical-align: top;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
@@ -21,7 +28,6 @@
.dropdown .caret {
margin-top: 8px;
margin-left: 2px;
- *margin-top: 7px;
}
.dropdown:hover .caret,
.open.dropdown .caret {
@@ -31,6 +37,7 @@
.dropdown-menu {
position: absolute;
top: 100%;
+ left: 0;
z-index: @zindexDropdown;
float: left;
display: none; // none by default, but block on "open" of the menu
@@ -50,7 +57,6 @@
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
- zoom: 1; // do we need this?
*border-right-width: 2px;
*border-bottom-width: 2px;
@@ -68,6 +74,13 @@
overflow: hidden;
background-color: #e5e5e5;
border-bottom: 1px solid @white;
+
+ // IE7 needs a set width since we gave a height. Restricting just
+ // to IE7 to keep the 1px left/right space in other browsers.
+ // It is unclear where IE is getting the extra space that we need
+ // to negative-margin away, but so it goes.
+ *width: 100%;
+ *margin: -5px 0 5px;
}
// Links within the dropdown menu
@@ -93,6 +106,10 @@
// Open state for the dropdown
.dropdown.open {
+ // IE7's z-index only goes to the nearest positioned ancestor, which would
+ // make the menu appear below buttons that appeared later on the page
+ *z-index: @zindexDropdown;
+
.dropdown-toggle {
color: @white;
background: #ccc;
diff --git a/less/forms.less b/less/forms.less
index 55a646368..52f5063f0 100644
--- a/less/forms.less
+++ b/less/forms.less
@@ -377,6 +377,7 @@ select:focus:required:invalid {
.help-inline {
display: inline-block;
+ .ie7-inline-block;
margin-bottom: 9px;
vertical-align: middle;
padding-left: 5px;
diff --git a/less/mixins.less b/less/mixins.less
index dd331ebf2..bbbba1e02 100644
--- a/less/mixins.less
+++ b/less/mixins.less
@@ -36,6 +36,28 @@
*zoom: 1;
}
+// IE7 likes to collapse whitespace on either side of the inline-block elements.
+// Ems because we're attempting to match the width of a space character. Left
+// version is for form buttons, which typically come after other elements, and
+// right version is for icons, which come before. Applying both is ok, but it will
+// mean that space between those elements will be .6em (~2 space characters) in IE7,
+// instead of the 1 space in other browsers.
+.ie7-restore-left-whitespace() {
+ *margin-left: .3em;
+
+ &:first-child {
+ *margin-left: 0;
+ }
+}
+
+.ie7-restore-right-whitespace() {
+ *margin-right: .3em;
+
+ &:last-child {
+ *margin-left: 0;
+ }
+}
+
// Sizing shortcuts
// -------------------------
.size(@height: 5px, @width: 5px) {
@@ -317,6 +339,29 @@
}
+// Mixin for generating button backgrounds
+// ---------------------------------------
+.buttonBackground(@startColor, @endColor) {
+ // gradientBar will set the background to a pleasing blend of these, to support IE<=9
+ .gradientBar(@startColor, @endColor);
+
+ // in these cases the gradient won't cover the background, so we override
+ &:hover, &:active, &.active, &.disabled {
+ background-color: @endColor;
+ }
+
+ // called out separately because IE8 would ignore otherwise
+ &[disabled] {
+ background-color: @endColor;
+ }
+
+ // IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
+ &:active,
+ &.active {
+ background-color: darken(@endColor, 10%) e("\9");
+ }
+}
+
// COMPONENT MIXINS
// --------------------------------------------------
diff --git a/less/navbar.less b/less/navbar.less
index 07e2bed8b..7291ecceb 100644
--- a/less/navbar.less
+++ b/less/navbar.less
@@ -76,7 +76,7 @@
#font > .sans-serif(13px, normal, 1);
color: @white;
color: rgba(255,255,255,.75);
- background: #444;
+ background: #6a6a6a;
background: rgba(255,255,255,.3);
border: 1px solid #111;
@shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15);
diff --git a/less/navs.less b/less/navs.less
index cd356d9bb..f1d5b565c 100644
--- a/less/navs.less
+++ b/less/navs.less
@@ -317,6 +317,7 @@
.tabs-left .tabs .active > a,
.tabs-left .tabs .active > a:hover {
border-color: #ddd transparent #ddd #ddd;
+ *border-right-color: @white;
}
// Tabs on the right
@@ -335,4 +336,5 @@
.tabs-right .tabs .active > a,
.tabs-right .tabs .active > a:hover {
border-color: #ddd #ddd #ddd transparent;
+ *border-left-color: @white;
}
diff --git a/less/sprites.less b/less/sprites.less
index c7cdc1710..ed456de1a 100644
--- a/less/sprites.less
+++ b/less/sprites.less
@@ -21,6 +21,8 @@
vertical-align: text-top;
width: 14px;
height: 14px;
+
+ .ie7-restore-right-whitespace;
}
.icon.white {
background-image: url(../img/glyphicons-halflings-white.png);