2014-11-13 14:27:45 +03:00
|
|
|
// ------------------------------------------------------------
|
|
|
|
// Splitbuttons
|
2014-08-04 20:28:07 +04:00
|
|
|
//
|
2014-11-13 14:27:45 +03:00
|
|
|
// Styles for splitbuttons (button + toggle for a popover)
|
|
|
|
//
|
|
|
|
// * Default
|
|
|
|
// * Base Placeholder Styles
|
|
|
|
// * Variation Classes
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Default
|
2014-08-04 20:28:07 +04:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
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
|
2014-11-13 14:27:45 +03:00
|
|
|
+ .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 {
|
2014-11-13 14:27:45 +03:00
|
|
|
z-index: 2;
|
2014-08-06 01:39:19 +04:00
|
|
|
}
|
|
|
|
}
|
2014-08-26 14:56:02 +04:00
|
|
|
|
2014-08-06 01:39:19 +04:00
|
|
|
// Flatten out the right side
|
|
|
|
.btn:first-child {
|
2014-11-13 14:27:45 +03:00
|
|
|
margin-left: 0;
|
|
|
|
|
|
|
|
&:not(:last-child):not(.dropdown-toggle) {
|
|
|
|
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;
|
|
|
|
}
|
2014-11-13 14:27:45 +03:00
|
|
|
|
2014-08-06 03:06:36 +04:00
|
|
|
&.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) {
|
2014-09-23 14:03:08 +04:00
|
|
|
top: 0;
|
|
|
|
display: inline-block;
|
|
|
|
position: relative;
|
2014-08-06 01:39:19 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-23 14:03:08 +04:00
|
|
|
&.up .options:before {
|
2014-08-26 14:56:02 +04:00
|
|
|
transform: rotate(-360deg);
|
2014-09-23 14:03:08 +04:00
|
|
|
transition: transform 0.6s ease, top 0.6s ease;
|
2014-08-06 01:39:19 +04:00
|
|
|
}
|
2014-11-13 14:27:45 +03:00
|
|
|
|
2014-08-06 01:39:19 +04:00
|
|
|
&.up:hover .options:before,
|
2014-09-23 14:03:08 +04:00
|
|
|
&.up.open .options:before {
|
|
|
|
top: -1px;
|
2014-11-13 14:27:45 +03:00
|
|
|
transform: rotate(540deg);
|
2014-09-23 14:03:08 +04:00
|
|
|
transition: transform 0.3s ease, top 0.3s ease;
|
2014-08-06 01:39:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2014-08-26 14:56:02 +04:00
|
|
|
|
2014-11-13 14:27:45 +03:00
|
|
|
}//.splitbtn
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Base Placeholder Styles
|
|
|
|
// --------------------------------------------------
|
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;
|
2014-11-13 14:27:45 +03:00
|
|
|
transition: background-color 0.3s linear;
|
2014-08-04 20:28:07 +04:00
|
|
|
|
|
|
|
@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;
|
|
|
|
transition-property: transform;
|
|
|
|
transition-duration: 0.3;
|
|
|
|
transition-timing-function: ease;
|
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
|
|
|
};
|
|
|
|
}
|
2014-11-13 14:27:45 +03:00
|
|
|
}//.options
|
|
|
|
}//%splitbtn
|
2014-08-04 20:28:07 +04:00
|
|
|
|
|
|
|
|
|
|
|
//
|
2014-11-13 14:27:45 +03:00
|
|
|
// Variation Classes
|
2014-08-04 20:28:07 +04:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
// The default splitbutton
|
|
|
|
.splitbutton {
|
|
|
|
@extend %splitbtn;
|
2014-11-13 14:27:45 +03:00
|
|
|
|
2014-08-04 20:28:07 +04:00
|
|
|
.options {
|
|
|
|
color:#777;
|
2014-11-13 14:27:45 +03:00
|
|
|
|
2014-08-04 20:28:07 +04:00
|
|
|
&: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;
|
2014-11-13 14:27:45 +03:00
|
|
|
|
2014-08-04 20:28:07 +04:00
|
|
|
.options {
|
|
|
|
background: darken($blue, 5%);
|
2014-11-13 14:27:45 +03:00
|
|
|
|
2014-08-04 20:28:07 +04:00
|
|
|
&:hover,
|
|
|
|
&.active,
|
|
|
|
&:focus {
|
|
|
|
background: darken($blue, 10%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// For actions which add something
|
|
|
|
.splitbutton-add {
|
|
|
|
@extend %splitbtn;
|
2014-11-13 14:27:45 +03:00
|
|
|
|
2014-08-04 20:28:07 +04:00
|
|
|
.options {
|
|
|
|
background: darken($green, 6%);
|
2014-11-13 14:27:45 +03:00
|
|
|
|
2014-08-04 20:28:07 +04:00
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
background: darken($green, 8%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// For actions which delete something
|
|
|
|
.splitbutton-delete {
|
|
|
|
@extend %splitbtn;
|
2014-11-13 14:27:45 +03:00
|
|
|
|
2014-08-04 20:28:07 +04:00
|
|
|
.options {
|
|
|
|
background: darken($red, 6%);
|
2014-11-13 14:27:45 +03:00
|
|
|
|
2014-08-04 20:28:07 +04:00
|
|
|
&: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;
|
2014-11-13 14:27:45 +03:00
|
|
|
|
2014-08-04 20:28:07 +04:00
|
|
|
.options {
|
|
|
|
background: lighten($darkgrey, 4%);
|
2014-11-13 14:27:45 +03:00
|
|
|
|
2014-08-04 20:28:07 +04:00
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
background: $darkgrey;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|