[AAE-13640] Custom theme fix (#3122)

This commit is contained in:
Bartosz Sekula
2023-04-14 17:21:43 +02:00
committed by GitHub
parent 88388937e0
commit 2b2ce642ae

View File

@@ -2,10 +2,7 @@
@use '@angular/material' as mat; @use '@angular/material' as mat;
@import '../variables/font-family'; @import '../variables/font-family';
@function get-mat-typography( @function get-mat-typography($base-font-size, $font-family) {
$base-font-size,
$font-family
) {
$custom-typography: mat.define-typography-config( $custom-typography: mat.define-typography-config(
$font-family: 'Muli, Roboto, "Helvetica Neue", sans-serif', $font-family: 'Muli, Roboto, "Helvetica Neue", sans-serif',
$display-4: mat.define-typography-level(112px, 112px, 300), $display-4: mat.define-typography-level(112px, 112px, 300),
@@ -46,34 +43,52 @@
@if $font-family { @if $font-family {
@each $key, $level in $custom-typography { @each $key, $level in $custom-typography {
@if type-of($level) == 'map' { @if type-of($level) == 'map' {
$new-level: map-merge($level, (font-family: $font-family)); $new-level: map-merge(
$custom-typography: map-merge($custom-typography, ($key: $new-level)); $level,
(
font-family: $font-family
)
);
$custom-typography: map-merge(
$custom-typography,
(
$key: $new-level
)
);
} }
} }
$custom-typography: map-merge($custom-typography, (font-family: $font-family)); $custom-typography: map-merge(
$custom-typography,
(
font-family: $font-family
)
);
} }
@return $custom-typography; @return $custom-typography;
}; }
@function get-custom-adf-font-sizes() { @function get-custom-adf-font-sizes() {
@return ( @return (
'theme-adf-icon-1-font-size': 1.2rem, 'theme-adf-icon-1-font-size': 1.2rem,
'theme-adf-picture-1-font-size': 1.28rem, 'theme-adf-picture-1-font-size': 1.28rem,
'theme-adf-task-footer-font-size': 1.28rem, 'theme-adf-task-footer-font-size': 1.28rem,
'theme-adf-task-title-font-size': 1.28rem 'theme-adf-task-title-font-size': 1.28rem,
) 'theme-adf-spacing': 16px
}; );
}
@mixin base-font-size($font-size) { @mixin base-font-size($font-size) {
html, body { html,
body {
font-size: $font-size !important; font-size: $font-size !important;
} }
}; }
@mixin base-font-family($font-family) { @mixin base-font-family($font-family) {
html, body { html,
body {
font-family: $font-family !important; font-family: $font-family !important;
} }
}; }