Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 4a710e4

Browse files
authored
feat: Rename all occurences of property accent to secondary (#139)
In the MD spec, "accent" color was renamed to "secondary" to be more semantically correct. * Rename `button` property `accent` to `secondary` * Rename `icon-toggle` property `accent` to `secondary` * Rename `linear-progress` property `accent` to `secondary` * Rename `tab-bar` property `accentColor` to `secondary` * Rename `tab-bar` property `primaryColor` to `primary` * Update documentation and examples BREAKING CHANGE: The `accent` property on Button, Icon-toggle, Linear-progress was renamed to `secondary`. The `accentColor` and `primaryColor` properties on Tabs was renamed to `accent` and `primary`. Closes #138
1 parent 193140b commit 4a710e4

File tree

8 files changed

+68
-68
lines changed

8 files changed

+68
-68
lines changed

src/demo-app/components/button-demo/button-demo.component.html

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,43 @@ <h1 mdc-typography-display1>Buttons</h1>
2727
</thead>
2828
<tbody>
2929
<tr>
30-
<td>@Input() type: string</td>
30+
<td>type: string</td>
3131
<td>Input type of button (e.g. button, submit).</td>
3232
</tr>
3333
<tr>
34-
<td>@Input() dense: boolean</td>
35-
<td>Compresses the button text to make it slightly smaller.</td>
34+
<td>primary: boolean</td>
35+
<td>Colors the button with the primary theme color.</td>
3636
</tr>
3737
<tr>
38-
<td>@Input() raised: boolean</td>
39-
<td>Elevates the button and creates a colored background.</td>
38+
<td>secondary: boolean</td>
39+
<td>Colors the button with the secondary theme color.</td>
4040
</tr>
4141
<tr>
42-
<td>@Input() compact: boolean</td>
43-
<td>Reduces the amount of horizontal padding in the button.</td>
42+
<td>dense: boolean</td>
43+
<td>Compresses the button text to make it slightly smaller.</td>
4444
</tr>
4545
<tr>
46-
<td>@Input() primary: boolean</td>
47-
<td>Colors the button with the primary color.</td>
46+
<td>raised: boolean</td>
47+
<td>Elevates the button and creates a colored background.</td>
4848
</tr>
4949
<tr>
50-
<td>@Input() accent: boolean</td>
51-
<td>Colors the button with the accent color.</td>
50+
<td>compact: boolean</td>
51+
<td>Reduces the amount of horizontal padding in the button.</td>
5252
</tr>
5353
<tr>
54-
<td>@Input() unelevated: boolean</td>
54+
<td>unelevated: boolean</td>
5555
<td>A button that is flush with the surface.</td>
5656
</tr>
5757
<tr>
58-
<td>@Input() stroked: boolean</td>
58+
<td>stroked: boolean</td>
5959
<td>A button that is flush with the surface and has a visible border.</td>
6060
</tr>
6161
<tr>
62-
<td>@Input() disabled: boolean</td>
62+
<td>disabled: boolean</td>
6363
<td>Disables the button.</td>
6464
</tr>
6565
<tr>
66-
<td>@Input() disableRipple: boolean</td>
66+
<td>disableRipple: boolean</td>
6767
<td>
6868
<pre><code><![CDATA[Disable the ink ripple.
6969
Example: disableRipple="true" or disableRipple]]></code></pre></td>
@@ -95,8 +95,8 @@ <h1 mdc-typography-display1>Buttons</h1>
9595
<button mdc-button [stroked]="true">Stroked</button>
9696
<pre style="background:#000;color:#f8f8f8"><span style="color:#e0c589">&lt;<span style="color:#e0c589">button</span> <span style="color:#e0c589">mdc-button</span> [<span style="color:#e0c589">stroked</span>]=<span style="color:#65b042">"true"</span>></span>Stroked<span style="color:#e0c589">&lt;/<span style="color:#e0c589">button</span>></span>
9797
</pre>
98-
<button mdc-button [accent]="true">Accent</button>
99-
<pre style="background:#000;color:#f8f8f8"><span style="color:#e0c589">&lt;<span style="color:#e0c589">button</span> <span style="color:#e0c589">mdc-button</span> [<span style="color:#e0c589">accent</span>]=<span style="color:#65b042">"true"</span>></span>Accent<span style="color:#e0c589">&lt;/<span style="color:#e0c589">button</span>></span>
98+
<button mdc-button [secondary]="true">Secondary Color</button>
99+
<pre style="background:#000;color:#f8f8f8"><span style="color:#e0c589">&lt;<span style="color:#e0c589">button</span> <span style="color:#e0c589">mdc-button</span> [<span style="color:#e0c589">secondary</span>]=<span style="color:#65b042">"true"</span>></span>Secondary Color<span style="color:#e0c589">&lt;/<span style="color:#e0c589">button</span>></span>
100100
</pre>
101101
<a mdc-button [primary]="true" [raised]="true" href="#/button-demo">Href link</a>
102102
<pre style="background:#000;color:#f8f8f8"><span style="color:#e0c589">&lt;<span style="color:#e0c589">a</span> <span style="color:#e0c589">mdc-button</span>
@@ -117,10 +117,10 @@ <h1 mdc-typography-display1>Buttons</h1>
117117
[<span style="color:#e0c589">compact</span>]=<span style="color:#65b042">"true"</span>
118118
[<span style="color:#e0c589">raised</span>]=<span style="color:#65b042">"true"</span>></span>Compact and Raised<span style="color:#e0c589">&lt;/<span style="color:#e0c589">button</span>></span>
119119
</pre>
120-
<button mdc-button [accent]="true" [raised]="true">Accent and Raised</button>
120+
<button mdc-button [secondary]="true" [raised]="true">Secondary Color and Raised</button>
121121
<pre style="background:#000;color:#f8f8f8"><span style="color:#e0c589">&lt;<span style="color:#e0c589">button</span> <span style="color:#e0c589">mdc-button</span>
122-
[<span style="color:#e0c589">accent</span>]=<span style="color:#65b042">"true"</span>
123-
[<span style="color:#e0c589">raised</span>]=<span style="color:#65b042">"true"</span>></span>Accent and Raised<span style="color:#e0c589">&lt;/<span style="color:#e0c589">button</span>></span>
122+
[<span style="color:#e0c589">secondary</span>]=<span style="color:#65b042">"true"</span>
123+
[<span style="color:#e0c589">raised</span>]=<span style="color:#65b042">"true"</span>></span>Secondary Color and Raised<span style="color:#e0c589">&lt;/<span style="color:#e0c589">button</span>></span>
124124
</pre>
125125
<button mdc-button [primary]="true" [raised]="true">Primary and Raised</button>
126126
<pre style="background:#000;color:#f8f8f8"><span style="color:#e0c589">&lt;<span style="color:#e0c589">button</span> <span style="color:#e0c589">mdc-button</span>
@@ -131,5 +131,5 @@ <h1 mdc-typography-display1>Buttons</h1>
131131
<pre style="background:#000;color:#f8f8f8"><span style="color:#e0c589">&lt;<span style="color:#e0c589">button</span> <span style="color:#e0c589">mdc-button</span>
132132
[<span style="color:#e0c589">primary</span>]=<span style="color:#65b042">"true"</span>
133133
[<span style="color:#e0c589">disabled</span>]=<span style="color:#65b042">"true"</span>></span>Disabled<span style="color:#e0c589">&lt;/<span style="color:#e0c589">button</span>></span>
134-
</pre> </div>
135-
<mdc-snackbar #snack></mdc-snackbar>
134+
</pre>
135+
<mdc-snackbar #snack></mdc-snackbar></div>

src/demo-app/components/icon-toggle-demo/icon-toggle-demo.component.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ <h1 mdc-typography-display1>Icon Toggle Buttons</h1>
5353
</tr>
5454
<tr>
5555
<td>primary: boolean</td>
56-
<td>Colors the button with the primary color.</td>
56+
<td>Colors the button with the primary theme color.</td>
5757
</tr>
5858
<tr>
59-
<td>accent: boolean</td>
60-
<td>Colors the button with the accent color.</td>
59+
<td>secondary: boolean</td>
60+
<td>Colors the button with the secondary theme color.</td>
6161
</tr>
6262
<tr>
6363
<td>disabled: boolean</td>
@@ -108,7 +108,7 @@ <h1 mdc-typography-display1>Icon Toggle Buttons</h1>
108108
</mdc-form-field>
109109
<mdc-form-field>
110110
<mdc-checkbox [(ngModel)]="isAccent"></mdc-checkbox>
111-
<label>Accent Color</label>
111+
<label>Secondary Color</label>
112112
</mdc-form-field>
113113
<mdc-form-field>
114114
<mdc-checkbox [(ngModel)]="isDisabled"></mdc-checkbox>
@@ -124,7 +124,7 @@ <h1 mdc-typography-display1>Icon Toggle Buttons</h1>
124124
[(ngModel)]="isOn"
125125
[disabled]="isDisabled"
126126
[primary]="isPrimary"
127-
[accent]="isAccent"
127+
[secondary]="isAccent"
128128
iconOn="favorite" iconOff="favorite_border"
129129
labelOn="Add to Favorites" labelOff="Remove from Favorites">
130130
</mdc-icon-toggle>
@@ -135,7 +135,7 @@ <h1 mdc-typography-display1>Icon Toggle Buttons</h1>
135135
[(<span style="color:#89bdff">ngModel</span>)]=<span style="color:#65b042">"mymodel"</span>
136136
[<span style="color:#89bdff">disabled</span>]=<span style="color:#65b042">"false"</span>
137137
[<span style="color:#89bdff">primary</span>]=<span style="color:#65b042">"false"</span>
138-
[<span style="color:#89bdff">accent</span>]=<span style="color:#65b042">"false"</span>
138+
[<span style="color:#89bdff">secondary</span>]=<span style="color:#65b042">"false"</span>
139139
<span style="color:#89bdff">iconOn</span>=<span style="color:#65b042">"favorite"</span> <span style="color:#89bdff">iconOff</span>=<span style="color:#65b042">"favorite_border"</span>
140140
<span style="color:#89bdff">labelOn</span>=<span style="color:#65b042">"Add to Favorites"</span> <span style="color:#89bdff">labelOff</span>=<span style="color:#65b042">"Remove from Favorites"</span>></span>
141141
<span style="color:#89bdff">&lt;/<span style="color:#89bdff">mdc</span><span style="color:#89bdff">-icon-toggle</span>></span>

src/demo-app/components/linear-progress-demo/linear-progress-demo.component.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ <h1 mdc-typography-display1>Linear Progress</h1>
2424
</thead>
2525
<tbody>
2626
<tr>
27-
<td>@Input() indeterminate: boolean</td>
27+
<td>indeterminate: boolean</td>
2828
<td>Puts the linear progress indicator in an indeterminate state.</td>
2929
</tr>
3030
<tr>
31-
<td>@Input() reversed: boolean</td>
31+
<td>reversed: boolean</td>
3232
<td>Reverses the direction of the linear progress indicator.</td>
3333
</tr>
3434
<tr>
35-
<td>@Input() accent: boolean</td>
36-
<td>Colors the button with the accent color.</td>
35+
<td>secondary: boolean</td>
36+
<td>Colors the button with the secondary theme color.</td>
3737
</tr>
3838
</tbody>
3939
<thead>
@@ -81,10 +81,10 @@ <h1 mdc-typography-display1>Linear Progress</h1>
8181
[<span style="color:#89bdff">indeterminate</span>]=<span style="color:#65b042">"true"</span>></span><span style="color:#89bdff">&lt;/<span style="color:#89bdff">mdc</span><span style="color:#89bdff">-linear-progress</span>></span>
8282
</pre> </div>
8383
<div fxLayout="column" class="mdc-padding">
84-
<mdc-linear-progress [indeterminate]="true" [accent]="true"></mdc-linear-progress>
85-
<p>Accent</p>
84+
<mdc-linear-progress [indeterminate]="true" [secondary]="true"></mdc-linear-progress>
85+
<p>Secondary Color</p>
8686
<pre style="background:#000;color:#f8f8f8"><span style="color:#89bdff">&lt;<span style="color:#89bdff">mdc</span><span style="color:#89bdff">-linear-progress</span>
8787
[<span style="color:#89bdff">indeterminate</span>]=<span style="color:#65b042">"true"</span>
88-
[<span style="color:#89bdff">accent</span>]=<span style="color:#65b042">"true"</span>></span><span style="color:#89bdff">&lt;/<span style="color:#89bdff">mdc</span><span style="color:#89bdff">-linear-progress</span>></span>
88+
[<span style="color:#89bdff">secondary</span>]=<span style="color:#65b042">"true"</span>></span><span style="color:#89bdff">&lt;/<span style="color:#89bdff">mdc</span><span style="color:#89bdff">-linear-progress</span>></span>
8989
</pre> </div>
9090
</div>

0 commit comments

Comments
 (0)