Skip to content

Commit

Permalink
fix(slider): fix background color for disabled slider
Browse files Browse the repository at this point in the history
Add a background color to the slider pin when the slider is
disabled.

fix #304
  • Loading branch information
adrianschmidt authored and BregenzerK committed Sep 4, 2019
1 parent 97cadae commit 2b1a890
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/slider/slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
@import '@limetech/mdc-slider/mdc-slider';
@import "@limetech/mdc-floating-label/mdc-floating-label";

/**
* @prop --slider-bg-color-behind-component: Color of "transparent" parts of disabled slider. Defaults to #ffffff.
*/

$colorGrey: #999999;

:host {
--mdc-slider-bg-color-behind-component: var(--slider-bg-color-behind-component, #ffffff);
}

.mdc-slider {
@include mdc-slider-highlight-color(var(--lime-primary-color, $mdc-theme-primary));
@include mdc-slider-thumb-color(var(--lime-primary-color, $mdc-theme-primary));
Expand Down Expand Up @@ -76,6 +84,11 @@ $colorGrey: #999999;
top: pxToRem(-16);
transform: none;
width: pxToRem(40);

.mdc-slider.mdc-slider--disabled & {
background: var(--mdc-slider-bg-color-behind-component);
background: linear-gradient(90deg, rgba(255,255,255,0) 0%, var(--mdc-slider-bg-color-behind-component) 15%, var(--mdc-slider-bg-color-behind-component) 85%, rgba(255,255,255,0) 100%);
}
}

.mdc-slider__pin-value-marker {
Expand Down

0 comments on commit 2b1a890

Please sign in to comment.