ant-design/components/grid/style/rtl.less
mic-web 7f7b3a59dc
fix: col-x class names in css when using custom prefix (#34494)
* fix: col-x class names of Row and Col components when using custom prefix

* refactor: reuse @col-prefix-cls and @row-prefix-cls

* refactor: move @col-prefix-cls and @row-prefix-cls to mixin.less
2022-03-16 17:01:27 +08:00

70 lines
1.4 KiB
Plaintext

@import '../../style/themes/index';
@import '../../style/mixins/index';
@import './mixin';
.@{row-prefix-cls} {
&-rtl {
direction: rtl;
}
}
// mixin
.loop-grid-columns(@index, @class) when (@index > 0) {
.@{col-prefix-cls}@{class}-push-@{index} {
// reset property in RTL direction
&.@{col-prefix-cls}-rtl {
right: percentage((@index / @grid-columns));
left: auto;
}
}
.@{col-prefix-cls}@{class}-pull-@{index} {
// reset property in RTL direction
&.@{col-prefix-cls}-rtl {
right: auto;
left: percentage((@index / @grid-columns));
}
}
.@{col-prefix-cls}@{class}-offset-@{index} {
// reset property in RTL direction
&.@{col-prefix-cls}-rtl {
margin-right: percentage((@index / @grid-columns));
margin-left: 0;
}
}
}
.loop-grid-columns(@index, @class) when (@index = 0) {
.@{col-prefix-cls}-push-@{index} {
// reset property in RTL direction
&.@{col-prefix-cls}-rtl {
right: auto;
}
}
.@{col-prefix-cls}-pull-@{index} {
&.@{col-prefix-cls}-rtl {
left: auto;
}
}
.@{col-prefix-cls}@{class}-push-@{index} {
&.@{col-prefix-cls}-rtl {
right: auto;
}
}
.@{col-prefix-cls}@{class}-pull-@{index} {
&.@{col-prefix-cls}-rtl {
left: auto;
}
}
.@{col-prefix-cls}@{class}-offset-@{index} {
&.@{col-prefix-cls}-rtl {
margin-right: 0;
}
}
}