Skip to content

Commit a9bc5fa

Browse files
dozingcatjelbourn
authored andcommitted
chore: use md-icon instead of <i> in demos. (#345)
1 parent f4a7266 commit a9bc5fa

File tree

13 files changed

+64
-61
lines changed

13 files changed

+64
-61
lines changed

src/components/button/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,23 @@ There are five types of buttons:
2727
* Defaults background to "accent" palette defined in theme
2828
* Box shadow applied
2929
* 40 by 40 px
30-
30+
3131
Each is an attribute directive that you can add to a `button` or `a` tag. You can provide custom content to the button by inserting it
3232
between the tags, as you would with a normal button.
33-
33+
3434
Example:
35-
35+
3636
```html
3737
<button md-button>FLAT</button>
3838
<button md-raised-button>RAISED</button>
3939
<button md-icon-button>
40-
<i class="material-icons md-24">favorite</i>
40+
<md-icon class="md-24">favorite</md-icon>
4141
</button>
4242
<button md-fab>
43-
<i class="material-icons md-24">add</i>
43+
<md-icon class="md-24">add</md-icon>
4444
</button>
4545
<button md-mini-fab>
46-
<i class="material-icons md-24">add</i>
46+
<md-icon class="md-24">add</md-icon>
4747
</button>
4848
```
4949

@@ -53,13 +53,13 @@ Output:
5353

5454
### Theming
5555

56-
All button types can be themed to match your "primary" palette, your "accent" palette, or your "warn" palette using the `color` attribute.
56+
All button types can be themed to match your "primary" palette, your "accent" palette, or your "warn" palette using the `color` attribute.
5757
Simply pass in the palette name.
5858

59-
In flat buttons, the palette chosen will affect the text color, while in other buttons, it affects the background.
59+
In flat buttons, the palette chosen will affect the text color, while in other buttons, it affects the background.
6060

6161
Example:
62-
62+
6363
```html
6464
<button md-raised-button color="primary">PRIMARY</button>
6565
<button md-raised-button color="accent">ACCENT</button>
@@ -90,8 +90,8 @@ Output:
9090
* In high contrast mode, a strong border is added to the button to make it easier to see.
9191
* Button focus events originating from the keyboard will retain focus styles, while button focus events from the mouse will not.
9292
* As `md-button` is added to an existing `button` or `a` tag, it enjoys all the accessibility natively built into these elements.
93-
94-
93+
94+
9595
### Upcoming work
9696

9797
We will also be adding ink ripples to buttons in an upcoming milestone.

src/components/button/_button-base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ $md-mini-fab-padding: 8px !default;
107107
height: $size;
108108
padding: 0;
109109

110-
i {
110+
i, md-icon {
111111
padding: $padding 0;
112112
}
113113

src/components/icon/icon.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,5 @@ md-icon {
1313
display: inline-block;
1414
fill: currentColor;
1515
height: $md-icon-size;
16-
margin: auto;
17-
vertical-align: middle;
1816
width: $md-icon-size;
1917
}

src/components/list/README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Output:
3232

3333
### Multi-line lists
3434

35-
If your list requires multiple lines per list item, annotate each line with an `md-line` attribute.
36-
You can use whichever heading tag is appropriate for your DOM hierarchy (doesn't have to be `h3`),
35+
If your list requires multiple lines per list item, annotate each line with an `md-line` attribute.
36+
You can use whichever heading tag is appropriate for your DOM hierarchy (doesn't have to be `h3`),
3737
as long as the `md-line` attribute is included.
3838

3939
```html
@@ -62,13 +62,13 @@ Two line list output:
6262

6363
<img src="https://material.angularjs.org/material2_assets/list/two-line-list.png">
6464

65-
Three line list output:
65+
Three line list output:
6666

6767
<img src="https://material.angularjs.org/material2_assets/list/three-line-list.png">
6868

6969
### Lists with avatars
7070

71-
To include an avatar, add an image tag with an `md-list-avatar` attribute.
71+
To include an avatar, add an image tag with an `md-list-avatar` attribute.
7272

7373
```html
7474
<md-list>
@@ -86,11 +86,11 @@ To include an avatar, add an image tag with an `md-list-avatar` attribute.
8686
Output:
8787

8888
<img src="https://material.angularjs.org/material2_assets/list/list-with-avatar-2.png">
89-
89+
9090
### Dense lists
91-
Lists are also available in "dense layout" mode, which shrinks the font size and height of the list
92-
to suit UIs that may need to display more information. To enable this mode, add a `dense` attribute
93-
to the main `md-list` tag.
91+
Lists are also available in "dense layout" mode, which shrinks the font size and height of the list
92+
to suit UIs that may need to display more information. To enable this mode, add a `dense` attribute
93+
to the main `md-list` tag.
9494

9595

9696
```html
@@ -114,17 +114,17 @@ use `<md-divider>` tags.
114114
<md-list>
115115
<h3 md-subheader>Folders</h3>
116116
<md-list-item *ngFor="#folder of folders">
117-
<i md-list-avatar class="material-icons">folder</i>
117+
<md-icon md-list-avatar>folder</md-icon>
118118
<h4 md-line>{{folder.name}}</h4>
119119
<p md-line class="demo-2"> {{folder.updated}} </p>
120120
</md-list-item>
121121
<md-divider></md-divider>
122122
<h3 md-subheader>Notes</h3>
123123
<md-list-item *ngFor="#note of notes">
124-
<i md-list-avatar class="material-icons">note</i>
124+
<md-icon md-list-avatar>note</md-icon>
125125
<h4 md-line>{{note.name}}</h4>
126126
<p md-line class="demo-2"> {{note.updated}} </p>
127-
</md-list-item>
127+
</md-list-item>
128128
</md-list>
129129
```
130130

@@ -151,13 +151,13 @@ If you require a more complex nav list (e.g. with more than one target per item)
151151
<md-list-item *ngFor="#link of links">
152152
<a md-line href="...">{{ link }}</a>
153153
<button md-icon-button (click)="showInfo(link)">
154-
<i class="material-icons">info</i>
154+
<md-icon>info</md-icon>
155155
</button>
156156
</md-list-item>
157157
</md-nav-list>
158158
```
159159

160160
### Lists with secondary text
161-
Secondary text styling will be part of a broader typography module to
162-
[come later](https://github.com/angular/material2/issues/205), and won’t be implemented as part of this component
161+
Secondary text styling will be part of a broader typography module to
162+
[come later](https://github.com/angular/material2/issues/205), and won’t be implemented as part of this component
163163
specifically. Gray text in the examples above comes from a "demo-2" class added manually by the demo.

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
<button md-button>flat</button>
44
<button md-raised-button>raised</button>
55
<button md-fab>
6-
<i class="material-icons md-24">check</i>
6+
<md-icon class="md-24">check</md-icon>
77
</button>
88
<button md-mini-fab>
9-
<i class="material-icons md-24">check</i>
9+
<md-icon class="md-24">check</md-icon>
1010
</button>
1111
</section>
1212

1313
<section>
1414
<a href="http://www.google.com" md-button color="primary">link</a>
1515
<a href="http://www.google.com" md-raised-button>link</a>
1616
<a href="http://www.google.com" md-fab>
17-
<i class="material-icons md-24">check</i>
17+
<md-icon class="md-24">check</md-icon>
1818
</a>
1919
<a href="http://www.google.com" md-mini-fab>
20-
<i class="material-icons md-24">check</i>
20+
<md-icon class="md-24">check</md-icon>
2121
</a>
2222
</section>
2323

@@ -35,27 +35,27 @@
3535

3636
<section>
3737
<button md-fab color="primary">
38-
<i class="material-icons md-24">home</i>
38+
<md-icon class="md-24">home</md-icon>
3939
</button>
4040
<button md-fab color="accent">
41-
<i class="material-icons md-24">favorite</i>
41+
<md-icon class="md-24">favorite</md-icon>
4242
</button>
4343
<button md-fab color="warn">
44-
<i class="material-icons md-24">feedback</i>
44+
<md-icon class="md-24">feedback</md-icon>
4545
</button>
4646
</section>
4747

4848
<section>
4949
<button md-icon-button color="primary">
50-
<i class="material-icons md-24">menu</i>
50+
<md-icon class="md-24">menu</md-icon>
5151
</button>
5252

5353
<button md-icon-button color="accent">
54-
<i class="material-icons md-24">favorite</i>
54+
<md-icon class="md-24">favorite</md-icon>
5555
</button>
5656

5757
<button md-icon-button>
58-
<i class="material-icons md-24">more_vert</i>
58+
<md-icon class="md-24">more_vert</md-icon>
5959
</button>
6060
</section>
6161

@@ -69,11 +69,11 @@
6969
<a href="http://www.google.com" md-button color="accent" [disabled]="isDisabled">off</a>
7070
<button md-raised-button color="primary" [disabled]="isDisabled">off</button>
7171
<button md-mini-fab [disabled]="isDisabled">
72-
<i class="material-icons md-24">check</i>
72+
<md-icon class="md-24">check</md-icon>
7373
</button>
7474

7575
<button md-icon-button color="accent" [disabled]="isDisabled">
76-
<i class="material-icons md-24">favorite</i>
76+
<md-icon class="md-24">favorite</md-icon>
7777
</button>
7878
</section>
7979
<section>

src/demo-app/button/button-demo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import {Component} from 'angular2/core';
22
import {MdButton, MdAnchor} from '../../components/button/button';
3+
import {MdIcon} from '../../components/icon/icon';
34

45
@Component({
56
selector: 'button-demo',
67
templateUrl: 'demo-app/button/button-demo.html',
78
styleUrls: ['demo-app/button/button-demo.css'],
8-
directives: [MdButton, MdAnchor]
9+
directives: [MdButton, MdAnchor, MdIcon]
910
})
1011
export class ButtonDemo {
1112
isDisabled: boolean = false;

src/demo-app/input/input-demo.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@
8585
<p>
8686
<md-input>
8787
<md-placeholder>
88-
I <i class="material-icons demo-icons">favorite</i> <b>bold</b> placeholder
88+
I <md-icon class="demo-icons">favorite</md-icon> <b>bold</b> placeholder
8989
</md-placeholder>
9090
<md-hint>
91-
I also <i class="material-icons demo-icons">home</i> <i>italic</i> hint labels
91+
I also <md-icon class="demo-icons">home</md-icon> <i>italic</i> hint labels
9292
</md-hint>
9393
</md-input>
9494
</p>
@@ -122,7 +122,7 @@
122122
<br/>
123123
Both:
124124
<md-input #email placeholder="Email Address" value="angular-core" align="end">
125-
<span md-prefix><i [class.primary]="email.focused" class="material-icons demo-icons demo-transform">email</i>&nbsp;</span>
125+
<span md-prefix><md-icon [class.primary]="email.focused" class="demo-icons demo-transform">email</md-icon>&nbsp;</span>
126126
<span md-suffix class="demo-transform" [class.primary]="email.focused">&nbsp;@gmail.com</span>
127127
</md-input>
128128
</p>

src/demo-app/input/input-demo.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414
.demo-icons {
1515
font-size: 100%;
16+
height: inherit;
1617
vertical-align: top;
18+
width: inherit;
1719
}
1820

1921
.demo-transform {

src/demo-app/input/input-demo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {MD_INPUT_DIRECTIVES} from '../../components/input/input';
33
import {MdButton} from '../../components/button/button';
44
import {MdCard} from '../../components/card/card';
55
import {MdCheckbox} from '../../components/checkbox/checkbox';
6+
import {MdIcon} from '../../components/icon/icon';
67
import {MdToolbar} from '../../components/toolbar/toolbar';
78

89

@@ -12,7 +13,7 @@ let max = 5;
1213
selector: 'input-demo',
1314
templateUrl: 'demo-app/input/input-demo.html',
1415
styleUrls: ['demo-app/input/input-demo.css'],
15-
directives: [MdCard, MdCheckbox, MdButton, MdToolbar, MD_INPUT_DIRECTIVES]
16+
directives: [MdCard, MdCheckbox, MdButton, MdIcon, MdToolbar, MD_INPUT_DIRECTIVES]
1617
})
1718
export class InputDemo {
1819
dividerColor: boolean;

src/demo-app/list/list-demo.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ <h2>Nav lists</h2>
8181
<md-list-item *ngFor="#link of links">
8282
<a md-line href="http://www.google.com">{{ link.name }}</a>
8383
<button md-icon-button (click)="infoClicked=!infoClicked">
84-
<i class="material-icons">info</i>
84+
<md-icon>info</md-icon>
8585
</button>
8686
</md-list-item>
8787
</md-nav-list>
@@ -96,7 +96,7 @@ <h2>Nav lists</h2>
9696
<md-list-item *ngFor="#link of links">
9797
<a md-line href="http://www.google.com">{{ link.name }}</a>
9898
<button md-icon-button (click)="infoClicked=!infoClicked">
99-
<i class="material-icons">info</i>
99+
<md-icon class="material-icons">info</md-icon>
100100
</button>
101101
</md-list-item>
102102
</md-nav-list>

0 commit comments

Comments
 (0)