Skip to content

Commit

Permalink
feat(switch): update style for mobile (#1206)
Browse files Browse the repository at this point in the history
* feat(switch): update style for mobile

* fix: resolve lint errors
  • Loading branch information
LeeJim authored Mar 17, 2023
1 parent d848bde commit 0a70951
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
10 changes: 7 additions & 3 deletions docs/mobile/api_v2/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ toc: false

使用场景:需要通过描述解释、提示结果时,可用带描述开关

{{ desc }}
{{ label }}

### 禁用状态
### 组件状态

{{ disabled }}
{{ status }}

### 开关尺寸

{{ size }}
66 changes: 31 additions & 35 deletions style/mobile/components/switch/v2/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,39 @@
.@{prefix}-switch {
display: flex;
align-items: center;
vertical-align: middle;
width: @switch-width;
height: @switch-height;
border-radius: @switch-radius;
background-color: @switch-unchecked-color;
position: relative;
transition: all .3s ease;
overflow: hidden;

&--checked {
background-color: @switch-checked-color;
}

&--disabled {
background-color: @switch-unchecked-disabled-color;
}

&--checked&--disabled {
background-color: @switch-checked-disabled-color;
}

&--large {
width: @switch-large-width;
height: @switch-large-height;
border-radius: @switch-large-radius;
}

&--small {
width: @switch-small-width;
height: @switch-small-height;
border-radius: @switch-small-radius;
}

&__label {
position: absolute;
top: 0;
Expand Down Expand Up @@ -62,41 +93,6 @@
color: @switch-label-checked-color;
}

&__body {
vertical-align: middle;
width: @switch-width;
height: @switch-height;
border-radius: @switch-radius;
background-color: @switch-unchecked-color;
position: relative;
transition: all .3s ease;
overflow: hidden;

&--checked {
background-color: @switch-checked-color;
}

&--disabled {
background-color: @switch-unchecked-disabled-color;
}

&--checked&--disabled {
background-color: @switch-checked-disabled-color;
}

&--large {
width: @switch-large-width;
height: @switch-large-height;
border-radius: @switch-large-radius;
}

&--small {
width: @switch-small-width;
height: @switch-small-height;
border-radius: @switch-small-radius;
}
}

&__dot {
position: absolute;
left: @switch-dot-horizontal-margin;
Expand Down

0 comments on commit 0a70951

Please sign in to comment.