Browse Source

style: add rtl.less of Radio (#22405)

pull/22410/head
xrkffgg 5 years ago
committed by GitHub
parent
commit
289d66ac12
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 34
      components/radio/style/index.less
  2. 59
      components/radio/style/rtl.less

34
components/radio/style/index.less

@ -14,10 +14,6 @@
display: inline-block; display: inline-block;
line-height: unset; line-height: unset;
&-rtl {
direction: rtl;
}
.@{ant-prefix}-badge-count { .@{ant-prefix}-badge-count {
z-index: 1; z-index: 1;
} }
@ -36,11 +32,6 @@
margin-right: 8px; margin-right: 8px;
white-space: nowrap; white-space: nowrap;
cursor: pointer; cursor: pointer;
&-rtl {
margin-right: 0;
margin-left: 8px;
}
} }
.@{radio-prefix-cls} { .@{radio-prefix-cls} {
@ -183,11 +174,6 @@ span.@{radio-prefix-cls} + * {
cursor: pointer; cursor: pointer;
transition: color 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s; transition: color 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s;
&-rtl {
border-right-width: 0;
border-left-width: @border-width-base;
}
a { a {
color: @radio-button-color; color: @radio-button-color;
} }
@ -224,30 +210,16 @@ span.@{radio-prefix-cls} + * {
background-color: @border-color-base; background-color: @border-color-base;
transition: background-color 0.3s; transition: background-color 0.3s;
content: ''; content: '';
.@{radio-prefix-cls}-button-wrapper-rtl& {
right: -1px;
left: 0;
}
} }
} }
&:first-child { &:first-child {
border-left: @border-width-base @border-style-base @border-color-base; border-left: @border-width-base @border-style-base @border-color-base;
border-radius: @border-radius-base 0 0 @border-radius-base; border-radius: @border-radius-base 0 0 @border-radius-base;
.@{radio-prefix-cls}-button-wrapper-rtl& {
border-right: @border-width-base @border-style-base @border-color-base;
border-radius: 0 @border-radius-base @border-radius-base 0;
}
} }
&:last-child { &:last-child {
border-radius: 0 @border-radius-base @border-radius-base 0; border-radius: 0 @border-radius-base @border-radius-base 0;
.@{radio-prefix-cls}-button-wrapper-rtl& {
border-radius: @border-radius-base 0 0 @border-radius-base;
}
} }
&:first-child:last-child { &:first-child:last-child {
@ -340,10 +312,6 @@ span.@{radio-prefix-cls} + * {
} }
&:first-child { &:first-child {
border-left-color: @border-color-base; border-left-color: @border-color-base;
.@{radio-prefix-cls}-button-wrapper-rtl& {
border-right-color: @border-color-base;
}
} }
} }
@ -372,3 +340,5 @@ span.@{radio-prefix-cls} + * {
vertical-align: text-bottom; vertical-align: text-bottom;
} }
} }
@import './rtl';

59
components/radio/style/rtl.less

@ -0,0 +1,59 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@radio-prefix-cls: ~'@{ant-prefix}-radio';
@radio-group-prefix-cls: ~'@{radio-prefix-cls}-group';
.@{radio-group-prefix-cls} {
&-rtl {
direction: rtl;
}
}
// 一般状态
.@{radio-prefix-cls}-wrapper {
&-rtl {
margin-right: 0;
margin-left: 8px;
}
}
.@{radio-prefix-cls}-button-wrapper {
&-rtl {
border-right-width: 0;
border-left-width: @border-width-base;
}
&:not(:first-child) {
&::before {
.@{radio-prefix-cls}-button-wrapper-rtl& {
right: -1px;
left: 0;
}
}
}
&:first-child {
.@{radio-prefix-cls}-button-wrapper-rtl& {
border-right: @border-width-base @border-style-base @border-color-base;
border-radius: 0 @border-radius-base @border-radius-base 0;
}
.@{radio-prefix-cls}-button-wrapper-checked:not([class*=~"' @{radio-prefix-cls}-button-wrapper-disabled'"])& {
border-right-color: @radio-button-hover-color;
}
}
&:last-child {
.@{radio-prefix-cls}-button-wrapper-rtl& {
border-radius: @border-radius-base 0 0 @border-radius-base;
}
}
&-disabled {
&:first-child {
.@{radio-prefix-cls}-button-wrapper-rtl& {
border-right-color: @border-color-base;
}
}
}
}
Loading…
Cancel
Save