2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-08 17:22:31 +03:00

flatten buttons and forms

This commit is contained in:
Mark Otto
2012-12-21 00:50:28 -08:00
parent 7c04d573d0
commit c11f41ba04
7 changed files with 74 additions and 238 deletions
+13 -29
View File
@@ -7,24 +7,23 @@
.btn-group {
position: relative;
display: 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)
}
// Space out series of button groups
.btn-group + .btn-group {
margin-left: 5px;
> .btn {
float: left;
}
}
// Optional: Group multiple button groups together for a toolbar
.btn-toolbar {
font-size: 0; // Hack to remove whitespace that results from using inline-block
margin-top: @line-height-base / 2;
margin-bottom: @line-height-base / 2;
.clearfix();
.btn-group {
float: left;
}
// Space out series of button groups
> .btn + .btn,
> .btn-group + .btn,
> .btn + .btn-group {
> .btn + .btn-group,
> .btn-group + .btn-group {
margin-left: 5px;
}
}
@@ -35,12 +34,7 @@
border-radius: 0;
}
.btn-group > .btn + .btn {
margin-left: -1px;
}
.btn-group > .btn,
.btn-group > .dropdown-menu,
.btn-group > .popover {
font-size: @font-size-base; // redeclare as part 2 of font-size inline-block hack
margin-left: 1px;
}
// Reset fonts for other sizes
@@ -78,14 +72,6 @@
border-bottom-right-radius: @border-radius-large;
}
// On hover/focus/active, bring the proper btn to front
.btn-group > .btn:hover,
.btn-group > .btn:focus,
.btn-group > .btn:active,
.btn-group > .btn.active {
z-index: 2;
}
// On active and open, don't show outline
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
@@ -101,7 +87,6 @@
.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)");
}
.btn-group > .btn-mini + .dropdown-toggle {
padding-left: 5px;
@@ -118,7 +103,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));
}
// Keep the hover's background when dropdown is open
@@ -184,7 +169,6 @@
// ----------------------
.btn-group-vertical {
display: inline-block; // Make buttons only take up the width they need
}
.btn-group-vertical > .btn {
display: block;
@@ -194,7 +178,7 @@
}
.btn-group-vertical > .btn + .btn {
margin-left: 0;
margin-top: -1px;
margin-top: 1px;
}
.btn-group-vertical .btn:first-child {
border-radius: @border-radius-base @border-radius-base 0 0;