Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 51a166a

Browse files
committed
style-guide(add-a11y): Add accessibility quick wins
1 parent 0664a27 commit 51a166a

17 files changed

+387
-1
lines changed

public/docs/_examples/style-guide/e2e-spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,5 @@ describe('Style Guide', function () {
206206
let button = element(by.tagName('sg-app > toh-hero-button > button'));
207207
expect(button.getText()).toBe('OK');
208208
});
209+
209210
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'sg-app',
5+
template: `<div>I am a page set to US English</div>`
6+
})
7+
export class AppComponent {
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- avoid -->
2+
3+
<!DOCTYPE html>
4+
<!-- #docregion page-lang-->
5+
<html>
6+
<!-- #enddocregion page-lang-->
7+
<head>
8+
<meta charset="UTF-8">
9+
<title>Title</title>
10+
</head>
11+
<body>
12+
<!--Some content-->
13+
</body>
14+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<!-- #docregion page-lang-->
3+
<html lang="en-US">
4+
<!-- #enddocregion page-lang -->
5+
<head>
6+
<meta charset="UTF-8">
7+
<title>Title</title>
8+
</head>
9+
<body>
10+
<!--Some content-->
11+
</body>
12+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './app.component';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* #docregion */
2+
/* avoid */
3+
4+
:focus {
5+
outline: 0;
6+
}
7+
8+
/* or */
9+
10+
:focus {
11+
outline: none;
12+
}
13+
/* #enddocregion */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<label>Name:
2+
<input [(ngModel)]="name">
3+
</label>
4+
<label>Surname:
5+
<input [(ngModel)]="surname">
6+
</label>
7+
{{name}}{{surname}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
moduleId: module.id,
5+
selector: 'sg-app',
6+
templateUrl: 'app.component.html'
7+
})
8+
export class AppComponent {
9+
name: string;
10+
surname: string;
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './app.component';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!-- #docregion -->
2+
<!--avoid-->
3+
<div class="button" (click)="saveData()">Press me</div>
4+
<!-- #enddocregion -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.button {
2+
font-family: Arial;
3+
background-color: #eee;
4+
border: none;
5+
padding: 5px 10px;
6+
border-radius: 4px;
7+
margin-bottom: 5px;
8+
width: 75px;
9+
cursor: pointer;
10+
cursor: hand;
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!-- #docregion-->
2+
<button (click)="saveData()">Press me</button>
3+
<!-- #enddocregion -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
moduleId: module.id,
5+
selector: 'sg-app',
6+
templateUrl: 'app.component.html',
7+
styleUrls: ['app.component.css']
8+
})
9+
export class AppComponent {
10+
11+
saveData() {
12+
alert('Button pressed.');
13+
}
14+
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './app.component';

public/docs/_examples/style-guide/ts/app/app.routes.ts

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ import { AppComponent as S0701 } from '../07-01/app';
2626
import { AppComponent as S0703 } from '../07-03/app';
2727
import { AppComponent as S0704 } from '../07-04/app';
2828
import { AppComponent as S0901 } from '../09-01/app';
29+
import { AppComponent as S1001 } from '../10-01/app';
30+
import { AppComponent as S1002 } from '../10-02/app';
31+
import { AppComponent as S1003 } from '../10-03/app';
2932

3033
const routes: RouterConfig = [
3134
{ path: '01-01', component: S0101 },
@@ -54,6 +57,9 @@ const routes: RouterConfig = [
5457
{ path: '07-03', component: S0703 },
5558
{ path: '07-04', component: S0704 },
5659
{ path: '09-01', component: S0901 },
60+
{ path: '10-01', component: S1001 },
61+
{ path: '10-02', component: S1002 },
62+
{ path: '10-03', component: S1003 },
5763
];
5864

5965
export const APP_ROUTER_PROVIDERS = [

public/docs/_examples/style-guide/ts/systemjs.custom.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
'07-01', '07-01/app', '07-01/app/heroes', '07-01/app/heroes/shared',
3030
'07-03', '07-03/app', '07-03/app/heroes', '07-03/app/heroes/hero-list', '07-03/app/heroes/shared',
3131
'07-04', '07-04/app', '07-04/app/heroes', '07-04/app/heroes/shared',
32-
'09-01', '09-01/app', '09-01/app/heroes', '09-01/app/heroes/shared', '09-01/app/heroes/shared/hero-button'
32+
'09-01', '09-01/app', '09-01/app/heroes', '09-01/app/heroes/shared', '09-01/app/heroes/shared/hero-button',
33+
'10-01', '10-01/app',
34+
'10-02', '10-02/app',
35+
'10-03', '10-03/app'
3336
];
3437

3538
var packages = {};

0 commit comments

Comments
 (0)