ant-design-blazor/components/input/style/rtl.less

239 lines
5.4 KiB
Plaintext
Raw Normal View History

2020-03-23 13:51:37 +08:00
@import '../../style/themes/index';
@import '../../style/mixins/index';
//== Style for input-group: input with label, with button or dropdown...
.@{ant-prefix}-input-group {
&-wrapper {
&-rtl {
direction: rtl;
}
}
&-rtl {
direction: rtl;
}
}
// affix
@input-affix-margin: 4px;
.@{ant-prefix}-input {
2020-05-11 21:47:35 +08:00
&-affix-wrapper&-affix-wrapper-rtl {
> input.@{ant-prefix}-input {
border: none;
outline: none;
}
}
2020-03-23 13:51:37 +08:00
&-affix-wrapper-rtl {
.@{ant-prefix}-input-prefix {
margin: 0 0 0 @input-affix-margin;
}
.@{ant-prefix}-input-suffix {
margin: 0 @input-affix-margin 0 0;
}
}
}
2020-05-11 21:47:35 +08:00
// allow-clear
.@{ant-prefix}-input-clear-icon {
&:last-child {
.@{ant-prefix}-input-affix-wrapper-rtl & {
margin-right: @input-affix-margin;
margin-left: 0;
}
}
}
.@{ant-prefix}-input-textarea-clear-icon {
.@{ant-prefix}-input-affix-wrapper-rtl & {
right: auto;
left: 0;
margin: 8px 0 0 8px;
}
}
2020-03-23 13:51:37 +08:00
// mixin
@input-rtl-cls: ~'@{ant-prefix}-input-rtl';
.active() {
.@{input-rtl-cls} & {
border-right-width: 0;
border-left-width: @border-width-base !important;
}
}
.hover() {
.@{input-rtl-cls} & {
border-right-width: 0;
border-left-width: @border-width-base !important;
}
}
.input() {
&-rtl {
direction: rtl;
}
}
// label input
.input-group(@inputClass) {
> .@{inputClass}-rtl:first-child,
&-rtl &-addon:first-child {
2020-06-15 00:29:33 +08:00
border-radius: 0 @border-radius-base @border-radius-base 0;
2020-03-23 13:51:37 +08:00
}
&-addon:first-child {
.@{inputClass}-group-rtl & {
border-right: @border-width-base @border-style-base @input-border-color;
border-left: 0;
}
}
&-addon:last-child {
.@{inputClass}-group-rtl & {
border-right: 0;
border-left: @border-width-base @border-style-base @input-border-color;
}
}
> .@{inputClass}:last-child,
&-addon:last-child {
2020-08-13 06:43:07 +08:00
.@{inputClass}-group-rtl& {
2020-06-15 00:29:33 +08:00
border-radius: @border-radius-base 0 0 @border-radius-base;
2020-03-23 13:51:37 +08:00
}
}
2020-05-11 21:47:35 +08:00
.@{inputClass}-affix-wrapper {
&:not(:first-child) {
.@{inputClass}-group-rtl& {
2020-06-15 00:29:33 +08:00
border-radius: @border-radius-base 0 0 @border-radius-base;
2020-05-11 21:47:35 +08:00
}
}
&:not(:last-child) {
.@{inputClass}-group-rtl& {
2020-06-15 00:29:33 +08:00
border-radius: 0 @border-radius-base @border-radius-base 0;
2020-05-11 21:47:35 +08:00
}
}
}
2020-03-23 13:51:37 +08:00
&&-compact {
2020-03-30 09:53:10 +08:00
& > *:not(:last-child) {
.@{inputClass}-group-rtl& {
margin-right: 0;
margin-left: -@border-width-base;
border-left-width: @border-width-base;
}
}
2020-03-23 13:51:37 +08:00
& > *:first-child,
& > .@{ant-prefix}-select:first-child > .@{ant-prefix}-select-selector,
& > .@{ant-prefix}-calendar-picker:first-child .@{ant-prefix}-input,
& > .@{ant-prefix}-select-auto-complete:first-child .@{ant-prefix}-input,
& > .@{ant-prefix}-cascader-picker:first-child .@{ant-prefix}-input,
& > .@{ant-prefix}-mention-wrapper:first-child .@{ant-prefix}-mention-editor,
& > .@{ant-prefix}-time-picker:first-child .@{ant-prefix}-time-picker-input {
.@{inputClass}-group-rtl& {
2020-06-15 00:29:33 +08:00
border-radius: 0 @border-radius-base @border-radius-base 0;
2020-03-23 13:51:37 +08:00
}
}
& > *:last-child,
& > .@{ant-prefix}-select:last-child > .@{ant-prefix}-select-selector,
& > .@{ant-prefix}-calendar-picker:last-child .@{ant-prefix}-input,
& > .@{ant-prefix}-select-auto-complete:last-child .@{ant-prefix}-input,
& > .@{ant-prefix}-cascader-picker:last-child .@{ant-prefix}-input,
& > .@{ant-prefix}-cascader-picker-focused:last-child .@{ant-prefix}-input,
& > .@{ant-prefix}-mention-wrapper:last-child .@{ant-prefix}-mention-editor,
& > .@{ant-prefix}-time-picker:last-child .@{ant-prefix}-time-picker-input {
.@{inputClass}-group-rtl& {
border-left-width: @border-width-base;
2020-06-15 00:29:33 +08:00
border-radius: @border-radius-base 0 0 @border-radius-base;
2020-03-23 13:51:37 +08:00
}
}
}
}
// search-input
2020-05-11 21:47:35 +08:00
@search-prefix: ~'@{ant-prefix}-input-search';
2020-03-23 13:51:37 +08:00
@search-rtl-cls: ~'@{search-prefix}-rtl';
.@{search-prefix} {
&-rtl {
direction: rtl;
}
2020-04-30 10:55:54 +08:00
&-icon {
.@{search-rtl-cls} & {
margin-right: 0.5em;
margin-left: 0;
}
&::before {
.@{search-rtl-cls} & {
border-left: none;
}
}
&::after {
.@{search-rtl-cls} & {
right: auto;
left: 0;
border-right: @border-width-base @border-style-base @input-border-color;
transition: all 0.3s;
}
}
}
&:not(&-enter-button) {
.@{search-rtl-cls}& {
padding-right: @input-padding-horizontal-base;
padding-left: 0;
}
}
2020-03-23 13:51:37 +08:00
&-enter-button {
input {
.@{search-rtl-cls}& {
2020-05-11 21:47:35 +08:00
border-right: @border-width-base @border-style-base @input-border-color;
border-left: 0;
}
&:hover,
&:focus {
.@{search-rtl-cls}& {
border-color: @input-hover-border-color;
}
}
}
&.@{ant-prefix}-input-affix-wrapper {
.@{search-rtl-cls}& {
border-right: @border-width-base @border-style-base @input-border-color;
2020-03-23 13:51:37 +08:00
border-left: 0;
}
2020-03-30 09:53:10 +08:00
&:hover,
&:focus {
2020-05-11 21:47:35 +08:00
.@{search-rtl-cls}& {
border-color: @input-hover-border-color;
}
2020-03-30 09:53:10 +08:00
}
2020-03-23 13:51:37 +08:00
}
& + .@{ant-prefix}-input-group-addon,
input + .@{ant-prefix}-input-group-addon {
.@{search-rtl-cls}& {
2020-08-13 06:43:07 +08:00
padding: 0;
border: 0;
2020-03-23 13:51:37 +08:00
.@{search-prefix}-button {
width: 100%;
2020-06-15 00:29:33 +08:00
border-radius: @border-radius-base 0 0 @border-radius-base;
2020-03-23 13:51:37 +08:00
}
}
}
}
}