Browse Source

#2334, Re-organize attached code, fix attached button groups

pull/2347/head
jlukic 9 years ago
parent
commit
406a95cfc7
2 changed files with 95 additions and 84 deletions
  1. 166
      src/definitions/elements/button.less
  2. 13
      src/themes/default/elements/button.variables

166
src/definitions/elements/button.less

@ -229,9 +229,9 @@
.ui.animated.button { .ui.animated.button {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
vertical-align: @animatedVerticalAlign;
padding-right: 0em !important; padding-right: 0em !important;
z-index: 1;
vertical-align: @animatedVerticalAlign;
z-index: @animatedZIndex;
} }
.ui.animated.button .content { .ui.animated.button .content {
@ -878,39 +878,6 @@
} }
/*--------------
Attached
---------------*/
.ui.attached.button {
display: block;
margin: 0em;
box-shadow: @attachedBoxShadow !important;
border-radius: 0em;
}
.ui.attached.top.button {
border-radius: @borderRadius @borderRadius 0em 0em;
}
.ui.attached.bottom.button {
border-radius: 0em 0em @borderRadius @borderRadius;
}
.ui.attached.left.button {
display: inline-block;
border-left: none;
padding-right: @attachedHorizontalPadding;
text-align: right;
border-radius: @borderRadius 0em 0em @borderRadius;
}
.ui.attached.right.button {
display: inline-block;
padding-left: @attachedHorizontalPadding;
text-align: left;
border-radius: 0em @borderRadius @borderRadius 0em;
}
/*------------------- /*-------------------
Or Buttons Or Buttons
--------------------*/ --------------------*/
@ -919,7 +886,7 @@
position: relative; position: relative;
width: @orGap; width: @orGap;
height: @orHeight; height: @orHeight;
z-index: 3;
z-index: @orZIndex;
} }
.ui.buttons .or:before { .ui.buttons .or:before {
position: absolute; position: absolute;
@ -963,76 +930,118 @@
Attached Attached
--------------------*/ --------------------*/
/* Plural Attached */
.attached.ui.buttons {
margin: 0px;
border-radius: 0em 0em 0em 0em;
/* Singular */
.ui.attached.button {
position: relative;
display: block;
margin: 0em;
border-radius: 0em;
box-shadow: @attachedBoxShadow !important;
} }
.attached.ui.buttons .button {
/* Top / Bottom */
.ui.attached.top.button {
border-radius: @borderRadius @borderRadius 0em 0em;
}
.ui.attached.bottom.button {
border-radius: 0em 0em @borderRadius @borderRadius;
}
/* Left / Right */
.ui.left.attached.button {
display: inline-block;
border-left: none;
text-align: right;
padding-right: @attachedHorizontalPadding;
border-radius: @borderRadius 0em 0em @borderRadius;
}
.ui.right.attached.button {
display: inline-block;
text-align: left;
padding-left: @attachedHorizontalPadding;
border-radius: 0em @borderRadius @borderRadius 0em;
}
/* Plural */
.ui.attached.buttons {
position: relative;
display: flex;
border-radius: 0em;
width: auto !important;
z-index: @attachedZIndex;
margin-left: @attachedOffset;
margin-right: @attachedOffset;
}
.ui.attached.buttons .button {
margin: 0em; margin: 0em;
} }
.attached.ui.buttons .button:first-child {
border-radius: 0em 0em 0em 0em;
.ui.attached.buttons .button:first-child {
border-radius: 0em;
} }
.attached.ui.buttons .button:last-child {
border-radius: 0em 0em 0em 0em;
.ui.attached.buttons .button:last-child {
border-radius: 0em;
} }
/* Top Side */
[class*="top attached"].ui.buttons {
/* Top / Bottom */
.ui[class*="top attached"].buttons {
margin-bottom: @attachedOffset; margin-bottom: @attachedOffset;
border-radius: @borderRadius @borderRadius 0em 0em; border-radius: @borderRadius @borderRadius 0em 0em;
} }
[class*="top attached"].ui.buttons .button:first-child {
.ui[class*="top attached"].buttons .button:first-child {
border-radius: @borderRadius 0em 0em 0em; border-radius: @borderRadius 0em 0em 0em;
} }
[class*="top attached"].ui.buttons .button:last-child {
.ui[class*="top attached"].buttons .button:last-child {
border-radius: 0em @borderRadius 0em 0em; border-radius: 0em @borderRadius 0em 0em;
} }
/* Bottom Side */
[class*="bottom attached"].ui.buttons {
.ui[class*="bottom attached"].buttons {
margin-top: @attachedOffset; margin-top: @attachedOffset;
border-radius: 0em 0em @borderRadius @borderRadius; border-radius: 0em 0em @borderRadius @borderRadius;
} }
[class*="bottom attached"].ui.buttons .button:first-child {
.ui[class*="bottom attached"].buttons .button:first-child {
border-radius: 0em 0em 0em @borderRadius; border-radius: 0em 0em 0em @borderRadius;
} }
[class*="bottom attached"].ui.buttons .button:last-child {
.ui[class*="bottom attached"].buttons .button:last-child {
border-radius: 0em 0em @borderRadius 0em; border-radius: 0em 0em @borderRadius 0em;
} }
/* Left Side */
[class*="left attached"].ui.buttons {
/* Left / Right */
.ui[class*="left attached"].buttons {
display: inline-flex;
margin-right: 0em;
margin-left: @attachedOffset; margin-left: @attachedOffset;
border-radius: 0em @borderRadius @borderRadius 0em; border-radius: 0em @borderRadius @borderRadius 0em;
} }
[class*="left attached"].ui.buttons .button:first-child {
.ui[class*="left attached"].buttons .button:first-child {
margin-left: @attachedOffset; margin-left: @attachedOffset;
border-radius: 0em @borderRadius 0em 0em; border-radius: 0em @borderRadius 0em 0em;
} }
[class*="left attached"].ui.buttons .button:last-child {
.ui[class*="left attached"].buttons .button:last-child {
margin-left: @attachedOffset; margin-left: @attachedOffset;
border-radius: 0em 0em @borderRadius 0em; border-radius: 0em 0em @borderRadius 0em;
} }
/* Right Side */
[class*="right attached"].ui.buttons,
[class*="right attached"].ui.buttons .button {
.ui[class*="right attached"].buttons {
display: inline-flex;
margin-left: 0em;
margin-right: @attachedOffset; margin-right: @attachedOffset;
border-radius: @borderRadius 0em 0em @borderRadius; border-radius: @borderRadius 0em 0em @borderRadius;
} }
[class*="right attached"].ui.buttons .button:first-child {
.ui[class*="right attached"].buttons .button:first-child {
margin-left: @attachedOffset; margin-left: @attachedOffset;
border-radius: @borderRadius 0em 0em 0em; border-radius: @borderRadius 0em 0em 0em;
} }
[class*="right attached"].ui.buttons .button:last-child {
.ui[class*="right attached"].buttons .button:last-child {
margin-left: @attachedOffset; margin-left: @attachedOffset;
border-radius: 0em 0em 0em @borderRadius; border-radius: 0em 0em 0em @borderRadius;
} }
/*-------------------
Fluid
--------------------*/
/* Fluid */
.ui.fluid.buttons, .ui.fluid.buttons,
.ui.button.fluid { .ui.button.fluid {
display: flex; display: flex;
@ -1143,7 +1152,7 @@
/* Fluid Vertical Buttons */ /* Fluid Vertical Buttons */
.ui.fluid.vertical.buttons, .ui.fluid.vertical.buttons,
.ui.fluid.vertical.buttons > .button { .ui.fluid.vertical.buttons > .button {
display: block;
display: flex;
width: auto; width: auto;
} }
@ -3171,6 +3180,11 @@
.ui.buttons > .active.button { .ui.buttons > .active.button {
position: relative; position: relative;
} }
.ui.buttons:not(.basic):not(.inverted) {
box-shadow: @groupBoxShadow;
}
/* Clearfix */
.ui.buttons:after { .ui.buttons:after {
content: "."; content: ".";
display: block; display: block;
@ -3178,26 +3192,21 @@
clear: both; clear: both;
visibility: hidden; visibility: hidden;
} }
.ui.buttons .button:first-child {
border-left: none;
}
.ui.buttons:not(.basic):not(.inverted) {
box-shadow: @groupBoxShadow;
}
.ui.buttons > .ui.button:not(.basic):not(.inverted),
.ui.buttons:not(.basic):not(.inverted) > .button {
box-shadow: @groupButtonBoxShadow;
}
/* Standard Group */
.ui.buttons .button { .ui.buttons .button {
flex: 1 0 auto;
margin: 0em; margin: 0em;
border-radius: 0em; border-radius: 0em;
margin: @groupButtonOffset; margin: @groupButtonOffset;
} }
.ui.buttons > .ui.button:not(.basic):not(.inverted),
.ui.buttons:not(.basic):not(.inverted) > .button {
box-shadow: @groupButtonBoxShadow;
}
.ui.buttons .button:first-child {
.ui.buttons .button:first-child {
border-left: none;
margin-left: 0em; margin-left: 0em;
border-top-left-radius: @borderRadius; border-top-left-radius: @borderRadius;
border-bottom-left-radius: @borderRadius; border-bottom-left-radius: @borderRadius;
@ -3207,7 +3216,6 @@
border-bottom-right-radius: @borderRadius; border-bottom-right-radius: @borderRadius;
} }
/* Vertical Style */ /* Vertical Style */
.ui.vertical.buttons { .ui.vertical.buttons {
display: inline-flex; display: inline-flex;

13
src/themes/default/elements/button.variables

@ -10,7 +10,7 @@
@horizontalMargin: 0.25em; @horizontalMargin: 0.25em;
/* Style */ /* Style */
@backgroundColor: #E0E2E4;
@backgroundColor: #E0E1E2;
@backgroundImage: none; @backgroundImage: none;
@verticalPadding: 0.7857142em; @verticalPadding: 0.7857142em;
@horizontalPadding: 1.5em; @horizontalPadding: 1.5em;
@ -84,7 +84,7 @@
--------------------*/ --------------------*/
/* Hovered */ /* Hovered */
@hoverBackgroundColor: #CACCCE;
@hoverBackgroundColor: #CACBCD;
@hoverBackgroundImage: @backgroundImage; @hoverBackgroundImage: @backgroundImage;
@hoverBoxShadow: @boxShadow; @hoverBoxShadow: @boxShadow;
@hoverColor: @hoveredTextColor; @hoverColor: @hoveredTextColor;
@ -98,7 +98,7 @@
@iconFocusOpacity: 0.85; @iconFocusOpacity: 0.85;
/* Pressed Down */ /* Pressed Down */
@downBackgroundColor: #BABCBE;
@downBackgroundColor: #BABBBC;
@downBackgroundImage: ''; @downBackgroundImage: '';
@downPressedShadow: none; @downPressedShadow: none;
@downBoxShadow: @downBoxShadow:
@ -108,13 +108,13 @@
@downColor: @pressedTextColor; @downColor: @pressedTextColor;
/* Active */ /* Active */
@activeBackgroundColor: #C0C0C0;
@activeBackgroundColor: #C0C1C2;
@activeBackgroundImage: none; @activeBackgroundImage: none;
@activeColor: @selectedTextColor; @activeColor: @selectedTextColor;
@activeBoxShadow: @borderBoxShadow; @activeBoxShadow: @borderBoxShadow;
/* Active + Hovered */ /* Active + Hovered */
@activeHoverBackgroundColor: #C0C0C0;
@activeHoverBackgroundColor: @activeBackgroundColor;
@activeHoverBackgroundImage: none; @activeHoverBackgroundImage: none;
@activeHoverColor: @activeColor; @activeHoverColor: @activeColor;
@activeHoverBoxShadow: @activeBoxShadow; @activeHoverBoxShadow: @activeBoxShadow;
@ -136,6 +136,7 @@
@orGap: 0.3em; @orGap: 0.3em;
@orHeight: (@verticalPadding * 2) + 1em; @orHeight: (@verticalPadding * 2) + 1em;
@orZIndex: 3;
@orCircleDistanceToEdge: (@verticalPadding); @orCircleDistanceToEdge: (@verticalPadding);
@orCircleSize: @orHeight - @orCircleDistanceToEdge; @orCircleSize: @orHeight - @orCircleDistanceToEdge;
@ -318,12 +319,14 @@
@attachedOffset: -1px; @attachedOffset: -1px;
@attachedBoxShadow: 0px 0px 0px 1px @borderColor; @attachedBoxShadow: 0px 0px 0px 1px @borderColor;
@attachedHorizontalPadding: 0.75em; @attachedHorizontalPadding: 0.75em;
@attachedZIndex: 2;
/* Floated */ /* Floated */
@floatedMargin: 0.25em; @floatedMargin: 0.25em;
/* Animated */ /* Animated */
@animatedVerticalAlign: middle; @animatedVerticalAlign: middle;
@animatedZIndex: 1;
@animationDuration: 0.3s; @animationDuration: 0.3s;
@animationEasing: ease; @animationEasing: ease;
@fadeScaleHigh: 1.5; @fadeScaleHigh: 1.5;

Loading…
Cancel
Save