Merge pull request #22258 from ant-design/add-rtl-less

style: add rtl.less of breadcrumb\dropdown
This commit is contained in:
xrkffgg 2020-03-16 17:28:53 +08:00 committed by GitHub
commit 9df7b38673
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 108 additions and 63 deletions

View File

@ -1,5 +1,6 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@import './rtl';
@breadcrumb-prefix-cls: ~'@{ant-prefix}-breadcrumb';
@ -9,15 +10,6 @@
color: @breadcrumb-base-color;
font-size: @breadcrumb-font-size;
&-rtl {
.clearfix;
direction: rtl;
> span {
float: right;
}
}
.@{iconfont-css-prefix} {
font-size: @breadcrumb-icon-font-size;
}
@ -49,22 +41,12 @@
&-link {
> .@{iconfont-css-prefix} + span {
margin-left: 4px;
.@{breadcrumb-prefix-cls}-rtl & {
margin-right: 4px;
margin-left: 0;
}
}
}
&-overlay-link {
> .@{iconfont-css-prefix} {
margin-left: 4px;
.@{breadcrumb-prefix-cls}-rtl & {
margin-right: 4px;
margin-left: 0;
}
}
}
}

View File

@ -0,0 +1,33 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@breadcrumb-prefix-cls: ~'@{ant-prefix}-breadcrumb';
.@{breadcrumb-prefix-cls} {
&-rtl {
.clearfix;
direction: rtl;
> span {
float: right;
}
}
&-link {
> .@{iconfont-css-prefix} + span {
.@{breadcrumb-prefix-cls}-rtl & {
margin-right: 4px;
margin-left: 0;
}
}
}
&-overlay-link {
> .@{iconfont-css-prefix} {
.@{breadcrumb-prefix-cls}-rtl & {
margin-right: 4px;
margin-left: 0;
}
}
}
}

View File

@ -1,5 +1,6 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@import './rtl';
@dropdown-prefix-cls: ~'@{ant-prefix}-dropdown';
@ -12,10 +13,6 @@
z-index: @zindex-dropdown;
display: block;
&-rtl {
direction: rtl;
}
&::before {
position: absolute;
top: -7px;
@ -25,11 +22,6 @@
z-index: -9999;
opacity: 0.0001;
content: ' ';
.@{dropdown-prefix-cls}-rtl& {
right: -7px;
left: 0;
}
}
&-wrap {
@ -85,10 +77,6 @@
ul,
li {
list-style: none;
.@{dropdown-prefix-cls}-rtl & {
text-align: right;
}
}
ul {
@ -110,20 +98,11 @@
cursor: pointer;
transition: all 0.3s;
.@{dropdown-prefix-cls}-rtl & {
text-align: right;
}
> .anticon:first-child,
> span > .anticon:first-child {
min-width: 12px;
margin-right: 8px;
font-size: @font-size-sm;
.@{dropdown-prefix-cls}-rtl & {
margin-right: 0;
margin-left: 8px;
}
}
> a {
@ -182,21 +161,11 @@
position: absolute;
right: @padding-xs;
.@{dropdown-prefix-cls}-rtl & {
right: auto;
left: @padding-xs;
}
&-icon {
margin-right: 0 !important;
color: @text-color-secondary;
font-style: normal;
.iconfont-size-under-12px(10px);
.@{dropdown-prefix-cls}-rtl & {
margin-left: 0 !important;
transform: scaleX(-1);
}
}
}
}
@ -209,11 +178,6 @@
&-submenu-title {
padding-right: @control-padding-horizontal + @font-size-sm;
.@{dropdown-prefix-cls}-rtl & {
padding-right: @control-padding-horizontal;
padding-left: @control-padding-horizontal + @font-size-sm;
}
}
&-submenu-vertical {
@ -227,13 +191,6 @@
min-width: 100%;
margin-left: 4px;
transform-origin: 0 0;
.@{dropdown-prefix-cls}-rtl & {
right: 100%;
left: 0;
margin-right: 4px;
margin-left: 0;
}
}
&-submenu&-submenu-disabled .@{dropdown-prefix-cls}-menu-submenu-title {

View File

@ -0,0 +1,73 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@dropdown-prefix-cls: ~'@{ant-prefix}-dropdown';
.@{dropdown-prefix-cls} {
&-rtl {
direction: rtl;
}
&::before {
.@{dropdown-prefix-cls}-rtl& {
right: -7px;
left: 0;
}
}
&-menu {
&-submenu-popup {
ul,
li {
.@{dropdown-prefix-cls}-rtl & {
text-align: right;
}
}
}
&-item,
&-submenu-title {
.@{dropdown-prefix-cls}-rtl & {
text-align: right;
}
> .anticon:first-child,
> span > .anticon:first-child {
.@{dropdown-prefix-cls}-rtl & {
margin-right: 0;
margin-left: 8px;
}
}
.@{dropdown-prefix-cls}-menu-submenu-arrow {
.@{dropdown-prefix-cls}-rtl & {
right: auto;
left: @padding-xs;
}
&-icon {
.@{dropdown-prefix-cls}-rtl & {
margin-left: 0 !important;
transform: scaleX(-1);
}
}
}
}
&-submenu-title {
.@{dropdown-prefix-cls}-rtl & {
padding-right: @control-padding-horizontal;
padding-left: @control-padding-horizontal + @font-size-sm;
}
}
&-submenu-vertical > & {
.@{dropdown-prefix-cls}-rtl & {
right: 100%;
left: 0;
margin-right: 4px;
margin-left: 0;
}
}
}
}