@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,242 +1,31 @@
|
|
|
1
|
-
// TODO(mmalerba): this file should be split into separate cohesive partials for things like
|
|
2
|
-
// "theming", "typography", "core".
|
|
3
|
-
|
|
4
|
-
@use '../theming/theming';
|
|
5
|
-
@use '../typography/typography';
|
|
6
|
-
@use '../typography/typography-utils';
|
|
7
|
-
@use '@material/feature-targeting' as mdc-feature-targeting;
|
|
8
|
-
@use '@material/typography' as mdc-typography;
|
|
9
|
-
@use '@material/theme/theme-color' as mdc-theme-color;
|
|
10
|
-
@use '@material/theme/css' as mdc-theme-css;
|
|
11
1
|
@use 'sass:map';
|
|
12
|
-
@use '
|
|
13
|
-
|
|
14
|
-
// A set of standard queries to use with MDC's queryable mixins.
|
|
15
|
-
$mdc-base-styles-query: mdc-feature-targeting.without(mdc-feature-targeting.any(color, typography));
|
|
16
|
-
$mdc-base-styles-without-animation-query:
|
|
17
|
-
mdc-feature-targeting.all($mdc-base-styles-query, mdc-feature-targeting.without(animation));
|
|
18
|
-
$mdc-theme-styles-query: color;
|
|
19
|
-
$mdc-typography-styles-query: typography;
|
|
20
|
-
|
|
21
|
-
// Mappings from Angular Material's typography levels to MDC's typography levels.
|
|
22
|
-
$mat-typography-mdc-level-mappings: (
|
|
23
|
-
headline-1: headline1,
|
|
24
|
-
headline-2: headline2,
|
|
25
|
-
headline-3: headline3,
|
|
26
|
-
headline-4: headline4,
|
|
27
|
-
headline-5: headline5,
|
|
28
|
-
headline-6: headline6,
|
|
29
|
-
subtitle-1: subtitle1,
|
|
30
|
-
subtitle-2: subtitle2,
|
|
31
|
-
body-1: body1,
|
|
32
|
-
body-2: body2,
|
|
33
|
-
caption: caption,
|
|
34
|
-
button: button,
|
|
35
|
-
overline: overline
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
// Converts an Angular Material typography level config to an MDC one.
|
|
39
|
-
@function typography-level-config-to-mdc($mat-config, $mat-level) {
|
|
40
|
-
$mdc-level: map.get($mat-typography-mdc-level-mappings, $mat-level);
|
|
41
|
-
|
|
42
|
-
$result-with-nulls: map.merge(
|
|
43
|
-
if($mdc-level,
|
|
44
|
-
map.get(mdc-typography.$styles, $mdc-level),
|
|
45
|
-
(
|
|
46
|
-
text-decoration: none,
|
|
47
|
-
-moz-osx-font-smoothing: grayscale,
|
|
48
|
-
-webkit-font-smoothing: antialiased
|
|
49
|
-
)),
|
|
50
|
-
if($mat-level,
|
|
51
|
-
(
|
|
52
|
-
font-size: typography-utils.font-size($mat-config, $mat-level),
|
|
53
|
-
line-height: typography-utils.line-height($mat-config, $mat-level),
|
|
54
|
-
font-weight: typography-utils.font-weight($mat-config, $mat-level),
|
|
55
|
-
letter-spacing: typography-utils.letter-spacing($mat-config, $mat-level),
|
|
56
|
-
font-family: typography-utils.font-family($mat-config, $mat-level),
|
|
57
|
-
// Angular Material doesn't use text-transform, so disable it.
|
|
58
|
-
text-transform: none,
|
|
59
|
-
),
|
|
60
|
-
()));
|
|
61
|
-
|
|
62
|
-
// We need to strip out any keys with a null value. Leaving them in will cause MDC to emit CSS
|
|
63
|
-
// variables with no fallback value, which breaks some builds.
|
|
64
|
-
$result: ();
|
|
65
|
-
@each $property, $value in $result-with-nulls {
|
|
66
|
-
@if $value != null {
|
|
67
|
-
$result: map.merge($result, ($property: $value));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
@return $result;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// Converts an Angular Material typography config to an MDC one.
|
|
74
|
-
@function typography-config-to-mdc($mat-config) {
|
|
75
|
-
$mdc-config: ();
|
|
76
|
-
|
|
77
|
-
@each $mat-level, $mdc-level in $mat-typography-mdc-level-mappings {
|
|
78
|
-
$mdc-config: map.merge(
|
|
79
|
-
$mdc-config,
|
|
80
|
-
($mdc-level: typography-level-config-to-mdc($mat-config, $mat-level)));
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@return $mdc-config;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Converts an MDC typography level config to an Angular Material one.
|
|
87
|
-
@function typography-config-level-from-mdc($mdc-level) {
|
|
88
|
-
$mdc-level-config: map.get(mdc-typography.$styles, $mdc-level);
|
|
89
|
-
|
|
90
|
-
// Explicitly set the font family to null since we'll apply it globally
|
|
91
|
-
// through the `define-typgraphy-config`/`define-legacy-typography-config`.
|
|
92
|
-
@return typography.define-typography-level(
|
|
93
|
-
$font-family: null,
|
|
94
|
-
$font-size: map.get($mdc-level-config, font-size),
|
|
95
|
-
$line-height: map.get($mdc-level-config, line-height),
|
|
96
|
-
$font-weight: map.get($mdc-level-config, font-weight),
|
|
97
|
-
$letter-spacing: map.get($mdc-level-config, letter-spacing)
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// MDC logs a warning if the `contrast-tone` function is called with a CSS variable.
|
|
102
|
-
// This function falls back to determining the tone based on whether the theme is light or dark.
|
|
103
|
-
@function _variable-safe-contrast-tone($value, $is-dark) {
|
|
104
|
-
@if ($value == 'dark' or $value == 'light' or type-of($value) == 'color') {
|
|
105
|
-
@return mdc-theme-color.contrast-tone($value);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
@return if($is-dark, 'light', 'dark');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
@function _variable-safe-ink-color-for-fill($text-style, $fill-color, $is-dark) {
|
|
112
|
-
$contrast-tone: _variable-safe-contrast-tone($fill-color, $is-dark);
|
|
113
|
-
@return map.get(map.get(mdc-theme-color.$text-colors, $contrast-tone), $text-style);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Configures MDC's global variables to reflect the given theme, applies the given styles,
|
|
117
|
-
// then resets the global variables to prevent unintended side effects.
|
|
118
|
-
@mixin using-mdc-theme($config) {
|
|
119
|
-
$primary: theming.get-color-from-palette(map.get($config, primary));
|
|
120
|
-
$accent: theming.get-color-from-palette(map.get($config, accent));
|
|
121
|
-
$warn: theming.get-color-from-palette(map.get($config, warn));
|
|
122
|
-
$background-palette: map.get($config, background);
|
|
123
|
-
$is-dark: map.get($config, is-dark);
|
|
124
|
-
|
|
125
|
-
// Save the original values.
|
|
126
|
-
$orig-primary: mdc-theme-color.$primary;
|
|
127
|
-
$orig-on-primary: mdc-theme-color.$on-primary;
|
|
128
|
-
$orig-secondary: mdc-theme-color.$secondary;
|
|
129
|
-
$orig-on-secondary: mdc-theme-color.$on-secondary;
|
|
130
|
-
$orig-background: mdc-theme-color.$background;
|
|
131
|
-
$orig-surface: mdc-theme-color.$surface;
|
|
132
|
-
$orig-on-surface: mdc-theme-color.$on-surface;
|
|
133
|
-
$orig-error: mdc-theme-color.$error;
|
|
134
|
-
$orig-on-error: mdc-theme-color.$on-error;
|
|
135
|
-
$orig-property-values: mdc-theme-color.$property-values;
|
|
2
|
+
@use '@material/typography' as mdc-typography;
|
|
3
|
+
@use '../typography/typography';
|
|
136
4
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
mdc-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
on-primary: mdc-theme-color.$on-primary,
|
|
163
|
-
on-secondary: mdc-theme-color.$on-secondary,
|
|
164
|
-
on-surface: mdc-theme-color.$on-surface,
|
|
165
|
-
on-error: mdc-theme-color.$on-error,
|
|
166
|
-
// Text-primary on "background" background
|
|
167
|
-
text-primary-on-background:
|
|
168
|
-
_variable-safe-ink-color-for-fill(primary, mdc-theme-color.$background, $is-dark),
|
|
169
|
-
text-secondary-on-background:
|
|
170
|
-
_variable-safe-ink-color-for-fill(secondary, mdc-theme-color.$background, $is-dark),
|
|
171
|
-
text-hint-on-background:
|
|
172
|
-
_variable-safe-ink-color-for-fill(hint, mdc-theme-color.$background, $is-dark),
|
|
173
|
-
text-disabled-on-background:
|
|
174
|
-
_variable-safe-ink-color-for-fill(disabled, mdc-theme-color.$background, $is-dark),
|
|
175
|
-
text-icon-on-background:
|
|
176
|
-
_variable-safe-ink-color-for-fill(icon, mdc-theme-color.$background, $is-dark),
|
|
177
|
-
// Text-primary on "light" background
|
|
178
|
-
text-primary-on-light: _variable-safe-ink-color-for-fill(primary, light, $is-dark),
|
|
179
|
-
text-secondary-on-light: _variable-safe-ink-color-for-fill(secondary, light, $is-dark),
|
|
180
|
-
text-hint-on-light: _variable-safe-ink-color-for-fill(hint, light, $is-dark),
|
|
181
|
-
text-disabled-on-light: _variable-safe-ink-color-for-fill(disabled, light, $is-dark),
|
|
182
|
-
text-icon-on-light: _variable-safe-ink-color-for-fill(icon, light, $is-dark),
|
|
183
|
-
// Text-primary on "dark" background
|
|
184
|
-
text-primary-on-dark: _variable-safe-ink-color-for-fill(primary, dark, $is-dark),
|
|
185
|
-
text-secondary-on-dark: _variable-safe-ink-color-for-fill(secondary, dark, $is-dark),
|
|
186
|
-
text-hint-on-dark: _variable-safe-ink-color-for-fill(hint, dark, $is-dark),
|
|
187
|
-
text-disabled-on-dark: _variable-safe-ink-color-for-fill(disabled, dark, $is-dark),
|
|
188
|
-
text-icon-on-dark: _variable-safe-ink-color-for-fill(icon, dark, $is-dark)
|
|
5
|
+
// Function to create an Angular Material typography config from MDC's predefined typography levels.
|
|
6
|
+
// This is used for components where we accidentally ended up supporting null typography configs
|
|
7
|
+
// that were silently falling back to MDC's typography. At the moment of writing this includes
|
|
8
|
+
// `dialog`, `slider` and `tooltip`.
|
|
9
|
+
// Important! We shouldn't introduce any new usages of this pattern and we should eventually clean
|
|
10
|
+
// up any existing usages.
|
|
11
|
+
@function private-fallback-typography-from-mdc() {
|
|
12
|
+
// This is very close to what we have in `define-typography-config`, but we can't use it here,
|
|
13
|
+
// because it would cause a circular import and moving it here doesn't make sense.
|
|
14
|
+
$font-family: mdc-typography.$font-family;
|
|
15
|
+
@return (
|
|
16
|
+
font-family: $font-family,
|
|
17
|
+
headline-1: typography.typography-config-level-from-mdc(headline1, $font-family),
|
|
18
|
+
headline-2: typography.typography-config-level-from-mdc(headline2, $font-family),
|
|
19
|
+
headline-3: typography.typography-config-level-from-mdc(headline3, $font-family),
|
|
20
|
+
headline-4: typography.typography-config-level-from-mdc(headline4, $font-family),
|
|
21
|
+
headline-5: typography.typography-config-level-from-mdc(headline5, $font-family),
|
|
22
|
+
headline-6: typography.typography-config-level-from-mdc(headline6, $font-family),
|
|
23
|
+
subtitle-1: typography.typography-config-level-from-mdc(subtitle1, $font-family),
|
|
24
|
+
subtitle-2: typography.typography-config-level-from-mdc(subtitle2, $font-family),
|
|
25
|
+
body-1: typography.typography-config-level-from-mdc(body1, $font-family),
|
|
26
|
+
body-2: typography.typography-config-level-from-mdc(body2, $font-family),
|
|
27
|
+
caption: typography.typography-config-level-from-mdc(caption, $font-family),
|
|
28
|
+
button: typography.typography-config-level-from-mdc(button, $font-family),
|
|
29
|
+
overline: typography.typography-config-level-from-mdc(overline, $font-family),
|
|
189
30
|
);
|
|
190
|
-
|
|
191
|
-
// Apply given rules.
|
|
192
|
-
@include disable-mdc-fallback-declarations {
|
|
193
|
-
@content;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// Reset the original values.
|
|
197
|
-
mdc-theme-color.$primary: $orig-primary;
|
|
198
|
-
mdc-theme-color.$on-primary: $orig-on-primary;
|
|
199
|
-
mdc-theme-color.$secondary: $orig-secondary;
|
|
200
|
-
mdc-theme-color.$on-secondary: $orig-on-secondary;
|
|
201
|
-
mdc-theme-color.$background: $orig-background;
|
|
202
|
-
mdc-theme-color.$surface: $orig-surface;
|
|
203
|
-
mdc-theme-color.$on-surface: $orig-on-surface;
|
|
204
|
-
mdc-theme-color.$error: $orig-error;
|
|
205
|
-
mdc-theme-color.$on-error: $orig-on-error;
|
|
206
|
-
mdc-theme-color.$property-values: $orig-property-values;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// Configures MDC's global variables to reflect the given typography config,
|
|
210
|
-
// applies the given styles, then resets the global variables to prevent unintended side effects.
|
|
211
|
-
@mixin using-mdc-typography($config) {
|
|
212
|
-
// Save the original values.
|
|
213
|
-
$orig-mdc-typography-styles: mdc-typography.$styles;
|
|
214
|
-
|
|
215
|
-
// Set new values based on the given Angular Material typography configuration.
|
|
216
|
-
@if $config {
|
|
217
|
-
mdc-typography.$styles: typography-config-to-mdc($config);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// Apply given rules.
|
|
221
|
-
@include disable-mdc-fallback-declarations {
|
|
222
|
-
@content;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Reset the original values.
|
|
226
|
-
mdc-typography.$styles: $orig-mdc-typography-styles;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// Disables MDC's CSS custom property fallbacks for the specified mixin content.
|
|
230
|
-
@mixin disable-mdc-fallback-declarations {
|
|
231
|
-
$previous-value: mdc-theme-css.$enable-fallback-declarations;
|
|
232
|
-
mdc-theme-css.$enable-fallback-declarations: false;
|
|
233
|
-
@content;
|
|
234
|
-
mdc-theme-css.$enable-fallback-declarations: $previous-value;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// Excludes the passed-in CSS content if the layout is too dense to supports touch targets.
|
|
238
|
-
@mixin if-touch-targets-unsupported($scale) {
|
|
239
|
-
@if ($scale == 'minimum' or (meta.type-of($scale) == 'number' and $scale < -1)) {
|
|
240
|
-
@content;
|
|
241
|
-
}
|
|
242
31
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
1
2
|
@use 'sass:map';
|
|
2
3
|
@use 'sass:meta';
|
|
3
4
|
|
|
@@ -9,9 +10,14 @@
|
|
|
9
10
|
/// @content Content to output under the current selector, or root selector if there is no current
|
|
10
11
|
/// selector.
|
|
11
12
|
@mixin current-selector-or-root($root: html) {
|
|
12
|
-
@
|
|
13
|
+
@if & {
|
|
13
14
|
@content;
|
|
14
15
|
}
|
|
16
|
+
@else {
|
|
17
|
+
#{$root} {
|
|
18
|
+
@content;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
/// A version of the standard `map.merge` function that takes a variable number of arguments.
|
|
@@ -47,3 +53,9 @@
|
|
|
47
53
|
@function coerce-to-list($value) {
|
|
48
54
|
@return if(meta.type-of($value) != 'list', ($value,), $value);
|
|
49
55
|
}
|
|
56
|
+
|
|
57
|
+
/// A version of the Sass `color.change` function that is safe ot use with CSS variables.
|
|
58
|
+
@function safe-color-change($color, $args...) {
|
|
59
|
+
$args: meta.keywords($args);
|
|
60
|
+
@return if(meta.type-of($color) == 'color', color.change($color, $args...), $color);
|
|
61
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
|
|
4
|
+
/// Validates that the object's type matches any of the expected types.
|
|
5
|
+
/// @param {any} $obj The object to test
|
|
6
|
+
/// @param {List} $types The expected types
|
|
7
|
+
/// @return {String} null if no error, else the unexpected type.
|
|
8
|
+
@function validate-type($obj, $types...) {
|
|
9
|
+
$result: meta.type-of($obj);
|
|
10
|
+
// A zero-length list is the same as a zero-length map.
|
|
11
|
+
@if ($result == list and list.index($types, map) and list.length($obj) == 0) {
|
|
12
|
+
@return null;
|
|
13
|
+
}
|
|
14
|
+
@return if(list.index($types, $result), null, $result);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/// Validates that a list contains only values from the allowed list of values.
|
|
18
|
+
/// @param {List} $list The list to test
|
|
19
|
+
/// @param {List} $allowed The allowed values
|
|
20
|
+
/// @return {List} null if no error, else the list of non-allowed values.
|
|
21
|
+
@function validate-allowed-values($list, $allowed...) {
|
|
22
|
+
$invalid: ();
|
|
23
|
+
@each $element in $list {
|
|
24
|
+
@if not list.index($allowed, $element) {
|
|
25
|
+
$invalid: list.append($invalid, $element);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
@return if(list.length($invalid) > 0, $invalid, null);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/// Validates that a list contains all values from the required list of values.
|
|
32
|
+
/// @param {List} $list The list to test
|
|
33
|
+
/// @param {List} $required The required values
|
|
34
|
+
/// @return {List} null if no error, else the list of missing values.
|
|
35
|
+
@function validate-required-values($list, $required...) {
|
|
36
|
+
$invalid: ();
|
|
37
|
+
@each $element in $required {
|
|
38
|
+
@if not list.index($list, $element) {
|
|
39
|
+
$invalid: list.append($invalid, $element);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
@return if(list.length($invalid) > 0, $invalid, null);
|
|
43
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Import all the theming functionality.
|
|
2
|
+
@use '@angular/material' as mat;
|
|
2
3
|
@use '../../alert/alert-theme';
|
|
3
4
|
@use '../../button/button-theme';
|
|
4
5
|
@use '../../colorpicker/colorpicker-theme';
|
|
@@ -11,28 +12,42 @@
|
|
|
11
12
|
@use '../../select/select-theme';
|
|
12
13
|
@use '../../split/split-theme';
|
|
13
14
|
@use '../../tooltip/tooltip-theme';
|
|
14
|
-
@use './theming';
|
|
15
15
|
|
|
16
16
|
// Create a theme.
|
|
17
|
-
@mixin all-component-themes($theme
|
|
17
|
+
@mixin all-component-themes($theme) {
|
|
18
18
|
$dedupe-key: 'angular-material-extensions-theme';
|
|
19
|
-
@include
|
|
20
|
-
@include alert-theme.theme($theme
|
|
21
|
-
@include button-theme.theme($theme
|
|
22
|
-
@include colorpicker-theme.theme($theme
|
|
23
|
-
@include datetimepicker-theme.theme($theme
|
|
24
|
-
@include drawer-theme.theme($theme
|
|
25
|
-
@include grid-theme.theme($theme
|
|
26
|
-
@include loader-theme.theme($theme
|
|
27
|
-
@include popover-theme.theme($theme
|
|
28
|
-
@include progress-theme.theme($theme
|
|
29
|
-
@include select-theme.theme($theme
|
|
30
|
-
@include split-theme.theme($theme
|
|
31
|
-
@include tooltip-theme.theme($theme
|
|
19
|
+
@include mat.private-check-duplicate-theme-styles($theme, $dedupe-key) {
|
|
20
|
+
@include alert-theme.theme($theme);
|
|
21
|
+
@include button-theme.theme($theme);
|
|
22
|
+
@include colorpicker-theme.theme($theme);
|
|
23
|
+
@include datetimepicker-theme.theme($theme);
|
|
24
|
+
@include drawer-theme.theme($theme);
|
|
25
|
+
@include grid-theme.theme($theme);
|
|
26
|
+
@include loader-theme.theme($theme);
|
|
27
|
+
@include popover-theme.theme($theme);
|
|
28
|
+
@include progress-theme.theme($theme);
|
|
29
|
+
@include select-theme.theme($theme);
|
|
30
|
+
@include split-theme.theme($theme);
|
|
31
|
+
@include tooltip-theme.theme($theme);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
@mixin all-component-bases($theme) {
|
|
36
|
+
@include alert-theme.base($theme);
|
|
37
|
+
@include button-theme.base($theme);
|
|
38
|
+
@include colorpicker-theme.base($theme);
|
|
39
|
+
@include datetimepicker-theme.base($theme);
|
|
40
|
+
@include drawer-theme.base($theme);
|
|
41
|
+
@include grid-theme.base($theme);
|
|
42
|
+
@include loader-theme.base($theme);
|
|
43
|
+
@include popover-theme.base($theme);
|
|
44
|
+
@include progress-theme.base($theme);
|
|
45
|
+
@include select-theme.base($theme);
|
|
46
|
+
@include split-theme.base($theme);
|
|
47
|
+
@include tooltip-theme.base($theme);
|
|
48
|
+
}
|
|
49
|
+
|
|
35
50
|
// @deprecated Use `all-component-themes`.
|
|
36
|
-
@mixin material-extensions-theme($theme
|
|
37
|
-
@include all-component-themes($theme
|
|
51
|
+
@mixin material-extensions-theme($theme) {
|
|
52
|
+
@include all-component-themes($theme);
|
|
38
53
|
}
|