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

Commit

Permalink
style-guide(add-a11y): Add accessibility quick wins
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmeroSteyn committed Jul 10, 2016
1 parent 0664a27 commit 51a166a
Show file tree
Hide file tree
Showing 17 changed files with 387 additions and 1 deletion.
1 change: 1 addition & 0 deletions public/docs/_examples/style-guide/e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,5 @@ describe('Style Guide', function () {
let button = element(by.tagName('sg-app > toh-hero-button > button'));
expect(button.getText()).toBe('OK');
});

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Component } from '@angular/core';

@Component({
selector: 'sg-app',
template: `<div>I am a page set to US English</div>`
})
export class AppComponent {
}
14 changes: 14 additions & 0 deletions public/docs/_examples/style-guide/ts/10-01/app/index.avoid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- avoid -->

<!DOCTYPE html>
<!-- #docregion page-lang-->
<html>
<!-- #enddocregion page-lang-->
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<!--Some content-->
</body>
</html>
12 changes: 12 additions & 0 deletions public/docs/_examples/style-guide/ts/10-01/app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<!-- #docregion page-lang-->
<html lang="en-US">
<!-- #enddocregion page-lang -->
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<!--Some content-->
</body>
</html>
1 change: 1 addition & 0 deletions public/docs/_examples/style-guide/ts/10-01/app/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './app.component';
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* #docregion */
/* avoid */

:focus {
outline: 0;
}

/* or */

:focus {
outline: none;
}
/* #enddocregion */
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<label>Name:
<input [(ngModel)]="name">
</label>
<label>Surname:
<input [(ngModel)]="surname">
</label>
{{name}}{{surname}}
11 changes: 11 additions & 0 deletions public/docs/_examples/style-guide/ts/10-02/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component } from '@angular/core';

@Component({
moduleId: module.id,
selector: 'sg-app',
templateUrl: 'app.component.html'
})
export class AppComponent {
name: string;
surname: string;
}
1 change: 1 addition & 0 deletions public/docs/_examples/style-guide/ts/10-02/app/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './app.component';
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- #docregion -->
<!--avoid-->
<div class="button" (click)="saveData()">Press me</div>
<!-- #enddocregion -->
11 changes: 11 additions & 0 deletions public/docs/_examples/style-guide/ts/10-03/app/app.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.button {
font-family: Arial;
background-color: #eee;
border: none;
padding: 5px 10px;
border-radius: 4px;
margin-bottom: 5px;
width: 75px;
cursor: pointer;
cursor: hand;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- #docregion-->
<button (click)="saveData()">Press me</button>
<!-- #enddocregion -->
15 changes: 15 additions & 0 deletions public/docs/_examples/style-guide/ts/10-03/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component } from '@angular/core';

@Component({
moduleId: module.id,
selector: 'sg-app',
templateUrl: 'app.component.html',
styleUrls: ['app.component.css']
})
export class AppComponent {

saveData() {
alert('Button pressed.');
}

}
1 change: 1 addition & 0 deletions public/docs/_examples/style-guide/ts/10-03/app/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './app.component';
6 changes: 6 additions & 0 deletions public/docs/_examples/style-guide/ts/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import { AppComponent as S0701 } from '../07-01/app';
import { AppComponent as S0703 } from '../07-03/app';
import { AppComponent as S0704 } from '../07-04/app';
import { AppComponent as S0901 } from '../09-01/app';
import { AppComponent as S1001 } from '../10-01/app';
import { AppComponent as S1002 } from '../10-02/app';
import { AppComponent as S1003 } from '../10-03/app';

const routes: RouterConfig = [
{ path: '01-01', component: S0101 },
Expand Down Expand Up @@ -54,6 +57,9 @@ const routes: RouterConfig = [
{ path: '07-03', component: S0703 },
{ path: '07-04', component: S0704 },
{ path: '09-01', component: S0901 },
{ path: '10-01', component: S1001 },
{ path: '10-02', component: S1002 },
{ path: '10-03', component: S1003 },
];

export const APP_ROUTER_PROVIDERS = [
Expand Down
5 changes: 4 additions & 1 deletion public/docs/_examples/style-guide/ts/systemjs.custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
'07-01', '07-01/app', '07-01/app/heroes', '07-01/app/heroes/shared',
'07-03', '07-03/app', '07-03/app/heroes', '07-03/app/heroes/hero-list', '07-03/app/heroes/shared',
'07-04', '07-04/app', '07-04/app/heroes', '07-04/app/heroes/shared',
'09-01', '09-01/app', '09-01/app/heroes', '09-01/app/heroes/shared', '09-01/app/heroes/shared/hero-button'
'09-01', '09-01/app', '09-01/app/heroes', '09-01/app/heroes/shared', '09-01/app/heroes/shared/hero-button',
'10-01', '10-01/app',
'10-02', '10-02/app',
'10-03', '10-03/app'
];

var packages = {};
Expand Down
Loading

0 comments on commit 51a166a

Please sign in to comment.