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

Commit 3ea349f

Browse files
committed
fix(slider): BREAKING: change default color to accent
As per the spec, sliders should be accent by default. If you wish to retain the primary color, apply the `md-primary` class to the slider. Update demos accordingly.
1 parent 9442631 commit 3ea349f

3 files changed

Lines changed: 33 additions & 14 deletions

File tree

docs/content/Theming/03_configuring_a_theme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
By default your Angular Material application will use the default theme, a theme
88
that is pre-configured with the following palettes for intention groups:
99

10-
- *primary* - blue
11-
- *accent* - green
10+
- *primary* - indigo
11+
- *accent* - pink
1212
- *warn* - red
1313
- *background* - grey (note that white is in this palette)
1414

src/components/slider/demoBasicUsage/index.html

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ <h3>
1010
<div flex="10" layout layout-align="center center">
1111
<span>R</span>
1212
</div>
13-
<md-slider flex min="0" max="255" ng-model="color.red" aria-label="red" id="red-slider" class="md-warn">
13+
<md-slider flex min="0" max="255" ng-model="color.red" aria-label="red" id="red-slider" class="">
1414
</md-slider>
1515
<div flex="20" layout layout-align="center center">
1616
<input type="number" ng-model="color.red" aria-label="red" aria-controls="red-slider">
@@ -39,9 +39,28 @@ <h3>
3939
</div>
4040
</div>
4141

42-
<h3>Rating: {{rating}}/5</h3>
43-
<md-slider md-discrete ng-model="rating" step="1" min="1" max="5" aria-label="rating">
44-
</md-slider>
42+
<h3>Rating: {{rating}}/5 - demo of theming classes</h3>
43+
<div layout>
44+
<div flex="10" layout layout-align="center center">
45+
<span>default</span>
46+
</div>
47+
<md-slider flex md-discrete ng-model="rating" step="1" min="1" max="5" aria-label="rating">
48+
</md-slider>
49+
</div>
50+
<div layout>
51+
<div flex="10" layout layout-align="center center">
52+
<span>md-warn</span>
53+
</div>
54+
<md-slider flex class="md-warn" md-discrete ng-model="rating" step="1" min="1" max="5" aria-label="rating">
55+
</md-slider>
56+
</div>
57+
<div layout>
58+
<div flex="10" layout layout-align="center center">
59+
<span>md-primary</span>
60+
</div>
61+
<md-slider flex class="md-primary" md-discrete ng-model="rating" step="1" min="1" max="5" aria-label="rating">
62+
</md-slider>
63+
</div>
4564

4665
<h3>Disabled</h3>
4766
<md-slider ng-model="disabled1" ng-disabled="true" aria-label="Disabled 1"></md-slider>

src/components/slider/slider-theme.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@ md-slider.md-THEME_NAME-theme {
2020
}
2121

2222
.md-track.md-track-fill {
23-
background-color: '{{primary-color}}';
23+
background-color: '{{accent-color}}';
2424
}
2525
.md-thumb:after {
26-
border-color: '{{primary-color}}';
27-
background-color: '{{primary-color}}';
26+
border-color: '{{accent-color}}';
27+
background-color: '{{accent-color}}';
2828
}
2929
.md-sign {
30-
background-color: '{{primary-color}}';
30+
background-color: '{{accent-color}}';
3131
&:after {
32-
border-top-color: '{{primary-color}}';
32+
border-top-color: '{{accent-color}}';
3333
}
3434
}
3535
.md-thumb-text {
36-
color: '{{primary-contrast}}';
36+
color: '{{accent-contrast}}';
3737
}
3838

3939
&.md-warn {
40-
.md-track-fill {
40+
.md-track.md-track-fill {
4141
background-color: '{{warn-color}}';
4242
}
4343
.md-thumb:after {
@@ -57,7 +57,7 @@ md-slider.md-THEME_NAME-theme {
5757
}
5858

5959
&.md-primary {
60-
.md-track-fill {
60+
.md-track.md-track-fill {
6161
background-color: '{{primary-color}}';
6262
}
6363
.md-thumb:after {

0 commit comments

Comments
 (0)