2020-03-05 12:17:50 +08:00
|
|
|
// mixins for button
|
|
|
|
// ------------------------
|
2020-03-08 15:12:21 +08:00
|
|
|
.button-size(@height; @padding-horizontal; @font-size; @border-radius) {
|
2020-03-16 12:37:25 +08:00
|
|
|
@padding-vertical: max(
|
2021-01-09 09:07:02 +08:00
|
|
|
(round(((@height - @font-size * @line-height-base) / 2) * 10) / 10) - @border-width-base,
|
2020-03-16 12:37:25 +08:00
|
|
|
0
|
|
|
|
);
|
2020-03-05 12:17:50 +08:00
|
|
|
height: @height;
|
2020-03-08 15:12:21 +08:00
|
|
|
padding: @padding-vertical @padding-horizontal;
|
2020-03-05 12:17:50 +08:00
|
|
|
font-size: @font-size;
|
|
|
|
border-radius: @border-radius;
|
|
|
|
}
|
|
|
|
|
|
|
|
.button-disabled(@color: @btn-disable-color; @background: @btn-disable-bg; @border: @btn-disable-border) {
|
|
|
|
&[disabled] {
|
|
|
|
&,
|
|
|
|
&:hover,
|
|
|
|
&:focus,
|
2020-06-21 23:15:22 +08:00
|
|
|
&:active {
|
2020-03-05 12:17:50 +08:00
|
|
|
.button-color(@color; @background; @border);
|
|
|
|
|
|
|
|
text-shadow: none;
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.button-variant-primary(@color; @background) {
|
|
|
|
.button-color(@color; @background; @background);
|
|
|
|
|
|
|
|
text-shadow: @btn-text-shadow;
|
|
|
|
box-shadow: @btn-primary-shadow;
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
2020-03-08 15:12:21 +08:00
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
@color; ~`colorPalette('@{background}', 7) `; ~`colorPalette('@{background}', 7) `
|
|
|
|
);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
@color; ~`colorPalette('@{background}', 5) `; ~`colorPalette('@{background}', 5) `
|
|
|
|
);
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
|
2020-06-21 23:15:22 +08:00
|
|
|
&:active {
|
2020-03-08 15:12:21 +08:00
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
@color; ~`colorPalette('@{background}', 5) `; ~`colorPalette('@{background}', 5) `
|
|
|
|
);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
@color; ~`colorPalette('@{background}', 7) `; ~`colorPalette('@{background}', 7) `
|
|
|
|
);
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.button-disabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
.button-variant-other(@color; @background; @border) {
|
|
|
|
.button-color(@color; @background; @border);
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
2020-03-08 15:12:21 +08:00
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(@primary-5; @background; @primary-5);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
~`colorPalette('@{btn-primary-bg}', 5) `; @background;
|
|
|
|
~`colorPalette('@{btn-primary-bg}', 5) `
|
|
|
|
);
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
2020-06-21 23:15:22 +08:00
|
|
|
&:active {
|
2020-03-08 15:12:21 +08:00
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(@primary-7; @background; @primary-7);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
~`colorPalette('@{btn-primary-bg}', 7) `; @background;
|
|
|
|
~`colorPalette('@{btn-primary-bg}', 7) `
|
|
|
|
);
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
.button-disabled();
|
|
|
|
}
|
|
|
|
.button-variant-ghost(@color; @border: @color) {
|
|
|
|
.button-color(@color; transparent; @border);
|
|
|
|
text-shadow: none;
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
& when (@border = transparent) {
|
2020-03-08 15:12:21 +08:00
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(~`colorPalette('@{color}', 7) `; transparent; transparent);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(~`colorPalette('@{color}', 5) `; transparent; transparent);
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
2020-03-08 15:12:21 +08:00
|
|
|
& when not (@border = transparent) {
|
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
~`colorPalette('@{color}', 7) `; transparent; ~`colorPalette('@{color}', 7) `
|
|
|
|
);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
~`colorPalette('@{color}', 5) `; transparent; ~`colorPalette('@{color}', 5) `
|
|
|
|
);
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
}
|
2020-06-21 23:15:22 +08:00
|
|
|
&:active {
|
2020-03-05 12:17:50 +08:00
|
|
|
& when (@border = transparent) {
|
2020-03-08 15:12:21 +08:00
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(~`colorPalette('@{color}', 5) `; transparent; transparent);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(~`colorPalette('@{color}', 7) `; transparent; transparent);
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
& when not(@border = transparent) {
|
2020-03-08 15:12:21 +08:00
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
~`colorPalette('@{color}', 5) `; transparent; ~`colorPalette('@{color}', 5) `
|
|
|
|
);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
~`colorPalette('@{color}', 7) `; transparent; ~`colorPalette('@{color}', 7) `
|
|
|
|
);
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
.button-disabled();
|
|
|
|
}
|
|
|
|
.button-color(@color; @background; @border) {
|
|
|
|
color: @color;
|
2020-05-31 16:00:40 +08:00
|
|
|
background: @background;
|
2020-03-08 15:12:21 +08:00
|
|
|
border-color: @border; // a inside Button which only work in Chrome
|
2020-03-05 12:17:50 +08:00
|
|
|
// http://stackoverflow.com/a/17253457
|
|
|
|
> a:only-child {
|
|
|
|
color: currentColor;
|
|
|
|
&::after {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
background: transparent;
|
|
|
|
content: '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.button-group-base(@btnClassName) {
|
|
|
|
position: relative;
|
2020-04-26 10:41:53 +08:00
|
|
|
display: inline-flex;
|
2020-03-05 12:17:50 +08:00
|
|
|
> .@{btnClassName},
|
|
|
|
> span > .@{btnClassName} {
|
|
|
|
position: relative;
|
|
|
|
&:hover,
|
|
|
|
&:focus,
|
2020-06-21 23:15:22 +08:00
|
|
|
&:active {
|
2020-03-05 12:17:50 +08:00
|
|
|
z-index: 2;
|
|
|
|
}
|
2020-06-21 23:15:22 +08:00
|
|
|
&[disabled] {
|
2020-03-05 12:17:50 +08:00
|
|
|
z-index: 0;
|
|
|
|
}
|
|
|
|
}
|
2020-04-26 10:41:53 +08:00
|
|
|
.@{btnClassName}-icon-only {
|
2020-03-05 12:17:50 +08:00
|
|
|
font-size: @font-size-base;
|
|
|
|
}
|
|
|
|
// size
|
|
|
|
&-lg > .@{btnClassName},
|
|
|
|
&-lg > span > .@{btnClassName} {
|
2020-03-08 15:12:21 +08:00
|
|
|
.button-size(@btn-height-lg; @btn-padding-horizontal-lg; @btn-font-size-lg; 0);
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
2020-04-26 10:41:53 +08:00
|
|
|
&-lg .@{btnClassName}.@{btnClassName}-icon-only {
|
2020-03-05 12:17:50 +08:00
|
|
|
.square(@btn-height-lg);
|
|
|
|
padding-right: 0;
|
|
|
|
padding-left: 0;
|
|
|
|
}
|
|
|
|
&-sm > .@{btnClassName},
|
|
|
|
&-sm > span > .@{btnClassName} {
|
2020-03-08 15:12:21 +08:00
|
|
|
.button-size(@btn-height-sm; @btn-padding-horizontal-sm; @font-size-base; 0);
|
2020-03-05 12:17:50 +08:00
|
|
|
> .@{iconfont-css-prefix} {
|
|
|
|
font-size: @font-size-base;
|
|
|
|
}
|
|
|
|
}
|
2020-04-26 10:41:53 +08:00
|
|
|
&-sm .@{btnClassName}.@{btnClassName}-icon-only {
|
2020-03-05 12:17:50 +08:00
|
|
|
.square(@btn-height-sm);
|
|
|
|
padding-right: 0;
|
|
|
|
padding-left: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Base styles of buttons
|
|
|
|
// --------------------------------------------------
|
|
|
|
.btn() {
|
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
|
|
|
font-weight: @btn-font-weight;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-align: center;
|
|
|
|
background-image: none;
|
|
|
|
border: @btn-border-width @btn-border-style transparent;
|
|
|
|
box-shadow: @btn-shadow;
|
|
|
|
cursor: pointer;
|
|
|
|
transition: all 0.3s @ease-in-out;
|
|
|
|
user-select: none;
|
|
|
|
touch-action: manipulation;
|
2020-03-08 15:12:21 +08:00
|
|
|
.button-size(
|
|
|
|
@btn-height-base; @btn-padding-horizontal-base; @font-size-base; @btn-border-radius-base
|
|
|
|
);
|
2020-03-05 12:17:50 +08:00
|
|
|
> .@{iconfont-css-prefix} {
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
&,
|
|
|
|
&:active,
|
|
|
|
&:focus {
|
|
|
|
outline: 0;
|
|
|
|
}
|
|
|
|
&:not([disabled]):hover {
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
&:not([disabled]):active {
|
|
|
|
outline: 0;
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
&[disabled] {
|
|
|
|
cursor: not-allowed;
|
|
|
|
> * {
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&-lg {
|
2020-03-08 15:12:21 +08:00
|
|
|
.button-size(
|
|
|
|
@btn-height-lg; @btn-padding-horizontal-lg; @btn-font-size-lg; @btn-border-radius-base
|
|
|
|
);
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
&-sm {
|
2020-03-08 15:12:21 +08:00
|
|
|
.button-size(
|
|
|
|
@btn-height-sm; @btn-padding-horizontal-sm; @btn-font-size-sm; @btn-border-radius-sm
|
|
|
|
);
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// primary button style
|
|
|
|
.btn-primary() {
|
|
|
|
.button-variant-primary(@btn-primary-color; @btn-primary-bg);
|
|
|
|
}
|
|
|
|
// default button style
|
|
|
|
.btn-default() {
|
|
|
|
.button-variant-other(@btn-default-color; @btn-default-bg; @btn-default-border);
|
|
|
|
&:hover,
|
|
|
|
&:focus,
|
2020-06-21 23:15:22 +08:00
|
|
|
&:active {
|
2020-03-05 12:17:50 +08:00
|
|
|
text-decoration: none;
|
|
|
|
background: @btn-default-bg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ghost button style
|
|
|
|
.btn-ghost() {
|
|
|
|
.button-variant-other(@btn-ghost-color, @btn-ghost-bg, @btn-ghost-border);
|
|
|
|
}
|
|
|
|
// dashed button style
|
|
|
|
.btn-dashed() {
|
|
|
|
.button-variant-other(@btn-default-color, @btn-default-bg, @btn-default-border);
|
|
|
|
border-style: dashed;
|
|
|
|
}
|
|
|
|
// danger button style
|
|
|
|
.btn-danger() {
|
|
|
|
.button-variant-primary(@btn-danger-color, @btn-danger-bg);
|
|
|
|
}
|
2020-03-08 15:12:21 +08:00
|
|
|
// danger default button style
|
|
|
|
.btn-danger-default() {
|
|
|
|
.button-color(@error-color, @btn-default-bg, @error-color);
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
~`colorPalette('@{error-color}', 7) `; @btn-default-bg; ~`colorPalette('@{error-color}', 7)
|
|
|
|
`
|
|
|
|
);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
~`colorPalette('@{error-color}', 5) `; @btn-default-bg; ~`colorPalette('@{error-color}', 5)
|
|
|
|
`
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2020-06-21 23:15:22 +08:00
|
|
|
&:active {
|
2020-03-08 15:12:21 +08:00
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
~`colorPalette('@{error-color}', 5) `; @btn-default-bg; ~`colorPalette('@{error-color}', 5)
|
|
|
|
`
|
|
|
|
);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(
|
|
|
|
~`colorPalette('@{error-color}', 7) `; @btn-default-bg; ~`colorPalette('@{error-color}', 7)
|
|
|
|
`
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.button-disabled();
|
|
|
|
}
|
|
|
|
// danger link button style
|
|
|
|
.btn-danger-link() {
|
|
|
|
.button-variant-other(@error-color, transparent, transparent);
|
|
|
|
box-shadow: none;
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(~`colorPalette('@{error-color}', 7) `; transparent; transparent);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(~`colorPalette('@{error-color}', 5) `; transparent; transparent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&:active {
|
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(~`colorPalette('@{error-color}', 5) `; transparent; transparent);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(~`colorPalette('@{error-color}', 7) `; transparent; transparent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.button-disabled(@disabled-color; transparent; transparent);
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
// link button style
|
|
|
|
.btn-link() {
|
|
|
|
.button-variant-other(@link-color, transparent, transparent);
|
|
|
|
box-shadow: none;
|
2020-05-31 16:00:40 +08:00
|
|
|
&:hover {
|
|
|
|
background: @btn-link-hover-bg;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&:active {
|
|
|
|
border-color: transparent;
|
|
|
|
}
|
|
|
|
.button-disabled(@disabled-color; transparent; transparent);
|
|
|
|
}
|
2020-06-21 23:15:22 +08:00
|
|
|
// text button style
|
2020-05-31 16:00:40 +08:00
|
|
|
.btn-text() {
|
|
|
|
.button-variant-other(@text-color, transparent, transparent);
|
|
|
|
box-shadow: none;
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
color: @text-color;
|
|
|
|
background: @btn-text-hover-bg;
|
|
|
|
border-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
color: @text-color;
|
|
|
|
background: fadein(@btn-text-hover-bg, 1%);
|
|
|
|
border-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.button-disabled(@disabled-color; transparent; transparent);
|
|
|
|
}
|
2020-06-02 19:17:27 +08:00
|
|
|
.btn-danger-text() {
|
|
|
|
.button-variant-other(@error-color, transparent, transparent);
|
|
|
|
box-shadow: none;
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(~`colorPalette('@{error-color}', 7) `; @btn-text-hover-bg; transparent);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(~`colorPalette('@{error-color}', 5) `; @btn-text-hover-bg; transparent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
& when (@theme = dark) {
|
|
|
|
.button-color(~`colorPalette('@{error-color}', 5) `; fadein(@btn-text-hover-bg, 1%); transparent);
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
.button-color(~`colorPalette('@{error-color}', 7) `; fadein(@btn-text-hover-bg, 1%); transparent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.button-disabled(@disabled-color; transparent; transparent);
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
// round button
|
|
|
|
.btn-round(@btnClassName: btn) {
|
2021-01-09 09:07:02 +08:00
|
|
|
.button-size(@btn-circle-size; (@btn-circle-size / 2); @font-size-base; @btn-circle-size);
|
2020-03-05 12:17:50 +08:00
|
|
|
&.@{btnClassName}-lg {
|
|
|
|
.button-size(
|
2021-01-09 09:07:02 +08:00
|
|
|
@btn-circle-size-lg; (@btn-circle-size-lg / 2); @btn-font-size-lg; @btn-circle-size-lg
|
2020-03-05 12:17:50 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
&.@{btnClassName}-sm {
|
|
|
|
.button-size(
|
2021-01-09 09:07:02 +08:00
|
|
|
@btn-circle-size-sm; (@btn-circle-size-sm / 2); @font-size-base; @btn-circle-size-sm
|
2020-03-05 12:17:50 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// square button: the content only contains icon
|
|
|
|
.btn-square(@btnClassName: btn) {
|
|
|
|
.square(@btn-square-size);
|
2020-03-30 09:53:10 +08:00
|
|
|
.button-size(@btn-square-size; 0; @btn-square-only-icon-size; @btn-border-radius-base);
|
|
|
|
& > * {
|
|
|
|
font-size: @btn-square-only-icon-size;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
&.@{btnClassName}-lg {
|
|
|
|
.square(@btn-square-size-lg);
|
2020-03-30 09:53:10 +08:00
|
|
|
.button-size(@btn-square-size-lg; 0; @btn-square-only-icon-size-lg; @btn-border-radius-base);
|
|
|
|
& > * {
|
|
|
|
font-size: @btn-square-only-icon-size-lg;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
&.@{btnClassName}-sm {
|
|
|
|
.square(@btn-square-size-sm);
|
2020-03-30 09:53:10 +08:00
|
|
|
.button-size(@btn-square-size-sm; 0; @btn-square-only-icon-size-sm; @btn-border-radius-base);
|
|
|
|
& > * {
|
|
|
|
font-size: @btn-square-only-icon-size-sm;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// circle button: the content only contains icon
|
|
|
|
.btn-circle(@btnClassName: btn) {
|
|
|
|
min-width: @btn-height-base;
|
|
|
|
padding-right: 0;
|
|
|
|
padding-left: 0;
|
|
|
|
text-align: center;
|
|
|
|
border-radius: 50%;
|
|
|
|
&.@{btnClassName}-lg {
|
|
|
|
min-width: @btn-height-lg;
|
|
|
|
border-radius: 50%;
|
|
|
|
}
|
|
|
|
&.@{btnClassName}-sm {
|
|
|
|
min-width: @btn-height-sm;
|
|
|
|
border-radius: 50%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Horizontal button groups style
|
|
|
|
// --------------------------------------------------
|
|
|
|
.btn-group(@btnClassName: btn) {
|
|
|
|
.button-group-base(@btnClassName);
|
|
|
|
.@{btnClassName} + .@{btnClassName},
|
|
|
|
.@{btnClassName} + &,
|
|
|
|
span + .@{btnClassName},
|
|
|
|
.@{btnClassName} + span,
|
|
|
|
> span + span,
|
|
|
|
& + .@{btnClassName},
|
|
|
|
& + & {
|
|
|
|
margin-left: -1px;
|
|
|
|
}
|
|
|
|
.@{btnClassName}-primary + .@{btnClassName}:not(.@{btnClassName}-primary):not([disabled]) {
|
|
|
|
border-left-color: transparent;
|
|
|
|
}
|
|
|
|
.@{btnClassName} {
|
|
|
|
border-radius: 0;
|
|
|
|
}
|
|
|
|
> .@{btnClassName}:first-child,
|
|
|
|
> span:first-child > .@{btnClassName} {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
|
|
|
> .@{btnClassName}:only-child {
|
|
|
|
border-radius: @btn-border-radius-base;
|
|
|
|
}
|
|
|
|
> span:only-child > .@{btnClassName} {
|
|
|
|
border-radius: @btn-border-radius-base;
|
|
|
|
}
|
|
|
|
> .@{btnClassName}:first-child:not(:last-child),
|
|
|
|
> span:first-child:not(:last-child) > .@{btnClassName} {
|
|
|
|
border-top-left-radius: @btn-border-radius-base;
|
|
|
|
border-bottom-left-radius: @btn-border-radius-base;
|
|
|
|
}
|
|
|
|
> .@{btnClassName}:last-child:not(:first-child),
|
|
|
|
> span:last-child:not(:first-child) > .@{btnClassName} {
|
|
|
|
border-top-right-radius: @btn-border-radius-base;
|
|
|
|
border-bottom-right-radius: @btn-border-radius-base;
|
|
|
|
}
|
|
|
|
&-sm {
|
|
|
|
> .@{btnClassName}:only-child {
|
|
|
|
border-radius: @btn-border-radius-sm;
|
|
|
|
}
|
|
|
|
> span:only-child > .@{btnClassName} {
|
|
|
|
border-radius: @btn-border-radius-sm;
|
|
|
|
}
|
|
|
|
> .@{btnClassName}:first-child:not(:last-child),
|
|
|
|
> span:first-child:not(:last-child) > .@{btnClassName} {
|
|
|
|
border-top-left-radius: @btn-border-radius-sm;
|
|
|
|
border-bottom-left-radius: @btn-border-radius-sm;
|
|
|
|
}
|
|
|
|
> .@{btnClassName}:last-child:not(:first-child),
|
|
|
|
> span:last-child:not(:first-child) > .@{btnClassName} {
|
|
|
|
border-top-right-radius: @btn-border-radius-sm;
|
|
|
|
border-bottom-right-radius: @btn-border-radius-sm;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
& > & {
|
|
|
|
float: left;
|
|
|
|
}
|
|
|
|
& > &:not(:first-child):not(:last-child) > .@{btnClassName} {
|
|
|
|
border-radius: 0;
|
|
|
|
}
|
|
|
|
& > &:first-child:not(:last-child) {
|
|
|
|
> .@{btnClassName}:last-child {
|
|
|
|
padding-right: 8px;
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
& > &:last-child:not(:first-child) > .@{btnClassName}:first-child {
|
|
|
|
padding-left: 8px;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
}
|
|
|
|
}
|