diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index c46e8a00..0ef839de 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -28,6 +28,7 @@ This release removes the `` component. When this component - Fixed a bug in `` that prevented the textarea from resizing automatically when setting the value programmatically [#912](https://github.com/shoelace-style/shoelace/discussions/912) - Fixed a handful of paths to prevent TypeScript from getting upset [#886](https://github.com/shoelace-style/shoelace/issues/886) - Fixed a bug in `` where the `button-group__base` part was documented but not exposed [#909](https://github.com/shoelace-style/shoelace/discussions/909) +- Fixed a bug in `` that caused the active track color to render on the wrong side in RTL [#916](https://github.com/shoelace-style/shoelace/issues/916) - Refactored the internal event emitter to be part of `ShoelaceElement` to reduce imports and improve DX - Upgraded the status of ``, ``, and `` from experimental to stable diff --git a/src/components/range/range.styles.ts b/src/components/range/range.styles.ts index 1a2fb1db..20ec025e 100644 --- a/src/components/range/range.styles.ts +++ b/src/components/range/range.styles.ts @@ -43,6 +43,18 @@ export default css` ); } + .range--rtl .range__control { + background-image: linear-gradient( + to left, + var(--track-color-inactive) 0%, + var(--track-color-inactive) min(var(--percent), var(--track-active-offset)), + var(--track-color-active) min(var(--percent), var(--track-active-offset)), + var(--track-color-active) max(var(--percent), var(--track-active-offset)), + var(--track-color-inactive) max(var(--percent), var(--track-active-offset)), + var(--track-color-inactive) 100% + ); + } + /* Webkit */ .range__control::-webkit-slider-runnable-track { width: 100%; diff --git a/src/components/range/range.ts b/src/components/range/range.ts index bd98d9fe..225373a0 100644 --- a/src/components/range/range.ts +++ b/src/components/range/range.ts @@ -247,6 +247,7 @@ export default class SlRange extends ShoelaceElement { range: true, 'range--disabled': this.disabled, 'range--focused': this.hasFocus, + 'range--rtl': this.localize.dir() === 'rtl', 'range--tooltip-visible': this.hasTooltip, 'range--tooltip-top': this.tooltip === 'top', 'range--tooltip-bottom': this.tooltip === 'bottom'