Skip to content

Commit

Permalink
fix(comp:slider): slider marker color error when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Feb 20, 2023
1 parent 8ca7a08 commit 49b53f0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
7 changes: 5 additions & 2 deletions packages/components/slider/demo/Marks.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<template>
<h4>marks & step</h4>
<IxSlider v-model:value="value0" :marks="marks"></IxSlider>
<IxSlider v-model:value="value0" :disabled="isDisabled" :marks="marks"></IxSlider>

<h4>step=null</h4>
<IxSlider v-model:value="value1" :marks="marks" :step="null"></IxSlider>
<IxSlider v-model:value="value1" :disabled="isDisabled" :marks="marks" :step="null"></IxSlider>

Disabled: <IxSwitch v-model:checked="isDisabled"></IxSwitch>
</template>

<script setup lang="ts">
Expand All @@ -23,4 +25,5 @@ const marks = {
const value0 = ref(30)
const value1 = ref(50)
const isDisabled = ref(false)
</script>
3 changes: 2 additions & 1 deletion packages/components/slider/docs/Theme.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
| `@slider-track-disabled-background-color` | `rgba(0, 0, 0, 0.251)` | `@color-graphite` | - |
| `@slider-thumb-disabled-background-color` | `@color-white` | - | - |
| `@slider-thumb-disabled-border-color` | `rgba(0, 0, 0, 0.251)` | `@color-graphite` | - |
| `@slider-dot-disabled-active-border-color` | `rgba(0, 0, 0, 0.251)` | `@color-graphite` | - |
| `@slider-dot-disabled-active-background-color` | `rgba(0, 0, 0, 0.251)` | - | - |
| `@slider-thumb-width` | `10px` | - | - |
| `@slider-thumb-height` | `10px` | - | - |
| `@slider-thumb-margin-top` | `-3px` | - | - |
| `@slider-thumb-vertical-margin-left` | `-4px` | - | - |
| `@slider-thumb-vertical-margin-top` | `-6px` | - | - |
| `@slider-height` | `2px` | - | - |
| `@slider-width` | `2px` | - | - |
| `@slider-dot-disabled-active-border-color` | - | `@color-graphite` | - |
13 changes: 6 additions & 7 deletions packages/components/slider/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@
touch-action: none;

&:not(&-disabled) {
&:hover &-rail {
&:hover .@{slider-prefix}-rail {
background-color: @slider-rail-hover-background-color;
}

&:hover &-track {
&:hover .@{slider-prefix}-track {
background-color: @slider-track-hover-background-color;
}

.@{slider-prefix}-dot-active {
background-color: @slider-dot-active-background-color;
}
}

&-rail {
Expand Down Expand Up @@ -57,10 +60,6 @@
&:last-child {
margin-left: -1px;
}

&-active {
background-color: @slider-dot-active-background-color;
}
}

&-thumb {
Expand Down Expand Up @@ -179,7 +178,7 @@
cursor: not-allowed;

&-active {
border-color: @slider-dot-disabled-active-border-color;
background-color: @slider-dot-disabled-active-background-color;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@slider-track-disabled-background-color: rgba(0, 0, 0, 0.251);
@slider-thumb-disabled-background-color: @color-white;
@slider-thumb-disabled-border-color: rgba(0, 0, 0, 0.251);
@slider-dot-disabled-active-border-color: rgba(0, 0, 0, 0.251);
@slider-dot-disabled-active-background-color: rgba(0, 0, 0, 0.251);

@slider-thumb-width: 10px;
@slider-thumb-height: 10px;
Expand Down

0 comments on commit 49b53f0

Please sign in to comment.