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

Commit

Permalink
feat(typography): Implement mdc-typography-button directive (#148)
Browse files Browse the repository at this point in the history
Closes #142
  • Loading branch information
trimox authored Sep 9, 2017
1 parent 5c92a6d commit 0727217
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ <h1 mdc-typography-display1>Typography</h1>
</tr>
</thead>
<tbody>
<tr>
<td>mdc-typography-button</td>
<td>
<div mdc-typography-button>Button</div>
</td>
</tr>
<tr>
<td>mdc-typography-body1</td>
<td>
Expand Down
22 changes: 12 additions & 10 deletions src/lib/typography/index.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
import { NgModule } from '@angular/core';

import {
MdcTypography,
MdcAdjustMarginDirective,
MdcBody1Directive,
MdcBody2Directive,
MdcButtonDirective,
MdcCaptionDirective,
MdcDisplay1Directive,
MdcDisplay2Directive,
MdcDisplay3Directive,
MdcDisplay4Directive,
MdcHeadlineDirective,
MdcTitleDirective,
MdcSubheading1Directive,
MdcSubheading2Directive,
MdcBody1Directive,
MdcBody2Directive,
MdcCaptionDirective
MdcTitleDirective,
MdcTypography,
} from './typography.directive';

const TYPOGRAPHY_DIRECTIVES = [
MdcTypography,
MdcAdjustMarginDirective,
MdcBody1Directive,
MdcBody2Directive,
MdcButtonDirective,
MdcCaptionDirective,
MdcDisplay1Directive,
MdcDisplay2Directive,
MdcDisplay3Directive,
MdcDisplay4Directive,
MdcHeadlineDirective,
MdcTitleDirective,
MdcSubheading1Directive,
MdcSubheading2Directive,
MdcBody1Directive,
MdcBody2Directive,
MdcCaptionDirective
MdcTitleDirective,
MdcTypography,
];

@NgModule({
Expand Down
7 changes: 7 additions & 0 deletions src/lib/typography/typography.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,10 @@ export class MdcBody1Directive {
export class MdcCaptionDirective {
@HostBinding('class.mdc-typography--caption') isHostClass = true;
}

@Directive({
selector: '[mdc-typography-button]'
})
export class MdcButtonDirective {
@HostBinding('class.mdc-typography--button') isHostClass = true;
}

0 comments on commit 0727217

Please sign in to comment.