buttons
This commit is contained in:
parent
cde958a5a7
commit
a2fd8087a6
|
@ -3,99 +3,89 @@
|
|||
========================================
|
||||
*/
|
||||
|
||||
/* Make the div behave like a button */
|
||||
/* Make the div behave like a button container */
|
||||
.btn-group {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
font-size: 0;
|
||||
/* remove as part 1 of font-size inline-block hack */
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
/* match .btn alignment given font-size hack above */
|
||||
white-space: nowrap;
|
||||
/* prevent buttons from wrapping when in tight spaces */
|
||||
}
|
||||
|
||||
/* Space out series of button groups */
|
||||
.btn-group+.btn-group {
|
||||
.btn-group + .btn-group {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
/* Optional: Group multiple button groups together for a toolbar */
|
||||
.btn-toolbar {
|
||||
font-size: 0;
|
||||
/* Hack to remove whitespace that results from using inline-block */
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 5px;
|
||||
margin-top: calc(var(--base-line-height) / 2);
|
||||
margin-bottom: calc(var(--base-line-height) / 2);
|
||||
}
|
||||
|
||||
.btn-toolbar>.btn+.btn,
|
||||
.btn-toolbar>.btn-group+.btn,
|
||||
.btn-toolbar>.btn+.btn-group {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
/* Float them, remove border radius, then re-add to first and last elements */
|
||||
.btn-group>.btn {
|
||||
.btn-group > .btn {
|
||||
position: relative;
|
||||
border-radius: 0;
|
||||
flex: 0 1 auto;
|
||||
}
|
||||
|
||||
.btn-group>.btn+.btn {
|
||||
.btn-group > .btn + .btn {
|
||||
margin-left: -1px;
|
||||
}
|
||||
|
||||
.btn-group>.btn,
|
||||
.btn-group>.dropdown-menu,
|
||||
.btn-group>.popover {
|
||||
.btn-group > .btn,
|
||||
.btn-group > .dropdown-menu,
|
||||
.btn-group > .popover {
|
||||
font-size: var(--base-font-size);
|
||||
/* redeclare as part 2 of font-size inline-block hack */
|
||||
}
|
||||
|
||||
/* Reset fonts for other sizes */
|
||||
.btn-group>.btn-mini {
|
||||
.btn-group > .btn-mini {
|
||||
font-size: var(--font-size-mini);
|
||||
}
|
||||
|
||||
.btn-group>.btn-small {
|
||||
.btn-group > .btn-small {
|
||||
font-size: var(--font-size-small);
|
||||
}
|
||||
|
||||
.btn-group>.btn-large {
|
||||
.btn-group > .btn-large {
|
||||
font-size: var(--font-size-large);
|
||||
}
|
||||
|
||||
/* Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match */
|
||||
.btn-group>.btn:first-child {
|
||||
.btn-group > .btn:first-child {
|
||||
margin-left: 0;
|
||||
border-top-left-radius: var(--base-border-radius);
|
||||
border-bottom-left-radius: var(--base-border-radius);
|
||||
}
|
||||
|
||||
/* Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it */
|
||||
.btn-group>.btn:last-child,
|
||||
.btn-group>.dropdown-toggle {
|
||||
.btn-group > .btn:last-child,
|
||||
.btn-group > .dropdown-toggle {
|
||||
border-top-right-radius: var(--base-border-radius);
|
||||
border-bottom-right-radius: var(--base-border-radius);
|
||||
}
|
||||
|
||||
/* Reset corners for large buttons */
|
||||
.btn-group>.btn.large:first-child {
|
||||
.btn-group > .btn.large:first-child {
|
||||
margin-left: 0;
|
||||
border-top-left-radius: var(--border-radius-large);
|
||||
border-bottom-left-radius: var(--border-radius-large);
|
||||
}
|
||||
|
||||
.btn-group>.btn.large:last-child,
|
||||
.btn-group>.large.dropdown-toggle {
|
||||
.btn-group > .btn.large:last-child,
|
||||
.btn-group > .large.dropdown-toggle {
|
||||
border-top-right-radius: var(--border-radius-large);
|
||||
border-bottom-right-radius: var(--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 {
|
||||
.btn-group > .btn:hover,
|
||||
.btn-group > .btn:focus,
|
||||
.btn-group > .btn:active,
|
||||
.btn-group > .btn.active {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
|
@ -106,18 +96,18 @@
|
|||
}
|
||||
|
||||
/* Split button dropdowns */
|
||||
.btn-group>.btn+.dropdown-toggle {
|
||||
.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 {
|
||||
.btn-group > .btn-mini + .dropdown-toggle {
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.btn-group>.btn-large+.dropdown-toggle {
|
||||
.btn-group > .btn-large + .dropdown-toggle {
|
||||
padding-left: 12px;
|
||||
padding-right: 12px;
|
||||
}
|
||||
|
@ -193,33 +183,33 @@
|
|||
|
||||
/* Vertical button groups */
|
||||
.btn-group-vertical {
|
||||
display: inline-block;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.btn-group-vertical>.btn {
|
||||
display: block;
|
||||
float: none;
|
||||
.btn-group-vertical > .btn {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.btn-group-vertical>.btn+.btn {
|
||||
.btn-group-vertical > .btn + .btn {
|
||||
margin-left: 0;
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.btn-group-vertical>.btn:first-child {
|
||||
.btn-group-vertical > .btn:first-child {
|
||||
border-radius: var(--base-border-radius) var(--base-border-radius) 0 0;
|
||||
}
|
||||
|
||||
.btn-group-vertical>.btn:last-child {
|
||||
.btn-group-vertical > .btn:last-child {
|
||||
border-radius: 0 0 var(--base-border-radius) var(--base-border-radius);
|
||||
}
|
||||
|
||||
.btn-group-vertical>.btn-large:first-child {
|
||||
.btn-group-vertical > .btn-large:first-child {
|
||||
border-radius: var(--border-radius-large) var(--border-radius-large) 0 0;
|
||||
}
|
||||
|
||||
.btn-group-vertical>.btn-large:last-child {
|
||||
.btn-group-vertical > .btn-large:last-child {
|
||||
border-radius: 0 0 var(--border-radius-large) var(--border-radius-large);
|
||||
}
|
||||
|
|
|
@ -5,20 +5,19 @@
|
|||
|
||||
/* Core */
|
||||
.btn {
|
||||
display: inline-block;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 4px 12px;
|
||||
margin-bottom: 0;
|
||||
/* For input.btn */
|
||||
font-size: var(--base-font-size);
|
||||
line-height: var(--base-line-height);
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
background-color: var(--btn-background);
|
||||
background-image: linear-gradient(to bottom, var(--btn-background), var(--btn-background-highlight));
|
||||
border: 1px solid var(--btn-border);
|
||||
border-bottom-color: #b3b3b3;
|
||||
/* darken(--btn-border, 10%) */
|
||||
border-radius: var(--base-border-radius);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05);
|
||||
}
|
||||
|
@ -54,6 +53,7 @@
|
|||
background-image: none;
|
||||
opacity: 0.65;
|
||||
box-shadow: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Button Sizes */
|
||||
|
@ -94,7 +94,7 @@
|
|||
|
||||
/* Block button */
|
||||
.btn-block {
|
||||
display: block;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
|
@ -102,7 +102,7 @@
|
|||
}
|
||||
|
||||
/* Vertically space out multiple block buttons */
|
||||
.btn-block+.btn-block {
|
||||
.btn-block + .btn-block {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
|
@ -171,13 +171,6 @@ input[type="button"].btn-block {
|
|||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
/* Cross-browser Jank */
|
||||
button.btn::-moz-focus-inner,
|
||||
input[type="submit"].btn::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* Link buttons */
|
||||
.btn-link,
|
||||
.btn-link:active,
|
||||
|
|
Loading…
Reference in New Issue
Block a user