2014-08-04 20:28:07 +04:00
|
|
|
//
|
|
|
|
// Base Splitbutton
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
2014-08-06 01:39:19 +04:00
|
|
|
.splitbtn {
|
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
|
|
|
vertical-align: middle;
|
2014-08-26 14:56:02 +04:00
|
|
|
|
2014-08-06 01:39:19 +04:00
|
|
|
.btn {
|
|
|
|
position: relative;
|
|
|
|
float: left;
|
2014-08-26 14:56:02 +04:00
|
|
|
|
2014-08-06 01:39:19 +04:00
|
|
|
// Prevent double border between buttons
|
|
|
|
+ .btn { margin-left: -1px; }
|
2014-08-26 14:56:02 +04:00
|
|
|
|
2014-08-06 01:39:19 +04:00
|
|
|
// Make sure the hovered element is always on
|
|
|
|
// top so overlap from .btn + btn. invisible
|
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&:active,
|
|
|
|
&.active {
|
|
|
|
z-index: 2;
|
|
|
|
}
|
|
|
|
}
|
2014-08-26 14:56:02 +04:00
|
|
|
|
2014-08-06 01:39:19 +04:00
|
|
|
// Flatten out the right side
|
|
|
|
.btn:first-child {
|
|
|
|
margin-left: 0;
|
|
|
|
&:not(:last-child):not(.dropdown-toggle) {
|
2014-08-26 14:56:02 +04:00
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
2014-08-06 01:39:19 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Flatten out the left side
|
|
|
|
.dropdown-toggle {
|
|
|
|
padding-left: 12px;
|
|
|
|
padding-right: 12px;
|
2014-08-26 14:56:02 +04:00
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
2014-08-06 03:06:36 +04:00
|
|
|
|
|
|
|
&.btn-sm {
|
|
|
|
padding-left: 10px;
|
|
|
|
padding-right: 10px;
|
|
|
|
}
|
|
|
|
&.btn-lg {
|
|
|
|
padding-left: 16px;
|
|
|
|
padding-right: 16px;
|
|
|
|
}
|
2014-08-26 14:56:02 +04:00
|
|
|
|
2014-08-06 01:39:19 +04:00
|
|
|
|
|
|
|
// This is the additional dropdown arrow, to the right of the button.
|
|
|
|
.options {
|
|
|
|
text-align: center;
|
|
|
|
color: #fff;
|
|
|
|
|
|
|
|
@include icon($i-chevron-down, 9px) {
|
|
|
|
margin-top: -3px;
|
2014-08-26 14:56:02 +04:00
|
|
|
transition: margin-top 0.3s ease;
|
2014-08-06 01:39:19 +04:00
|
|
|
/* Transition of transform properties are split out due to a
|
|
|
|
defect in the vendor prefixing of transform transitions.
|
|
|
|
See: http://github.com/thoughtbot/bourbon/pull/86 */
|
2014-08-26 14:56:02 +04:00
|
|
|
transition-property: transform;
|
|
|
|
transition-duration: 0.3;
|
|
|
|
transition-timing-function: ease;
|
2014-08-06 01:39:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Keep the arrow spun when the associated menu is open
|
|
|
|
&.active .options:before {
|
2014-08-26 14:56:02 +04:00
|
|
|
transform: rotate(-360deg);
|
2014-08-06 01:39:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
&.up.active .options:before {
|
|
|
|
margin-top:-4px;
|
2014-08-26 14:56:02 +04:00
|
|
|
transform: rotate(540deg);
|
2014-08-06 01:39:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Spin the arrow on hover and while menu is open
|
|
|
|
&:hover .options:before,
|
|
|
|
&:focus .options:before {
|
|
|
|
will-change: transform;
|
2014-08-26 14:56:02 +04:00
|
|
|
transform: rotate(-360deg);
|
2014-08-06 01:39:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// If it has a class of "up" spin it an extra 180degress to point up
|
|
|
|
&.up:hover .options:before,
|
|
|
|
&.up:focus .options:before {
|
|
|
|
margin-top:-4px;
|
2014-08-26 14:56:02 +04:00
|
|
|
transform: rotate(540deg);
|
|
|
|
transition-property: transform;
|
|
|
|
transition-duration: 0.6;
|
|
|
|
transition-timing-function: ease;
|
2014-08-06 01:39:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2014-08-26 14:56:02 +04:00
|
|
|
|
2014-08-06 01:39:19 +04:00
|
|
|
}
|
|
|
|
|
2014-08-04 20:28:07 +04:00
|
|
|
%splitbtn {
|
|
|
|
display: inline-block;
|
|
|
|
position: relative;
|
|
|
|
font-size: 0; // hack to stop space after button
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
button {
|
|
|
|
font-size: 11px; // hack to restore font size
|
2014-08-26 14:56:02 +04:00
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
2014-08-04 20:28:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// This is the additional dropdown arrow, to the right of the button.
|
|
|
|
.options {
|
|
|
|
display: inline-block;
|
|
|
|
position:relative;
|
|
|
|
width: 35px;
|
|
|
|
height: 35px;
|
|
|
|
margin-left: -1px;
|
|
|
|
vertical-align: top;
|
|
|
|
text-align: center;
|
|
|
|
color: #fff;
|
|
|
|
background: #e5e5e5;
|
|
|
|
border-radius: 0 2px 2px 0;
|
|
|
|
border-left: 0;
|
|
|
|
box-shadow:
|
|
|
|
rgba(0,0,0,0.02) 0 1px 0 inset,
|
|
|
|
rgba(0,0,0,0.02) -1px 0 0 inset,
|
|
|
|
rgba(0,0,0,0.02) 0 -1px 0 inset;
|
|
|
|
|
|
|
|
@include icon($i-chevron-down, 9px) {
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
right: 50%;
|
|
|
|
margin-top: -3px;
|
|
|
|
margin-right: -5px;
|
2014-08-26 14:56:02 +04:00
|
|
|
transition: margin-top 0.3s ease;
|
2014-08-04 20:28:07 +04:00
|
|
|
/* Transition of transform properties are split out due to a
|
|
|
|
defect in the vendor prefixing of transform transitions.
|
|
|
|
See: http://github.com/thoughtbot/bourbon/pull/86 */
|
2014-08-26 14:56:02 +04:00
|
|
|
transition-property: transform;
|
|
|
|
transition-duration: 0.3;
|
|
|
|
transition-timing-function: ease;
|
2014-08-04 20:28:07 +04:00
|
|
|
};
|
|
|
|
|
2014-08-26 14:56:02 +04:00
|
|
|
transition: background-color 0.3s linear;
|
2014-08-04 20:28:07 +04:00
|
|
|
|
|
|
|
// Keep the arrow spun when the associated menu is open
|
|
|
|
&.active:before {
|
2014-08-26 14:56:02 +04:00
|
|
|
transform: rotate(360deg);
|
2014-08-04 20:28:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
&.up.active:before {
|
|
|
|
margin-top:-4px;
|
2014-08-26 14:56:02 +04:00
|
|
|
transform: rotate(540deg);
|
2014-08-04 20:28:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Spin the arrow on hover and while menu is open
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
will-change: box-shadow, background;
|
|
|
|
box-shadow: none;
|
|
|
|
background: #f8f8f8;
|
|
|
|
@include icon($i-chevron-down) {
|
|
|
|
will-change: transform;
|
2014-08-26 14:56:02 +04:00
|
|
|
transform: rotate(360deg);
|
2014-08-04 20:28:07 +04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// If it has a class of "up" spin it an extra 180degress to point up
|
|
|
|
&.up:hover,
|
|
|
|
&.up:focus {
|
|
|
|
@include icon($i-chevron-down) {
|
|
|
|
margin-top:-4px;
|
2014-08-26 14:56:02 +04:00
|
|
|
transform: rotate(540deg);
|
|
|
|
transition-property: transform;
|
|
|
|
transition-duration: 0.6;
|
|
|
|
transition-timing-function: ease;
|
2014-08-04 20:28:07 +04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// The Splitbuttons
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
// The default splitbutton
|
|
|
|
.splitbutton {
|
|
|
|
@extend %splitbtn;
|
|
|
|
.options {
|
|
|
|
color:#777;
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
box-shadow:
|
|
|
|
rgba(0,0,0,0.07) 0 1px 0 inset,
|
|
|
|
rgba(0,0,0,0.07) -1px 0 0 inset,
|
|
|
|
rgba(0,0,0,0.07) 0 -1px 0 inset;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// For save/next/continue/confirm actions
|
|
|
|
.splitbutton-save {
|
|
|
|
@extend %splitbtn;
|
|
|
|
.options {
|
|
|
|
background: darken($blue, 5%);
|
|
|
|
&:hover,
|
|
|
|
&.active,
|
|
|
|
&:focus {
|
|
|
|
background: darken($blue, 10%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// For actions which add something
|
|
|
|
.splitbutton-add {
|
|
|
|
@extend %splitbtn;
|
|
|
|
.options {
|
|
|
|
background: darken($green, 6%);
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
background: darken($green, 8%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// For actions which delete something
|
|
|
|
.splitbutton-delete {
|
|
|
|
@extend %splitbtn;
|
|
|
|
.options {
|
|
|
|
background: darken($red, 6%);
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
background: darken($red, 10%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-26 14:56:02 +04:00
|
|
|
// Alternative style with more visual attention,
|
2014-08-04 20:28:07 +04:00
|
|
|
// but no extra semantic meaning
|
|
|
|
.splitbutton-alt {
|
|
|
|
@extend %splitbtn;
|
|
|
|
.options {
|
|
|
|
background: lighten($darkgrey, 4%);
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
background: $darkgrey;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|