Типографская конфигурация после обновления Angular материала до версии 6 - PullRequest
0 голосов
/ 27 мая 2018

После обновления углового материала до версии 6 все заголовочные элементы (h1-h6) не получают правильное семейство шрифтов и размер шрифта.

Вот моя пользовательская конфигурация:

$custom-typography: mat-typography-config(
    $font-family: 'Roboto, sans-serif',
    // Large, one-off headers, usually at the top of the page.
    $display-4:     mat-typography-level(112px, 112px, 300),
    $display-3:     mat-typography-level(56px, 56px, 400),
    $display-2:     mat-typography-level(45px, 48px, 400),
    $display-1:     mat-typography-level(34px, 40px, 400),
    // h1
    $headline:      mat-typography-level(24px, 32px, 400),
    // h2
    $title:         mat-typography-level(20px, 32px, 500),
    // h3
    $subheading-2:  mat-typography-level(16px, 28px, 400),
    // h4
    $subheading-1:  mat-typography-level(15px, 24px, 400),
    // Bolder body text.
    $body-2:        mat-typography-level(14px, 24px, 500),
    // Base body text.
    $body-1:        mat-typography-level(18px, 20px, 400),
    // Smaller body and hint text.
    $caption:       mat-typography-level(12px, 20px, 400),
    // Buttons and anchors.
    $button:        mat-typography-level(18px, 14px, 300),
    // Line-height must be unit-less fraction of the font-size.
    $input:         mat-typography-level(18px, 1.2, 300)
);

@include mat-core($custom-typography);

1 Ответ

0 голосов
/ 28 мая 2018

Проблема в моем случае заключалась в отсутствии класса mat-typography.Когда я сделал обновление до angular 6, я создал новый проект, а затем просто скопировал модули по одному, исправляя все необходимое после обновления.Я только что передал файл index.hml и забыл добавить класс mat-typography к элементу body

...