Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(typography): allow typography config to be passed via mat-core #5625

Merged
merged 1 commit into from
Jul 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions guides/typography.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ different SASS mixins.
@include angular-material-typography($custom-typography);
```

If you're using Material's theming, you can also pass in your typography config to the
`mat-core` mixin:

```scss
// Override the typography in the core CSS.
@include mat-core($custom-typography);
```

For more details about the typography functions and default config, see the
[source](https://github.com/angular/material2/blob/master/src/lib/core/typography/_typography.scss).

Expand Down
4 changes: 2 additions & 2 deletions src/lib/core/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@import 'typography/all-typography';

// Mixin that renders all of the core styles that are not theme-dependent.
@mixin mat-core() {
@mixin mat-core($typography-config: null) {
// Provides external CSS classes for each elevation value. Each CSS class is formatted as
// `mat-elevation-z$zValue` where `$zValue` corresponds to the z-space to which the element is
// elevated.
Expand All @@ -21,7 +21,7 @@
}
}

@include angular-material-typography();
@include angular-material-typography($typography-config);
@include mat-ripple();
@include mat-option();
@include mat-optgroup();
Expand Down
6 changes: 5 additions & 1 deletion src/lib/core/typography/_all-typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@


// Includes all of the typographic styles.
@mixin angular-material-typography($config: mat-typography-config()) {
@mixin angular-material-typography($config: null) {
@if $config == null {
$config: mat-typography-config();
}

@include mat-base-typography($config);
@include mat-autocomplete-typography($config);
@include mat-button-typography($config);
Expand Down