Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 91bc598

Browse files
committed
feat(slider): make discrete track ticks themable
Closes #621.
1 parent 9a12239 commit 91bc598

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/components/slider/slider-theme.scss

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ md-slider.md-THEME_NAME-theme {
33
.md-track {
44
background-color: '{{foreground-3}}';
55
}
6+
.md-track-ticks {
7+
background-color: '{{foreground-4}}';
8+
}
69
.md-focus-thumb {
710
background-color: '{{foreground-2}}';
811
}

src/components/slider/slider.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ function SliderController($scope, $element, $attrs, $$rAF, $window, $mdAria, $md
185185

186186
var numSteps = Math.floor( (max - min) / step );
187187
if (!tickCanvas) {
188+
var trackTicksStyle = $window.getComputedStyle(tickContainer[0]);
188189
tickCanvas = angular.element('<canvas style="position:absolute;">');
189190
tickCtx = tickCanvas[0].getContext('2d');
190-
tickCtx.fillStyle = 'black';
191+
tickCtx.fillStyle = trackTicksStyle.backgroundColor || 'black';
191192
tickContainer.append(tickCanvas);
192193
}
193194
var dimensions = getSliderDimensions();

0 commit comments

Comments
 (0)