Skip to content

Commit

Permalink
docs: Component Styles guide for CLI (#19791)
Browse files Browse the repository at this point in the history
  • Loading branch information
wardbell authored and vicb committed Nov 3, 2017
1 parent 5a6efa7 commit 3298c4a
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 133 deletions.
2 changes: 1 addition & 1 deletion aio/content/examples/component-styles/e2e/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Component Style Tests', function () {
let externalH1 = element(by.css('body > h1'));

// Note: sometimes webdriver returns the fontWeight as "normal",
// othertimes as "400", both of which are equal in CSS terms.
// other times as "400", both of which are equal in CSS terms.
expect(componentH1.getCssValue('fontWeight')).toMatch(/normal|400/);
expect(externalH1.getCssValue('fontWeight')).not.toMatch(/normal|400/);
});
Expand Down
3 changes: 2 additions & 1 deletion aio/content/examples/component-styles/plnkr.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"files": [
"!**/*.d.ts",
"!**/*.js",
"!**/*.native.*"
"!**/*.native.*",
"!**/*.[1].*"
],
"tags": ["CSS"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
h1 {
font-weight: normal;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Component, HostBinding } from '@angular/core';
import { Hero } from './hero';

// #docregion
@Component({
selector: 'app-root',
template: `
<h1>Tour of Heroes</h1>
<app-hero-main [hero]="hero"></app-hero-main>
`,
styleUrls: ['./hero-app.component.css']
})
export class HeroAppComponent {
// #enddocregion
hero = new Hero(
'Human Torch',
['Mister Fantastic', 'Invisible Woman', 'Thing']
);

@HostBinding('class') get themeClass() {
return 'theme-light';
}
// #docregion
}
// #enddocregion
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { Hero } from './hero';
selector: 'app-root',
template: `
<h1>Tour of Heroes</h1>
<app-hero-main [hero]=hero></app-hero-main>`,
<app-hero-main [hero]="hero"></app-hero-main>
`,
styles: ['h1 { font-weight: normal; }']
})
export class HeroAppComponent {
Expand Down

0 comments on commit 3298c4a

Please sign in to comment.