@ng-matero/extensions 16.3.1 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_index.scss +2 -1
- package/alert/_alert-theme.scss +54 -24
- package/alert/alert.d.ts +3 -6
- package/alert/alert.scss +3 -3
- package/button/_button-theme.scss +6 -4
- package/button/button-loading.d.ts +5 -10
- package/button/button-module.d.ts +5 -5
- package/checkbox-group/checkbox-group.d.ts +4 -9
- package/colorpicker/_colorpicker-theme.scss +62 -34
- package/colorpicker/colorpicker-input.d.ts +1 -3
- package/colorpicker/colorpicker-toggle.d.ts +2 -3
- package/colorpicker/colorpicker.d.ts +5 -6
- package/core/color/_all-color.scss +7 -18
- package/core/density/_all-density.scss +28 -14
- package/core/mdc-helpers/_mdc-helpers.scss +27 -238
- package/core/style/_sass-utils.scss +13 -1
- package/core/style/_validation.scss +43 -0
- package/core/theming/_all-theme.scss +32 -17
- package/core/theming/_inspection.scss +303 -0
- package/core/theming/_m2-inspection.scss +266 -0
- package/core/tokens/_token-utils.scss +4 -5
- package/core/tokens/m2/mdc/_plain-tooltip.scss +21 -29
- package/core/tokens/m2/mtx/_alert.scss +14 -15
- package/core/tokens/m2/mtx/_colorpicker.scss +8 -11
- package/core/tokens/m2/mtx/_datetimepicker.scss +38 -47
- package/core/tokens/m2/mtx/_drawer.scss +9 -10
- package/core/tokens/m2/mtx/_grid.scss +34 -22
- package/core/tokens/m2/mtx/_loader.scss +6 -6
- package/core/tokens/m2/mtx/_popover.scss +10 -11
- package/core/tokens/m2/mtx/_progress.scss +18 -17
- package/core/tokens/m2/mtx/_select.scss +65 -25
- package/core/tokens/m2/mtx/_split.scss +8 -11
- package/core/typography/_all-typography.scss +40 -0
- package/core/typography/_typography.scss +1 -579
- package/datetimepicker/_datetimepicker-theme.scss +75 -48
- package/datetimepicker/calendar.d.ts +7 -14
- package/datetimepicker/calendar.scss +16 -4
- package/datetimepicker/clock.d.ts +1 -2
- package/datetimepicker/datetimepicker-content.scss +3 -3
- package/datetimepicker/datetimepicker-input.d.ts +1 -2
- package/datetimepicker/datetimepicker-toggle.d.ts +2 -3
- package/datetimepicker/datetimepicker.d.ts +15 -26
- package/datetimepicker/month-view.d.ts +1 -1
- package/datetimepicker/multi-year-view.d.ts +1 -1
- package/datetimepicker/time.d.ts +3 -5
- package/datetimepicker/time.scss +2 -2
- package/datetimepicker/year-view.d.ts +1 -1
- package/drawer/_drawer-theme.scss +55 -22
- package/drawer/drawer-container.scss +25 -4
- package/esm2022/alert/alert-module.mjs +4 -4
- package/esm2022/alert/alert.mjs +11 -18
- package/esm2022/button/button-loading.mjs +13 -23
- package/esm2022/button/button-module.mjs +6 -7
- package/esm2022/checkbox-group/checkbox-group-module.mjs +4 -4
- package/esm2022/checkbox-group/checkbox-group.mjs +18 -29
- package/esm2022/colorpicker/colorpicker-input.mjs +13 -14
- package/esm2022/colorpicker/colorpicker-module.mjs +4 -4
- package/esm2022/colorpicker/colorpicker-toggle.mjs +18 -18
- package/esm2022/colorpicker/colorpicker.mjs +31 -36
- package/esm2022/column-resize/column-resize-directives/column-resize-flex.mjs +4 -4
- package/esm2022/column-resize/column-resize-directives/column-resize.mjs +4 -4
- package/esm2022/column-resize/column-resize-module.mjs +4 -4
- package/esm2022/column-resize/column-resize-notifier.mjs +7 -7
- package/esm2022/column-resize/column-resize.mjs +3 -3
- package/esm2022/column-resize/column-size-store.mjs +3 -3
- package/esm2022/column-resize/event-dispatcher.mjs +4 -4
- package/esm2022/column-resize/overlay-handle.mjs +3 -3
- package/esm2022/column-resize/resizable.mjs +3 -3
- package/esm2022/column-resize/resize-strategy.mjs +13 -13
- package/esm2022/core/datetime/datetime.module.mjs +8 -8
- package/esm2022/core/datetime/native-datetime-adapter.mjs +5 -5
- package/esm2022/core/pipes/is-template-ref.pipe.mjs +3 -3
- package/esm2022/core/pipes/pipes.module.mjs +4 -4
- package/esm2022/core/pipes/to-observable.pipe.mjs +3 -3
- package/esm2022/datetimepicker/calendar-body.mjs +5 -6
- package/esm2022/datetimepicker/calendar.mjs +30 -47
- package/esm2022/datetimepicker/clock.mjs +10 -9
- package/esm2022/datetimepicker/datetimepicker-input.mjs +14 -15
- package/esm2022/datetimepicker/datetimepicker-intl.mjs +3 -3
- package/esm2022/datetimepicker/datetimepicker-module.mjs +4 -4
- package/esm2022/datetimepicker/datetimepicker-toggle.mjs +18 -18
- package/esm2022/datetimepicker/datetimepicker.mjs +57 -80
- package/esm2022/datetimepicker/month-view.mjs +8 -9
- package/esm2022/datetimepicker/multi-year-view.mjs +8 -8
- package/esm2022/datetimepicker/time.mjs +18 -24
- package/esm2022/datetimepicker/year-view.mjs +8 -8
- package/esm2022/dialog/dialog-container.mjs +7 -7
- package/esm2022/dialog/dialog-module.mjs +4 -4
- package/esm2022/dialog/dialog.mjs +4 -4
- package/esm2022/drawer/drawer-container.mjs +7 -7
- package/esm2022/drawer/drawer-module.mjs +4 -4
- package/esm2022/drawer/drawer.mjs +5 -5
- package/esm2022/grid/cell.mjs +6 -6
- package/esm2022/grid/column-menu.mjs +5 -5
- package/esm2022/grid/column-resize/column-resize-directives/column-resize-flex.mjs +4 -4
- package/esm2022/grid/column-resize/column-resize-directives/column-resize.mjs +4 -4
- package/esm2022/grid/column-resize/column-resize-module.mjs +8 -8
- package/esm2022/grid/column-resize/overlay-handle.mjs +6 -6
- package/esm2022/grid/column-resize/resizable-directives/resizable.mjs +6 -6
- package/esm2022/grid/column-resize/resize-strategy.mjs +5 -5
- package/esm2022/grid/expansion-toggle.mjs +5 -5
- package/esm2022/grid/grid-module.mjs +4 -4
- package/esm2022/grid/grid-pipes.mjs +22 -22
- package/esm2022/grid/grid-utils.mjs +4 -4
- package/esm2022/grid/grid.mjs +76 -44
- package/esm2022/loader/loader-module.mjs +4 -4
- package/esm2022/loader/loader.mjs +17 -29
- package/esm2022/photoviewer/photoviewer-module.mjs +4 -4
- package/esm2022/photoviewer/photoviewer.mjs +7 -7
- package/esm2022/popover/popover-content.mjs +8 -8
- package/esm2022/popover/popover-module.mjs +4 -4
- package/esm2022/popover/popover-target.mjs +4 -4
- package/esm2022/popover/popover-trigger.mjs +6 -6
- package/esm2022/popover/popover.mjs +52 -137
- package/esm2022/progress/progress-module.mjs +4 -4
- package/esm2022/progress/progress.mjs +14 -25
- package/esm2022/select/option.mjs +11 -17
- package/esm2022/select/select-module.mjs +4 -4
- package/esm2022/select/select.mjs +13 -13
- package/esm2022/select/templates.mjs +44 -44
- package/esm2022/split/split-module.mjs +4 -4
- package/esm2022/split/split-pane.mjs +5 -5
- package/esm2022/split/split.mjs +7 -7
- package/esm2022/tooltip/tooltip-module.mjs +4 -4
- package/esm2022/tooltip/tooltip.mjs +22 -22
- package/fesm2022/mtxAlert.mjs +14 -21
- package/fesm2022/mtxAlert.mjs.map +1 -1
- package/fesm2022/mtxButton.mjs +17 -28
- package/fesm2022/mtxButton.mjs.map +1 -1
- package/fesm2022/mtxCheckboxGroup.mjs +21 -32
- package/fesm2022/mtxCheckboxGroup.mjs.map +1 -1
- package/fesm2022/mtxColorpicker.mjs +61 -64
- package/fesm2022/mtxColorpicker.mjs.map +1 -1
- package/fesm2022/mtxColumnResize.mjs +48 -48
- package/fesm2022/mtxCore.mjs +23 -23
- package/fesm2022/mtxDatetimepicker.mjs +150 -190
- package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
- package/fesm2022/mtxDialog.mjs +14 -14
- package/fesm2022/mtxDialog.mjs.map +1 -1
- package/fesm2022/mtxDrawer.mjs +17 -17
- package/fesm2022/mtxDrawer.mjs.map +1 -1
- package/fesm2022/mtxGrid.mjs +150 -118
- package/fesm2022/mtxGrid.mjs.map +1 -1
- package/fesm2022/mtxLoader.mjs +20 -32
- package/fesm2022/mtxLoader.mjs.map +1 -1
- package/fesm2022/mtxPhotoviewer.mjs +10 -10
- package/fesm2022/mtxPhotoviewer.mjs.map +1 -1
- package/fesm2022/mtxPopover.mjs +73 -158
- package/fesm2022/mtxPopover.mjs.map +1 -1
- package/fesm2022/mtxProgress.mjs +17 -28
- package/fesm2022/mtxProgress.mjs.map +1 -1
- package/fesm2022/mtxSelect.mjs +68 -73
- package/fesm2022/mtxSelect.mjs.map +1 -1
- package/fesm2022/mtxSplit.mjs +14 -14
- package/fesm2022/mtxSplit.mjs.map +1 -1
- package/fesm2022/mtxTooltip.mjs +26 -26
- package/fesm2022/mtxTooltip.mjs.map +1 -1
- package/grid/_grid-theme.scss +60 -24
- package/grid/column-menu.scss +32 -3
- package/grid/grid.d.ts +33 -1
- package/grid/grid.scss +36 -108
- package/loader/_loader-theme.scss +55 -22
- package/loader/loader.d.ts +4 -9
- package/loader/loader.scss +1 -1
- package/package.json +13 -19
- package/photoviewer/photoviewer.d.ts +1 -0
- package/popover/_popover-theme.scss +55 -22
- package/popover/popover.d.ts +23 -54
- package/popover/popover.scss +2 -2
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/progress/_progress-theme.scss +60 -22
- package/progress/progress.d.ts +4 -9
- package/progress/progress.scss +3 -3
- package/select/_select-theme.scss +66 -34
- package/select/option.d.ts +2 -5
- package/select/select.d.ts +1 -3
- package/select/select.scss +104 -127
- package/split/_split-theme.scss +62 -32
- package/split/split.scss +2 -4
- package/tooltip/_tooltip-theme.scss +66 -34
- package/_theming.scss +0 -16
- package/alert/_alert-theme.import.scss +0 -2
- package/button/_button-theme.import.scss +0 -2
- package/colorpicker/_colorpicker-theme.import.scss +0 -2
- package/core/style/_elevation.scss +0 -91
- package/core/style/_private.scss +0 -32
- package/core/style/_variables.scss +0 -44
- package/core/style/_vendor-prefixes.scss +0 -46
- package/core/theming/_palette.scss +0 -746
- package/core/theming/_theming.scss +0 -463
- package/core/typography/_typography-utils.scss +0 -101
- package/datetimepicker/_datetimepicker-theme.import.scss +0 -4
- package/drawer/_drawer-theme.import.scss +0 -2
- package/grid/_grid-theme.import.scss +0 -2
- package/loader/_loader-theme.import.scss +0 -2
- package/popover/_popover-theme.import.scss +0 -2
- package/progress/_progress-theme.import.scss +0 -2
- package/select/_select-density.scss +0 -68
- package/select/_select-theme.import.scss +0 -3
- package/split/_split-theme.import.scss +0 -2
- package/tooltip/_tooltip-theme.import.scss +0 -1
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
|
-
@use 'sass:math';
|
|
3
|
-
@use 'sass:meta';
|
|
4
|
-
@use 'typography-utils';
|
|
5
|
-
@use '../theming/theming';
|
|
6
1
|
@use '@material/typography' as mdc-typography;
|
|
2
|
+
@use 'sass:map';
|
|
7
3
|
|
|
8
4
|
/// Defines a typography level from the Material Design spec.
|
|
9
5
|
/// @param {String} $font-size The font-size for this level.
|
|
@@ -28,108 +24,6 @@
|
|
|
28
24
|
);
|
|
29
25
|
}
|
|
30
26
|
|
|
31
|
-
/// Defines a collection of typography levels to configure typography for an application.
|
|
32
|
-
/// Any level not specified defaults to the values defined in the Material Design specification:
|
|
33
|
-
/// https://material.io/guidelines/style/typography.html.
|
|
34
|
-
///
|
|
35
|
-
/// Note that the Material Design specification does not describe explicit letter-spacing values.
|
|
36
|
-
/// The values here come from reverse engineering the Material Design examples.
|
|
37
|
-
/// @param {String} $font-family Default font-family for levels that don't specify font-family.
|
|
38
|
-
/// @param {Map} $display-4 Configuration for the "display-4" typographic level.
|
|
39
|
-
/// @param {Map} $display-3 Configuration for the "display-3" typographic level.
|
|
40
|
-
/// @param {Map} $display-2 Configuration for the "display-2" typographic level.
|
|
41
|
-
/// @param {Map} $display-1 Configuration for the "display-1" typographic level.
|
|
42
|
-
/// @param {Map} $headline Configuration for the "headline" typographic level.
|
|
43
|
-
/// @param {Map} $title Configuration for the "title" typographic level.
|
|
44
|
-
/// @param {Map} $subheading-2 Configuration for the "subheading-2" typographic level.
|
|
45
|
-
/// @param {Map} $subheading-1 Configuration for the "subheading-1" typographic level.
|
|
46
|
-
/// @param {Map} $body-2 Configuration for the "body-2" typographic level.
|
|
47
|
-
/// @param {Map} $body-1 Configuration for the "body-1" typographic level.
|
|
48
|
-
/// @param {Map} $caption Configuration for the "caption" typographic level.
|
|
49
|
-
/// @param {Map} $button Configuration for the "button" typographic level.
|
|
50
|
-
/// @param {Map} $input Configuration for the "input" typographic level.
|
|
51
|
-
/// @returns {Map} A typography config for the application.
|
|
52
|
-
///
|
|
53
|
-
/// @deprecated Use `mat.define-typography-config` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
|
|
54
|
-
/// @breaking-change 17.0.0
|
|
55
|
-
@function define-legacy-typography-config(
|
|
56
|
-
$font-family: 'Roboto, "Helvetica Neue", sans-serif',
|
|
57
|
-
$display-4: define-typography-level(112px, 112px, 300, $letter-spacing: -.05em),
|
|
58
|
-
$display-3: define-typography-level(56px, 56px, 400, $letter-spacing: -.02em),
|
|
59
|
-
$display-2: define-typography-level(45px, 48px, 400, $letter-spacing: -.005em),
|
|
60
|
-
$display-1: define-typography-level(34px, 40px, 400),
|
|
61
|
-
$headline: define-typography-level(24px, 32px, 400),
|
|
62
|
-
$title: define-typography-level(20px, 32px, 500),
|
|
63
|
-
$subheading-2: define-typography-level(16px, 28px, 400),
|
|
64
|
-
$subheading-1: define-typography-level(15px, 24px, 400),
|
|
65
|
-
$body-2: define-typography-level(14px, 24px, 500),
|
|
66
|
-
$body-1: define-typography-level(14px, 20px, 400),
|
|
67
|
-
$caption: define-typography-level(12px, 20px, 400),
|
|
68
|
-
$button: define-typography-level(14px, 14px, 500),
|
|
69
|
-
|
|
70
|
-
$input: define-typography-level(inherit, 1.125, 400)
|
|
71
|
-
) {
|
|
72
|
-
|
|
73
|
-
// Declare an initial map with all of the levels.
|
|
74
|
-
$config: (
|
|
75
|
-
display-4: $display-4,
|
|
76
|
-
display-3: $display-3,
|
|
77
|
-
display-2: $display-2,
|
|
78
|
-
display-1: $display-1,
|
|
79
|
-
headline: $headline,
|
|
80
|
-
title: $title,
|
|
81
|
-
subheading-2: $subheading-2,
|
|
82
|
-
subheading-1: $subheading-1,
|
|
83
|
-
body-2: $body-2,
|
|
84
|
-
body-1: $body-1,
|
|
85
|
-
caption: $caption,
|
|
86
|
-
button: $button,
|
|
87
|
-
input: $input,
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
// Loop through the levels and set the `font-family` of the ones that don't have one to the base.
|
|
91
|
-
// Note that Sass can't modify maps in place, which means that we need to merge and re-assign.
|
|
92
|
-
@each $key, $level in $config {
|
|
93
|
-
@if map.get($level, font-family) == null {
|
|
94
|
-
$new-level: map.merge($level, (font-family: $font-family));
|
|
95
|
-
$config: map.merge($config, ($key: $new-level));
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Add the base font family to the config.
|
|
100
|
-
@return map.merge($config, (font-family: $font-family));
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Converts a map containing rem values to a map containing px values.
|
|
104
|
-
@function _rem-to-px($x, $px-per-rem: 16px) {
|
|
105
|
-
@if meta.type-of($x) == 'map' {
|
|
106
|
-
@each $key, $val in $x {
|
|
107
|
-
$x: map.merge($x, ($key: _rem-to-px($val)));
|
|
108
|
-
}
|
|
109
|
-
@return $x;
|
|
110
|
-
}
|
|
111
|
-
@if meta.type-of($x) == 'number' and math.unit($x) == 'rem' {
|
|
112
|
-
@return math.div($x, 1rem) * $px-per-rem;
|
|
113
|
-
}
|
|
114
|
-
@else {
|
|
115
|
-
@return $x;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Applies the default font family to all levels in a typography config.
|
|
120
|
-
@function _apply-font-family($font-family, $initial-config) {
|
|
121
|
-
$config: $initial-config;
|
|
122
|
-
|
|
123
|
-
@each $key, $level in $config {
|
|
124
|
-
@if map.get($level, 'font-family') == null {
|
|
125
|
-
// Sass maps are immutable so we have to re-assign the variable each time.
|
|
126
|
-
$config: map.set($config, $key, map.set($level, 'font-family', $font-family));
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
@return map.set($config, 'font-family', $font-family);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
27
|
// Converts an MDC typography level config to an Angular Material one.
|
|
134
28
|
@function typography-config-level-from-mdc($mdc-level, $font-family: null) {
|
|
135
29
|
$mdc-level-config: map.get(mdc-typography.$styles, $mdc-level);
|
|
@@ -144,475 +38,3 @@
|
|
|
144
38
|
$letter-spacing: map.get($mdc-level-config, letter-spacing)
|
|
145
39
|
);
|
|
146
40
|
}
|
|
147
|
-
|
|
148
|
-
/// Generates an Angular Material typography config based on values from the official Material
|
|
149
|
-
/// Design spec implementation (MDC Web). All arguments are optional, but may be passed to override
|
|
150
|
-
/// the default values. The `mat-typography-level` function can be used to generate a custom
|
|
151
|
-
/// typography level map which can be passed to this function to override one of the default levels.
|
|
152
|
-
/// All default typography sizing generated by this function is in `px` units.
|
|
153
|
-
///
|
|
154
|
-
/// @param {String} $font-family The font family to use for levels where it is not explicitly
|
|
155
|
-
/// specified.
|
|
156
|
-
/// @param {Map} $headline-1 The font settings for the headline-1 font level.
|
|
157
|
-
/// @param {Map} $headline-2 The font settings for the headline-2 font level.
|
|
158
|
-
/// @param {Map} $headline-3 The font settings for the headline-3 font level.
|
|
159
|
-
/// @param {Map} $headline-4 The font settings for the headline-4 font level.
|
|
160
|
-
/// @param {Map} $headline-5 The font settings for the headline-5 font level.
|
|
161
|
-
/// @param {Map} $headline-6 The font settings for the headline-6 font level.
|
|
162
|
-
/// @param {Map} $subtitle-1 The font settings for the subtitle-1 font level.
|
|
163
|
-
/// @param {Map} $subtitle-2 The font settings for the subtitle-2 font level.
|
|
164
|
-
/// @param {Map} $body-1 The font settings for the body-1 font level.
|
|
165
|
-
/// @param {Map} $body-2 The font settings for the body-2 font level.
|
|
166
|
-
/// @param {Map} $caption The font settings for the caption font level.
|
|
167
|
-
/// @param {Map} $button The font settings for the button font level.
|
|
168
|
-
/// @param {Map} $overline The font settings for the overline font level.
|
|
169
|
-
/// @return {Map} A map containing font settings for each of the levels in the Material Design spec.
|
|
170
|
-
@function define-typography-config(
|
|
171
|
-
// TODO(mmalerba): rename this function to define-typography-config,
|
|
172
|
-
// and create a predefined px based config for people that need it.
|
|
173
|
-
$font-family: mdc-typography.$font-family,
|
|
174
|
-
$headline-1: null,
|
|
175
|
-
$headline-2: null,
|
|
176
|
-
$headline-3: null,
|
|
177
|
-
$headline-4: null,
|
|
178
|
-
$headline-5: null,
|
|
179
|
-
$headline-6: null,
|
|
180
|
-
$subtitle-1: null,
|
|
181
|
-
$subtitle-2: null,
|
|
182
|
-
$body-1: null,
|
|
183
|
-
$body-2: null,
|
|
184
|
-
$caption: null,
|
|
185
|
-
$button: null,
|
|
186
|
-
$overline: null,
|
|
187
|
-
) {
|
|
188
|
-
@return _apply-font-family($font-family, (
|
|
189
|
-
headline-1: $headline-1 or _rem-to-px(typography-config-level-from-mdc(headline1)),
|
|
190
|
-
headline-2: $headline-2 or _rem-to-px(typography-config-level-from-mdc(headline2)),
|
|
191
|
-
headline-3: $headline-3 or _rem-to-px(typography-config-level-from-mdc(headline3)),
|
|
192
|
-
headline-4: $headline-4 or _rem-to-px(typography-config-level-from-mdc(headline4)),
|
|
193
|
-
headline-5: $headline-5 or _rem-to-px(typography-config-level-from-mdc(headline5)),
|
|
194
|
-
headline-6: $headline-6 or _rem-to-px(typography-config-level-from-mdc(headline6)),
|
|
195
|
-
subtitle-1: $subtitle-1 or _rem-to-px(typography-config-level-from-mdc(subtitle1)),
|
|
196
|
-
subtitle-2: $subtitle-2 or _rem-to-px(typography-config-level-from-mdc(subtitle2)),
|
|
197
|
-
body-1: $body-1 or _rem-to-px(typography-config-level-from-mdc(body1)),
|
|
198
|
-
body-2: $body-2 or _rem-to-px(typography-config-level-from-mdc(body2)),
|
|
199
|
-
caption: $caption or _rem-to-px(typography-config-level-from-mdc(caption)),
|
|
200
|
-
button: $button or _rem-to-px(typography-config-level-from-mdc(button)),
|
|
201
|
-
overline: $overline or _rem-to-px(typography-config-level-from-mdc(overline)),
|
|
202
|
-
));
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/// Generates an Angular Material typography config based on values from the official Material
|
|
206
|
-
/// Design spec implementation (MDC Web). All arguments are optional, but may be passed to override
|
|
207
|
-
/// the default values. The `mat-typography-level` function can be used to generate a custom
|
|
208
|
-
/// typography level map which can be passed to this function to override one of the default levels.
|
|
209
|
-
/// All default typography sizing generated by this function is in `rem` units.
|
|
210
|
-
///
|
|
211
|
-
/// @param {String} $font-family The font family to use for levels where it is not explicitly
|
|
212
|
-
/// specified.
|
|
213
|
-
/// @param {Map} $headline-1 The font settings for the headline-1 font level.
|
|
214
|
-
/// @param {Map} $headline-2 The font settings for the headline-2 font level.
|
|
215
|
-
/// @param {Map} $headline-3 The font settings for the headline-3 font level.
|
|
216
|
-
/// @param {Map} $headline-4 The font settings for the headline-4 font level.
|
|
217
|
-
/// @param {Map} $headline-5 The font settings for the headline-5 font level.
|
|
218
|
-
/// @param {Map} $headline-6 The font settings for the headline-6 font level.
|
|
219
|
-
/// @param {Map} $subtitle-1 The font settings for the subtitle-1 font level.
|
|
220
|
-
/// @param {Map} $subtitle-2 The font settings for the subtitle-2 font level.
|
|
221
|
-
/// @param {Map} $body-1 The font settings for the body-1 font level.
|
|
222
|
-
/// @param {Map} $body-2 The font settings for the body-2 font level.
|
|
223
|
-
/// @param {Map} $caption The font settings for the caption font level.
|
|
224
|
-
/// @param {Map} $button The font settings for the button font level.
|
|
225
|
-
/// @param {Map} $overline The font settings for the overline font level.
|
|
226
|
-
/// @return {Map} A map containing font settings for each of the levels in the Material Design spec.
|
|
227
|
-
@function define-rem-typography-config(
|
|
228
|
-
// TODO(mmalerba): rename this function to define-typography-config,
|
|
229
|
-
// and create a predefined px based config for people that need it.
|
|
230
|
-
$font-family: mdc-typography.$font-family,
|
|
231
|
-
$headline-1: null,
|
|
232
|
-
$headline-2: null,
|
|
233
|
-
$headline-3: null,
|
|
234
|
-
$headline-4: null,
|
|
235
|
-
$headline-5: null,
|
|
236
|
-
$headline-6: null,
|
|
237
|
-
$subtitle-1: null,
|
|
238
|
-
$subtitle-2: null,
|
|
239
|
-
$body-1: null,
|
|
240
|
-
$body-2: null,
|
|
241
|
-
$caption: null,
|
|
242
|
-
$button: null,
|
|
243
|
-
$overline: null,
|
|
244
|
-
) {
|
|
245
|
-
@return _apply-font-family($font-family, (
|
|
246
|
-
headline-1: $headline-1 or typography-config-level-from-mdc(headline1),
|
|
247
|
-
headline-2: $headline-2 or typography-config-level-from-mdc(headline2),
|
|
248
|
-
headline-3: $headline-3 or typography-config-level-from-mdc(headline3),
|
|
249
|
-
headline-4: $headline-4 or typography-config-level-from-mdc(headline4),
|
|
250
|
-
headline-5: $headline-5 or typography-config-level-from-mdc(headline5),
|
|
251
|
-
headline-6: $headline-6 or typography-config-level-from-mdc(headline6),
|
|
252
|
-
subtitle-1: $subtitle-1 or typography-config-level-from-mdc(subtitle1),
|
|
253
|
-
subtitle-2: $subtitle-2 or typography-config-level-from-mdc(subtitle2),
|
|
254
|
-
body-1: $body-1 or typography-config-level-from-mdc(body1),
|
|
255
|
-
body-2: $body-2 or typography-config-level-from-mdc(body2),
|
|
256
|
-
caption: $caption or typography-config-level-from-mdc(caption),
|
|
257
|
-
button: $button or typography-config-level-from-mdc(button),
|
|
258
|
-
overline: $overline or typography-config-level-from-mdc(overline),
|
|
259
|
-
));
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
// Whether a config is for the Material Design 2018 typography system.
|
|
263
|
-
@function private-typography-is-2018-config($config) {
|
|
264
|
-
@return map.get($config, headline-1) != null;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
// Whether a config is for the Material Design 2014 typography system.
|
|
268
|
-
@function private-typography-is-2014-config($config) {
|
|
269
|
-
@return map.get($config, headline) != null;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// Given a config for either the 2014 or 2018 Material Design typography system,
|
|
273
|
-
// produces a normalized typography config for the 2014 Material Design typography system.
|
|
274
|
-
// 2014 - https://material.io/archive/guidelines/style/typography.html#typography-styles
|
|
275
|
-
// 2018 - https://material.io/design/typography/the-type-system.html#type-scale
|
|
276
|
-
//
|
|
277
|
-
// Components using this function should be migrated to normalize to the 2018 style config instead.
|
|
278
|
-
// New components should not use this function.
|
|
279
|
-
@function private-typography-to-2014-config($config) {
|
|
280
|
-
@if $config == null {
|
|
281
|
-
@return null;
|
|
282
|
-
}
|
|
283
|
-
@if not private-typography-is-2014-config($config) {
|
|
284
|
-
$args: (
|
|
285
|
-
display-4: map.get($config, headline-1),
|
|
286
|
-
display-3: map.get($config, headline-2),
|
|
287
|
-
display-2: map.get($config, headline-3),
|
|
288
|
-
display-1: map.get($config, headline-4),
|
|
289
|
-
headline: map.get($config, headline-5),
|
|
290
|
-
title: map.get($config, headline-6),
|
|
291
|
-
subheading-2: map.get($config, subtitle-1),
|
|
292
|
-
subheading-1: map.get($config, subtitle-2),
|
|
293
|
-
body-2: map.get($config, body-1),
|
|
294
|
-
body-1: map.get($config, body-2),
|
|
295
|
-
button: map.get($config, button),
|
|
296
|
-
caption: map.get($config, caption),
|
|
297
|
-
font-family: map.get($config, font-family),
|
|
298
|
-
);
|
|
299
|
-
$non-null-args: ();
|
|
300
|
-
@each $key, $value in $args {
|
|
301
|
-
@if $value != null {
|
|
302
|
-
$non-null-args: map.merge($non-null-args, ($key: $value));
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
@return define-legacy-typography-config($non-null-args...);
|
|
306
|
-
}
|
|
307
|
-
@return $config;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// Given a config for either the 2014 or 2018 Material Design typography system,
|
|
311
|
-
// produces a normalized typography config for the 2018 Material Design typography system.
|
|
312
|
-
// 2014 - https://material.io/archive/guidelines/style/typography.html#typography-styles
|
|
313
|
-
// 2018 - https://material.io/design/typography/the-type-system.html#type-scale
|
|
314
|
-
@function private-typography-to-2018-config($config) {
|
|
315
|
-
@if $config == null {
|
|
316
|
-
@return null;
|
|
317
|
-
}
|
|
318
|
-
@if not private-typography-is-2018-config($config) {
|
|
319
|
-
@return (
|
|
320
|
-
headline-1: map.get($config, display-4),
|
|
321
|
-
headline-2: map.get($config, display-3),
|
|
322
|
-
headline-3: map.get($config, display-2),
|
|
323
|
-
headline-4: map.get($config, display-1),
|
|
324
|
-
headline-5: map.get($config, headline),
|
|
325
|
-
headline-6: map.get($config, title),
|
|
326
|
-
subtitle-1: map.get($config, subheading-2),
|
|
327
|
-
font-famiy: map.get($config, font-family),
|
|
328
|
-
|
|
329
|
-
// These mappings are odd, but body-2 in the 2014 system actually looks closer to subtitle-2
|
|
330
|
-
// in the 2018 system, and subeading-1 in the 2014 system looks more like body-1 in the 2018
|
|
331
|
-
// system.
|
|
332
|
-
subtitle-2: map.get($config, body-2),
|
|
333
|
-
body-1: map.get($config, subheading-1),
|
|
334
|
-
|
|
335
|
-
body-2: map.get($config, body-1),
|
|
336
|
-
button: map.get($config, button),
|
|
337
|
-
caption: map.get($config, caption),
|
|
338
|
-
overline: if(map.get($config, overline), map.get($config, overline),
|
|
339
|
-
define-typography-level(12px, 32px, 500)
|
|
340
|
-
)
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
@return $config;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
/// Emits baseline typographic styles based on a given config.
|
|
347
|
-
/// @param {Map} $config-or-theme A typography config for an entire theme.
|
|
348
|
-
/// @param {String} $selector Ancestor selector under which native elements, such as h1, will
|
|
349
|
-
/// be styled.
|
|
350
|
-
@mixin typography-hierarchy($config-or-theme, $selector: '.mat-typography') {
|
|
351
|
-
$config: private-typography-to-2018-config(theming.get-typography-config($config-or-theme));
|
|
352
|
-
|
|
353
|
-
// Note that it seems redundant to prefix the class rules with the `$selector`, however it's
|
|
354
|
-
// necessary if we want to allow people to overwrite the tag selectors. This is due to
|
|
355
|
-
// selectors like `#{$selector} h1` being more specific than ones like `.mat-title`.
|
|
356
|
-
.mat-h1,
|
|
357
|
-
.mat-headline-5,
|
|
358
|
-
#{$selector} .mat-h1,
|
|
359
|
-
#{$selector} .mat-headline-5,
|
|
360
|
-
#{$selector} h1 {
|
|
361
|
-
@include typography-utils.typography-level($config, headline-5);
|
|
362
|
-
|
|
363
|
-
margin: 0 0 16px;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.mat-h2,
|
|
367
|
-
.mat-headline-6,
|
|
368
|
-
#{$selector} .mat-h2,
|
|
369
|
-
#{$selector} .mat-headline-6,
|
|
370
|
-
#{$selector} h2 {
|
|
371
|
-
@include typography-utils.typography-level($config, headline-6);
|
|
372
|
-
|
|
373
|
-
margin: 0 0 16px;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.mat-h3,
|
|
377
|
-
.mat-subtitle-1,
|
|
378
|
-
#{$selector} .mat-h3,
|
|
379
|
-
#{$selector} .mat-subtitle-1,
|
|
380
|
-
#{$selector} h3 {
|
|
381
|
-
@include typography-utils.typography-level($config, subtitle-1);
|
|
382
|
-
|
|
383
|
-
margin: 0 0 16px;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.mat-h4,
|
|
387
|
-
.mat-body-1,
|
|
388
|
-
#{$selector} .mat-h4,
|
|
389
|
-
#{$selector} .mat-body-1,
|
|
390
|
-
#{$selector} h4 {
|
|
391
|
-
@include typography-utils.typography-level($config, body-1);
|
|
392
|
-
|
|
393
|
-
margin: 0 0 16px;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
// Note: the spec doesn't have anything that would correspond to h5 and h6, but we add these for
|
|
397
|
-
// consistency. The font sizes come from the Chrome user agent styles which have h5 at 0.83em
|
|
398
|
-
// and h6 at 0.67em.
|
|
399
|
-
.mat-h5,
|
|
400
|
-
#{$selector} .mat-h5,
|
|
401
|
-
#{$selector} h5 {
|
|
402
|
-
@include typography-utils.font-shorthand(
|
|
403
|
-
|
|
404
|
-
calc(#{typography-utils.font-size($config, body-2)} * .83),
|
|
405
|
-
typography-utils.font-weight($config, body-2),
|
|
406
|
-
typography-utils.line-height($config, body-2),
|
|
407
|
-
typography-utils.font-family($config, body-2)
|
|
408
|
-
);
|
|
409
|
-
|
|
410
|
-
margin: 0 0 12px;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
.mat-h6,
|
|
414
|
-
#{$selector} .mat-h6,
|
|
415
|
-
#{$selector} h6 {
|
|
416
|
-
@include typography-utils.font-shorthand(
|
|
417
|
-
|
|
418
|
-
calc(#{typography-utils.font-size($config, body-2)} * .67),
|
|
419
|
-
typography-utils.font-weight($config, body-2),
|
|
420
|
-
typography-utils.line-height($config, body-2),
|
|
421
|
-
typography-utils.font-family($config, body-2)
|
|
422
|
-
);
|
|
423
|
-
|
|
424
|
-
margin: 0 0 12px;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.mat-body-strong,
|
|
428
|
-
.mat-subtitle-2,
|
|
429
|
-
#{$selector} .mat-body-strong,
|
|
430
|
-
#{$selector} .mat-subtitle-2 {
|
|
431
|
-
@include typography-utils.typography-level($config, subtitle-2);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
.mat-body,
|
|
435
|
-
.mat-body-2,
|
|
436
|
-
#{$selector} .mat-body,
|
|
437
|
-
#{$selector} .mat-body-2,
|
|
438
|
-
#{$selector} {
|
|
439
|
-
@include typography-utils.typography-level($config, body-2);
|
|
440
|
-
|
|
441
|
-
p {
|
|
442
|
-
margin: 0 0 12px;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
.mat-small,
|
|
447
|
-
.mat-caption,
|
|
448
|
-
#{$selector} .mat-small,
|
|
449
|
-
#{$selector} .mat-caption {
|
|
450
|
-
@include typography-utils.typography-level($config, caption);
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
.mat-headline-1,
|
|
454
|
-
#{$selector} .mat-headline-1 {
|
|
455
|
-
@include typography-utils.typography-level($config, headline-1);
|
|
456
|
-
|
|
457
|
-
margin: 0 0 56px;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
.mat-headline-2,
|
|
461
|
-
#{$selector} .mat-headline-2 {
|
|
462
|
-
@include typography-utils.typography-level($config, headline-2);
|
|
463
|
-
|
|
464
|
-
margin: 0 0 64px;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
.mat-headline-3,
|
|
468
|
-
#{$selector} .mat-headline-3 {
|
|
469
|
-
@include typography-utils.typography-level($config, headline-3);
|
|
470
|
-
|
|
471
|
-
margin: 0 0 64px;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
.mat-headline-4,
|
|
475
|
-
#{$selector} .mat-headline-4 {
|
|
476
|
-
@include typography-utils.typography-level($config, headline-4);
|
|
477
|
-
|
|
478
|
-
margin: 0 0 64px;
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
/// Emits baseline typographic styles based on a given config.
|
|
483
|
-
/// @param {Map} $config-or-theme A typography config for an entire theme.
|
|
484
|
-
/// @param {String} $selector Ancestor selector under which native elements, such as h1, will
|
|
485
|
-
/// be styled.
|
|
486
|
-
/// @deprecated Use `mat.typography-hierarchy` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
|
|
487
|
-
/// @breaking-change 17.0.0
|
|
488
|
-
@mixin legacy-typography-hierarchy($config-or-theme, $selector: '.mat-typography') {
|
|
489
|
-
$config: private-typography-to-2014-config(theming.get-typography-config($config-or-theme));
|
|
490
|
-
|
|
491
|
-
// Note that it seems redundant to prefix the class rules with the `$selector`, however it's
|
|
492
|
-
// necessary if we want to allow people to overwrite the tag selectors. This is due to
|
|
493
|
-
// selectors like `#{$selector} h1` being more specific than ones like `.mat-title`.
|
|
494
|
-
.mat-h1,
|
|
495
|
-
.mat-headline,
|
|
496
|
-
#{$selector} .mat-h1,
|
|
497
|
-
#{$selector} .mat-headline,
|
|
498
|
-
#{$selector} h1 {
|
|
499
|
-
@include typography-utils.typography-level($config, headline);
|
|
500
|
-
|
|
501
|
-
margin: 0 0 16px;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
.mat-h2,
|
|
505
|
-
.mat-title,
|
|
506
|
-
#{$selector} .mat-h2,
|
|
507
|
-
#{$selector} .mat-title,
|
|
508
|
-
#{$selector} h2 {
|
|
509
|
-
@include typography-utils.typography-level($config, title);
|
|
510
|
-
|
|
511
|
-
margin: 0 0 16px;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
.mat-h3,
|
|
515
|
-
.mat-subheading-2,
|
|
516
|
-
#{$selector} .mat-h3,
|
|
517
|
-
#{$selector} .mat-subheading-2,
|
|
518
|
-
#{$selector} h3 {
|
|
519
|
-
@include typography-utils.typography-level($config, subheading-2);
|
|
520
|
-
|
|
521
|
-
margin: 0 0 16px;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
.mat-h4,
|
|
525
|
-
.mat-subheading-1,
|
|
526
|
-
#{$selector} .mat-h4,
|
|
527
|
-
#{$selector} .mat-subheading-1,
|
|
528
|
-
#{$selector} h4 {
|
|
529
|
-
@include typography-utils.typography-level($config, subheading-1);
|
|
530
|
-
|
|
531
|
-
margin: 0 0 16px;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
// Note: the spec doesn't have anything that would correspond to h5 and h6, but we add these for
|
|
535
|
-
// consistency. The font sizes come from the Chrome user agent styles which have h5 at 0.83em
|
|
536
|
-
// and h6 at 0.67em.
|
|
537
|
-
.mat-h5,
|
|
538
|
-
#{$selector} .mat-h5,
|
|
539
|
-
#{$selector} h5 {
|
|
540
|
-
@include typography-utils.font-shorthand(
|
|
541
|
-
|
|
542
|
-
calc(#{typography-utils.font-size($config, body-1)} * .83),
|
|
543
|
-
typography-utils.font-weight($config, body-1),
|
|
544
|
-
typography-utils.line-height($config, body-1),
|
|
545
|
-
typography-utils.font-family($config, body-1)
|
|
546
|
-
);
|
|
547
|
-
|
|
548
|
-
margin: 0 0 12px;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
.mat-h6,
|
|
552
|
-
#{$selector} .mat-h6,
|
|
553
|
-
#{$selector} h6 {
|
|
554
|
-
@include typography-utils.font-shorthand(
|
|
555
|
-
|
|
556
|
-
calc(#{typography-utils.font-size($config, body-1)} * .67),
|
|
557
|
-
typography-utils.font-weight($config, body-1),
|
|
558
|
-
typography-utils.line-height($config, body-1),
|
|
559
|
-
typography-utils.font-family($config, body-1)
|
|
560
|
-
);
|
|
561
|
-
|
|
562
|
-
margin: 0 0 12px;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
.mat-body-strong,
|
|
566
|
-
.mat-body-2,
|
|
567
|
-
#{$selector} .mat-body-strong,
|
|
568
|
-
#{$selector} .mat-body-2 {
|
|
569
|
-
@include typography-utils.typography-level($config, body-2);
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
.mat-body,
|
|
573
|
-
.mat-body-1,
|
|
574
|
-
#{$selector} .mat-body,
|
|
575
|
-
#{$selector} .mat-body-1,
|
|
576
|
-
#{$selector} {
|
|
577
|
-
@include typography-utils.typography-level($config, body-1);
|
|
578
|
-
|
|
579
|
-
p {
|
|
580
|
-
margin: 0 0 12px;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
.mat-small,
|
|
585
|
-
.mat-caption,
|
|
586
|
-
#{$selector} .mat-small,
|
|
587
|
-
#{$selector} .mat-caption {
|
|
588
|
-
@include typography-utils.typography-level($config, caption);
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
.mat-display-4,
|
|
592
|
-
#{$selector} .mat-display-4 {
|
|
593
|
-
@include typography-utils.typography-level($config, display-4);
|
|
594
|
-
|
|
595
|
-
margin: 0 0 56px;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
.mat-display-3,
|
|
599
|
-
#{$selector} .mat-display-3 {
|
|
600
|
-
@include typography-utils.typography-level($config, display-3);
|
|
601
|
-
|
|
602
|
-
margin: 0 0 64px;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
.mat-display-2,
|
|
606
|
-
#{$selector} .mat-display-2 {
|
|
607
|
-
@include typography-utils.typography-level($config, display-2);
|
|
608
|
-
|
|
609
|
-
margin: 0 0 64px;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
.mat-display-1,
|
|
613
|
-
#{$selector} .mat-display-1 {
|
|
614
|
-
@include typography-utils.typography-level($config, display-1);
|
|
615
|
-
|
|
616
|
-
margin: 0 0 64px;
|
|
617
|
-
}
|
|
618
|
-
}
|