@ng-matero/extensions 19.4.1 → 20.0.1
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 +1 -1
- package/alert/_alert-theme.scss +26 -31
- package/alert/_m2-alert.scss +59 -0
- package/alert/_m3-alert.scss +41 -0
- package/alert/alert.scss +27 -31
- package/alert/index.d.ts +30 -5
- package/button/index.d.ts +31 -5
- package/checkbox-group/index.d.ts +117 -5
- package/colorpicker/_colorpicker-theme.scss +31 -36
- package/{core/tokens/m2/mtx/_colorpicker.scss → colorpicker/_m2-colorpicker.scss} +6 -10
- package/colorpicker/_m3-colorpicker.scss +23 -0
- package/colorpicker/colorpicker-toggle.scss +4 -9
- package/colorpicker/index.d.ts +285 -3
- package/column-resize/index.d.ts +456 -3
- package/core/index.d.ts +147 -5
- package/core/theming/_color-api-backwards-compatibility.scss +8 -15
- package/core/theming/_definition.scss +81 -75
- package/core/theming/_palettes.scss +1036 -0
- package/core/tokens/{m2/_index.scss → _m2-tokens.scss} +22 -22
- package/core/tokens/_m2-utils.scss +108 -0
- package/core/tokens/_m3-system.scss +128 -106
- package/core/tokens/_m3-tokens.scss +36 -282
- package/core/tokens/_m3-utils.scss +48 -0
- package/core/tokens/_token-utils.scss +67 -239
- package/core/tokens/m3/_index.scss +7 -0
- package/core/tokens/m3/_md-sys-color.scss +156 -0
- package/core/tokens/m3/_md-sys-elevation.scss +15 -0
- package/core/tokens/m3/_md-sys-motion.scss +35 -0
- package/core/tokens/m3/_md-sys-shape.scss +21 -0
- package/core/tokens/m3/_md-sys-state.scss +13 -0
- package/core/tokens/m3/_md-sys-typescale.scss +128 -0
- package/core/tokens/m3/_theme.scss +47 -0
- package/datetimepicker/_datetimepicker-theme.scss +29 -39
- package/datetimepicker/_m2-datetimepicker.scss +149 -0
- package/datetimepicker/_m3-datetimepicker.scss +81 -0
- package/datetimepicker/calendar-body.scss +31 -56
- package/datetimepicker/calendar.scss +43 -79
- package/datetimepicker/clock.scss +28 -47
- package/datetimepicker/datetimepicker-content.scss +9 -15
- package/datetimepicker/datetimepicker-toggle.scss +4 -9
- package/datetimepicker/index.d.ts +1208 -3
- package/datetimepicker/time-view.scss +26 -32
- package/dialog/index.d.ts +54 -5
- package/drawer/_drawer-theme.scss +25 -30
- package/{core/tokens/m2/mtx/_drawer.scss → drawer/_m2-drawer.scss} +9 -12
- package/drawer/_m3-drawer.scss +24 -0
- package/drawer/drawer-container.scss +13 -24
- package/drawer/index.d.ts +221 -3
- package/fesm2022/mtxAlert.mjs +7 -7
- package/fesm2022/mtxAlert.mjs.map +1 -1
- package/fesm2022/mtxButton.mjs +11 -11
- package/fesm2022/mtxButton.mjs.map +1 -1
- package/fesm2022/mtxCheckboxGroup.mjs +7 -7
- package/fesm2022/mtxColorpicker.mjs +21 -21
- package/fesm2022/mtxColorpicker.mjs.map +1 -1
- package/fesm2022/mtxColumnResize.mjs +232 -103
- package/fesm2022/mtxColumnResize.mjs.map +1 -1
- package/fesm2022/mtxCore.mjs +21 -21
- package/fesm2022/mtxDatetimepicker.mjs +63 -67
- package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
- package/fesm2022/mtxDialog.mjs +10 -10
- package/fesm2022/mtxDialog.mjs.map +1 -1
- package/fesm2022/mtxDrawer.mjs +10 -10
- package/fesm2022/mtxGrid.mjs +78 -77
- package/fesm2022/mtxGrid.mjs.map +1 -1
- package/fesm2022/mtxLoader.mjs +7 -7
- package/fesm2022/mtxPhotoviewer.mjs +7 -7
- package/fesm2022/mtxPopover.mjs +24 -25
- package/fesm2022/mtxPopover.mjs.map +1 -1
- package/fesm2022/mtxProgress.mjs +7 -7
- package/fesm2022/mtxSelect.mjs +54 -54
- package/fesm2022/mtxSelect.mjs.map +1 -1
- package/fesm2022/mtxSplit.mjs +10 -10
- package/fesm2022/mtxTooltip.mjs +13 -13
- package/fesm2022/mtxTooltip.mjs.map +1 -1
- package/grid/_grid-theme.scss +24 -34
- package/grid/_m2-grid.scss +66 -0
- package/grid/_m3-grid.scss +35 -0
- package/grid/column-menu.scss +6 -23
- package/grid/column-resize/_column-resize.scss +35 -30
- package/grid/grid.scss +41 -74
- package/grid/index.d.ts +799 -3
- package/index.d.ts +2 -5
- package/loader/_loader-theme.scss +26 -31
- package/{core/tokens/m2/mtx/_loader.scss → loader/_m2-loader.scss} +5 -10
- package/loader/_m3-loader.scss +20 -0
- package/loader/index.d.ts +43 -5
- package/loader/loader.scss +4 -5
- package/package.json +28 -28
- package/photoviewer/index.d.ts +26 -5
- package/{core/tokens/m2/mtx/_popover.scss → popover/_m2-popover.scss} +9 -12
- package/popover/_m3-popover.scss +26 -0
- package/popover/_popover-theme.scss +26 -31
- package/popover/index.d.ts +399 -3
- package/popover/popover.scss +23 -29
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/progress/_m2-progress.scss +53 -0
- package/progress/_m3-progress.scss +33 -0
- package/progress/_progress-theme.scss +22 -34
- package/progress/index.d.ts +35 -5
- package/progress/progress.scss +28 -43
- package/select/_m2-select.scss +79 -0
- package/select/_m3-select.scss +46 -0
- package/select/_select-theme.scss +27 -37
- package/select/index.d.ts +381 -3
- package/select/select.scss +189 -205
- package/{core/tokens/m2/mtx/_split.scss → split/_m2-split.scss} +6 -9
- package/split/_m3-split.scss +23 -0
- package/split/_split-theme.scss +31 -34
- package/split/index.d.ts +255 -3
- package/split/split.scss +8 -11
- package/tooltip/_m2-tooltip.scss +50 -0
- package/tooltip/_m3-tooltip.scss +28 -0
- package/tooltip/_tooltip-theme.scss +23 -47
- package/tooltip/index.d.ts +345 -3
- package/tooltip/tooltip.scss +11 -15
- package/alert/alert-module.d.ts +0 -8
- package/alert/alert.d.ts +0 -19
- package/alert/public-api.d.ts +0 -2
- package/button/button-loading.d.ts +0 -19
- package/button/button-module.d.ts +0 -10
- package/button/public-api.d.ts +0 -2
- package/checkbox-group/checkbox-group-module.d.ts +0 -11
- package/checkbox-group/checkbox-group.d.ts +0 -86
- package/checkbox-group/interfaces.d.ts +0 -17
- package/checkbox-group/public-api.d.ts +0 -3
- package/colorpicker/colorpicker-animations.d.ts +0 -9
- package/colorpicker/colorpicker-input.d.ts +0 -88
- package/colorpicker/colorpicker-module.d.ts +0 -15
- package/colorpicker/colorpicker-toggle.d.ts +0 -39
- package/colorpicker/colorpicker.d.ts +0 -140
- package/colorpicker/public-api.d.ts +0 -5
- package/column-resize/column-resize-directives/column-resize-flex.d.ts +0 -29
- package/column-resize/column-resize-directives/column-resize.d.ts +0 -29
- package/column-resize/column-resize-directives/constants.d.ts +0 -10
- package/column-resize/column-resize-module.d.ts +0 -12
- package/column-resize/column-resize-notifier.d.ts +0 -48
- package/column-resize/column-resize.d.ts +0 -39
- package/column-resize/column-size-store.d.ts +0 -12
- package/column-resize/event-dispatcher.d.ts +0 -35
- package/column-resize/overlay-handle.d.ts +0 -43
- package/column-resize/polyfill.d.ts +0 -9
- package/column-resize/public-api.d.ts +0 -12
- package/column-resize/resizable.d.ts +0 -63
- package/column-resize/resize-ref.d.ts +0 -17
- package/column-resize/resize-strategy.d.ts +0 -84
- package/column-resize/selectors.d.ts +0 -10
- package/core/datetime/datetime-adapter.d.ts +0 -45
- package/core/datetime/datetime-formats.d.ts +0 -22
- package/core/datetime/datetime.module.d.ts +0 -15
- package/core/datetime/index.d.ts +0 -5
- package/core/datetime/native-datetime-adapter.d.ts +0 -40
- package/core/datetime/native-datetime-formats.d.ts +0 -2
- package/core/pipes/index.d.ts +0 -3
- package/core/pipes/is-template-ref.pipe.d.ts +0 -7
- package/core/pipes/pipes.module.d.ts +0 -9
- package/core/pipes/to-observable.pipe.d.ts +0 -8
- package/core/public-api.d.ts +0 -2
- package/core/theming/_inspection.scss +0 -38
- package/core/theming/_validation.scss +0 -5
- package/core/tokens/_density.scss +0 -49
- package/core/tokens/_format-tokens.scss +0 -5
- package/core/tokens/_token-definition.scss +0 -271
- package/core/tokens/m2/mdc/_plain-tooltip.scss +0 -63
- package/core/tokens/m2/mtx/_alert.scss +0 -62
- package/core/tokens/m2/mtx/_datetimepicker.scss +0 -152
- package/core/tokens/m2/mtx/_grid.scss +0 -69
- package/core/tokens/m2/mtx/_progress.scss +0 -56
- package/core/tokens/m2/mtx/_select.scss +0 -82
- package/core/tokens/m3/definitions/_index.scss +0 -9
- package/core/tokens/m3/definitions/_md-comp-plain-tooltip.scss +0 -51
- package/core/tokens/m3/definitions/_md-ref-palette.scss +0 -100
- package/core/tokens/m3/definitions/_md-ref-typeface.scss +0 -14
- package/core/tokens/m3/definitions/_md-sys-color.scss +0 -126
- package/core/tokens/m3/definitions/_md-sys-elevation.scss +0 -15
- package/core/tokens/m3/definitions/_md-sys-motion.scss +0 -46
- package/core/tokens/m3/definitions/_md-sys-shape.scss +0 -24
- package/core/tokens/m3/definitions/_md-sys-state.scss +0 -13
- package/core/tokens/m3/definitions/_md-sys-typescale.scss +0 -308
- package/core/tokens/m3/index.scss +0 -47
- package/core/tokens/m3/mdc/_plain-tooltip.scss +0 -15
- package/core/tokens/m3/mtx/_alert.scss +0 -41
- package/core/tokens/m3/mtx/_colorpicker.scss +0 -19
- package/core/tokens/m3/mtx/_datetimepicker.scss +0 -140
- package/core/tokens/m3/mtx/_drawer.scss +0 -22
- package/core/tokens/m3/mtx/_grid.scss +0 -32
- package/core/tokens/m3/mtx/_loader.scss +0 -22
- package/core/tokens/m3/mtx/_popover.scss +0 -25
- package/core/tokens/m3/mtx/_progress.scss +0 -32
- package/core/tokens/m3/mtx/_select.scss +0 -76
- package/core/tokens/m3/mtx/_split.scss +0 -30
- package/datetimepicker/calendar-body.d.ts +0 -66
- package/datetimepicker/calendar.d.ts +0 -157
- package/datetimepicker/clock.d.ts +0 -101
- package/datetimepicker/datetimepicker-actions.d.ts +0 -36
- package/datetimepicker/datetimepicker-animations.d.ts +0 -11
- package/datetimepicker/datetimepicker-errors.d.ts +0 -2
- package/datetimepicker/datetimepicker-filtertype.d.ts +0 -5
- package/datetimepicker/datetimepicker-input.d.ts +0 -105
- package/datetimepicker/datetimepicker-intl.d.ts +0 -53
- package/datetimepicker/datetimepicker-module.d.ts +0 -22
- package/datetimepicker/datetimepicker-toggle.d.ts +0 -42
- package/datetimepicker/datetimepicker-types.d.ts +0 -6
- package/datetimepicker/datetimepicker.d.ts +0 -274
- package/datetimepicker/month-view.d.ts +0 -80
- package/datetimepicker/multi-year-view.d.ts +0 -86
- package/datetimepicker/public-api.d.ts +0 -16
- package/datetimepicker/time-view.d.ts +0 -147
- package/datetimepicker/year-view.d.ts +0 -68
- package/dialog/dialog-config.d.ts +0 -17
- package/dialog/dialog-container.d.ts +0 -11
- package/dialog/dialog-module.d.ts +0 -12
- package/dialog/dialog.d.ts +0 -15
- package/dialog/public-api.d.ts +0 -4
- package/drawer/drawer-animations.d.ts +0 -8
- package/drawer/drawer-config.d.ts +0 -63
- package/drawer/drawer-container.d.ts +0 -35
- package/drawer/drawer-module.d.ts +0 -10
- package/drawer/drawer-ref.d.ts +0 -53
- package/drawer/drawer.d.ts +0 -59
- package/drawer/public-api.d.ts +0 -6
- package/grid/cell.d.ts +0 -32
- package/grid/column-menu.d.ts +0 -39
- package/grid/column-resize/column-resize-directives/column-resize-flex.d.ts +0 -24
- package/grid/column-resize/column-resize-directives/column-resize.d.ts +0 -24
- package/grid/column-resize/column-resize-directives/common.d.ts +0 -13
- package/grid/column-resize/column-resize-module.d.ts +0 -17
- package/grid/column-resize/index.d.ts +0 -7
- package/grid/column-resize/overlay-handle.d.ts +0 -32
- package/grid/column-resize/resizable-directives/common.d.ts +0 -19
- package/grid/column-resize/resizable-directives/resizable.d.ts +0 -32
- package/grid/column-resize/resize-strategy.d.ts +0 -20
- package/grid/expansion-toggle.d.ts +0 -17
- package/grid/grid-module.d.ts +0 -31
- package/grid/grid-pipes.d.ts +0 -39
- package/grid/grid-utils.d.ts +0 -33
- package/grid/grid.d.ts +0 -268
- package/grid/interfaces.d.ts +0 -180
- package/grid/public-api.d.ts +0 -17
- package/grid/selectable-cell.d.ts +0 -16
- package/loader/loader-module.d.ts +0 -10
- package/loader/loader.d.ts +0 -30
- package/loader/public-api.d.ts +0 -2
- package/photoviewer/photoviewer-module.d.ts +0 -7
- package/photoviewer/photoviewer.d.ts +0 -17
- package/photoviewer/public-api.d.ts +0 -2
- package/popover/popover-animations.d.ts +0 -11
- package/popover/popover-content.d.ts +0 -43
- package/popover/popover-errors.d.ts +0 -14
- package/popover/popover-interfaces.d.ts +0 -50
- package/popover/popover-module.d.ts +0 -13
- package/popover/popover-target.d.ts +0 -7
- package/popover/popover-trigger.d.ts +0 -132
- package/popover/popover-types.d.ts +0 -10
- package/popover/popover.d.ts +0 -147
- package/popover/public-api.d.ts +0 -8
- package/progress/progress-module.d.ts +0 -8
- package/progress/progress.d.ts +0 -24
- package/progress/public-api.d.ts +0 -2
- package/public-api.d.ts +0 -2
- package/select/option.d.ts +0 -21
- package/select/public-api.d.ts +0 -5
- package/select/select-intl.d.ts +0 -18
- package/select/select-module.d.ts +0 -12
- package/select/select.d.ts +0 -270
- package/select/templates.d.ts +0 -67
- package/split/interfaces.d.ts +0 -52
- package/split/public-api.d.ts +0 -5
- package/split/split-module.d.ts +0 -9
- package/split/split-pane.d.ts +0 -53
- package/split/split.d.ts +0 -133
- package/split/utils.d.ts +0 -13
- package/tooltip/public-api.d.ts +0 -3
- package/tooltip/tooltip-animations.d.ts +0 -9
- package/tooltip/tooltip-module.d.ts +0 -13
- package/tooltip/tooltip.d.ts +0 -321
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use 'sass:meta';
|
|
3
3
|
@use '@angular/material' as mat;
|
|
4
|
-
@use '
|
|
5
|
-
@use '
|
|
6
|
-
@use '
|
|
7
|
-
@use '
|
|
8
|
-
@use '
|
|
9
|
-
@use '
|
|
10
|
-
@use '
|
|
11
|
-
@use '
|
|
12
|
-
@use '
|
|
13
|
-
@use '
|
|
14
|
-
@use '
|
|
4
|
+
@use '../../alert/m2-alert';
|
|
5
|
+
@use '../../colorpicker/m2-colorpicker';
|
|
6
|
+
@use '../../datetimepicker/m2-datetimepicker';
|
|
7
|
+
@use '../../drawer/m2-drawer';
|
|
8
|
+
@use '../../grid/m2-grid';
|
|
9
|
+
@use '../../loader/m2-loader';
|
|
10
|
+
@use '../../popover/m2-popover';
|
|
11
|
+
@use '../../progress/m2-progress';
|
|
12
|
+
@use '../../select/m2-select';
|
|
13
|
+
@use '../../split/m2-split';
|
|
14
|
+
@use '../../tooltip/m2-tooltip';
|
|
15
15
|
|
|
16
16
|
/// Gets the tokens for the given theme, m2 tokens module, and theming system.
|
|
17
17
|
/// @param {Map} $theme The Angular Material theme object to generate token values from.
|
|
@@ -56,16 +56,16 @@
|
|
|
56
56
|
/// )
|
|
57
57
|
@function m2-tokens-from-theme($theme) {
|
|
58
58
|
@return mat.private-deep-merge-all(
|
|
59
|
-
_get-tokens-for-module($theme,
|
|
60
|
-
_get-tokens-for-module($theme,
|
|
61
|
-
_get-tokens-for-module($theme,
|
|
62
|
-
_get-tokens-for-module($theme,
|
|
63
|
-
_get-tokens-for-module($theme,
|
|
64
|
-
_get-tokens-for-module($theme,
|
|
65
|
-
_get-tokens-for-module($theme,
|
|
66
|
-
_get-tokens-for-module($theme,
|
|
67
|
-
_get-tokens-for-module($theme,
|
|
68
|
-
_get-tokens-for-module($theme,
|
|
69
|
-
_get-tokens-for-module($theme,
|
|
59
|
+
_get-tokens-for-module($theme, m2-alert),
|
|
60
|
+
_get-tokens-for-module($theme, m2-colorpicker),
|
|
61
|
+
_get-tokens-for-module($theme, m2-datetimepicker),
|
|
62
|
+
_get-tokens-for-module($theme, m2-drawer),
|
|
63
|
+
_get-tokens-for-module($theme, m2-grid),
|
|
64
|
+
_get-tokens-for-module($theme, m2-loader),
|
|
65
|
+
_get-tokens-for-module($theme, m2-popover),
|
|
66
|
+
_get-tokens-for-module($theme, m2-progress),
|
|
67
|
+
_get-tokens-for-module($theme, m2-select),
|
|
68
|
+
_get-tokens-for-module($theme, m2-split),
|
|
69
|
+
_get-tokens-for-module($theme, m2-tooltip),
|
|
70
70
|
);
|
|
71
71
|
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use 'sass:math';
|
|
3
|
+
@use 'sass:meta';
|
|
4
|
+
@use '@angular/material' as mat;
|
|
5
|
+
@use '../m2/typography';
|
|
6
|
+
|
|
7
|
+
$_placeholder-color-palette: mat.m2-define-palette(mat.$m2-red-palette);
|
|
8
|
+
|
|
9
|
+
// Indicates whether we're building internally. Used for backwards compatibility.
|
|
10
|
+
$private-is-internal-build: false;
|
|
11
|
+
|
|
12
|
+
// Placeholder color config that can be passed to token getter functions when generating token
|
|
13
|
+
// slots.
|
|
14
|
+
$placeholder-color-config: (
|
|
15
|
+
primary: $_placeholder-color-palette,
|
|
16
|
+
accent: $_placeholder-color-palette,
|
|
17
|
+
warn: $_placeholder-color-palette,
|
|
18
|
+
is-dark: false,
|
|
19
|
+
foreground: mat.$m2-light-theme-foreground-palette,
|
|
20
|
+
background: mat.$m2-light-theme-background-palette,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
$_placeholder-typography-level-config: typography.typography-config-level-from-mdc(body1);
|
|
24
|
+
|
|
25
|
+
// Placeholder typography config that can be passed to token getter functions when generating token
|
|
26
|
+
// slots.
|
|
27
|
+
$placeholder-typography-config: (
|
|
28
|
+
font-family: 'Roboto, sans-serif',
|
|
29
|
+
headline-1: $_placeholder-typography-level-config,
|
|
30
|
+
headline-2: $_placeholder-typography-level-config,
|
|
31
|
+
headline-3: $_placeholder-typography-level-config,
|
|
32
|
+
headline-4: $_placeholder-typography-level-config,
|
|
33
|
+
headline-5: $_placeholder-typography-level-config,
|
|
34
|
+
headline-6: $_placeholder-typography-level-config,
|
|
35
|
+
subtitle-1: $_placeholder-typography-level-config,
|
|
36
|
+
subtitle-2: $_placeholder-typography-level-config,
|
|
37
|
+
body-1: $_placeholder-typography-level-config,
|
|
38
|
+
body-2: $_placeholder-typography-level-config,
|
|
39
|
+
caption: $_placeholder-typography-level-config,
|
|
40
|
+
button: $_placeholder-typography-level-config,
|
|
41
|
+
overline: $_placeholder-typography-level-config,
|
|
42
|
+
subheading-1: $_placeholder-typography-level-config,
|
|
43
|
+
title: $_placeholder-typography-level-config,
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
// Placeholder density config that can be passed to token getter functions when generating token
|
|
47
|
+
// slots.
|
|
48
|
+
$placeholder-density-config: 0;
|
|
49
|
+
|
|
50
|
+
/// Inherited function from MDC that computes which contrast tone to use on top of a color.
|
|
51
|
+
/// This is used only in a narrow set of use cases when generating M2 button tokens to maintain
|
|
52
|
+
/// backwards compatibility.
|
|
53
|
+
/// @param {Color} $value Color for which we're calculating the contrast tone.
|
|
54
|
+
/// @param {Boolean} $is-dark Whether the current theme is dark.
|
|
55
|
+
/// @return {Map} Either `dark` or `light`.
|
|
56
|
+
@function contrast-tone($value, $is-dark) {
|
|
57
|
+
@if ($value =='dark') {
|
|
58
|
+
@return 'light';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@if ($value =='light') {
|
|
62
|
+
@return 'dark';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Fallback if the app is using a non-color palette (e.g. CSS variable based).
|
|
66
|
+
@if (meta.type-of($value) !='color') {
|
|
67
|
+
@return if($is-dark, 'light', 'dark');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
$minimum-contrast: 3.1;
|
|
71
|
+
$light-contrast: _contrast($value, #fff);
|
|
72
|
+
$dark-contrast: _contrast($value, rgb(0, 0, 0, 0.87));
|
|
73
|
+
|
|
74
|
+
@if ($light-contrast < $minimum-contrast) and ($dark-contrast > $light-contrast) {
|
|
75
|
+
@return 'dark';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@return 'light';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@function _linear-channel-value($channel-value) {
|
|
82
|
+
$normalized-channel-value: math.div($channel-value, 255);
|
|
83
|
+
|
|
84
|
+
@if ($normalized-channel-value < 0.03928) {
|
|
85
|
+
@return math.div($normalized-channel-value, 12.92);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@return math.pow(math.div($normalized-channel-value + 0.055, 1.055), 2.4);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Calculate the luminance for a color.
|
|
92
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
93
|
+
@function _luminance($color) {
|
|
94
|
+
$red: _linear-channel-value(color.red($color));
|
|
95
|
+
$green: _linear-channel-value(color.green($color));
|
|
96
|
+
$blue: _linear-channel-value(color.blue($color));
|
|
97
|
+
|
|
98
|
+
@return 0.2126 * $red + 0.7152 * $green + 0.0722 * $blue;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Calculate the contrast ratio between two colors.
|
|
102
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
103
|
+
@function _contrast($back, $front) {
|
|
104
|
+
$back-lum: _luminance($back) + 0.05;
|
|
105
|
+
$fore-lum: _luminance($front) + 0.05;
|
|
106
|
+
|
|
107
|
+
@return math.div(math.max($back-lum, $fore-lum), math.min($back-lum, $fore-lum));
|
|
108
|
+
}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use 'sass:meta';
|
|
3
|
-
@use '
|
|
4
|
-
@use '
|
|
3
|
+
@use '../../alert/m3-alert';
|
|
4
|
+
@use '../../colorpicker/m3-colorpicker';
|
|
5
|
+
@use '../../datetimepicker/m3-datetimepicker';
|
|
6
|
+
@use '../../drawer/m3-drawer';
|
|
7
|
+
@use '../../grid/m3-grid';
|
|
8
|
+
@use '../../loader/m3-loader';
|
|
9
|
+
@use '../../popover/m3-popover';
|
|
10
|
+
@use '../../progress/m3-progress';
|
|
11
|
+
@use '../../select/m3-select';
|
|
12
|
+
@use '../../split/m3-split';
|
|
13
|
+
@use '../../tooltip/m3-tooltip';
|
|
5
14
|
@use '../style/elevation';
|
|
6
15
|
@use '../theming/config-validation';
|
|
7
16
|
@use '../theming/definition';
|
|
8
|
-
@use '
|
|
9
|
-
@use './m3
|
|
17
|
+
@use '../theming/palettes';
|
|
18
|
+
@use './m3';
|
|
10
19
|
|
|
11
20
|
/// Emits necessary CSS variables for Material's system level values for the values defined in the
|
|
12
21
|
/// config map. The config map can have values color, typography, and/or density.
|
|
@@ -46,9 +55,40 @@
|
|
|
46
55
|
$color: map.set($color, theme-type, color-scheme);
|
|
47
56
|
}
|
|
48
57
|
|
|
49
|
-
$color-config:
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
$color-config: $color;
|
|
59
|
+
@if ($is-palette) {
|
|
60
|
+
$color: map.set($color, tertiary, $color);
|
|
61
|
+
$color-config: (
|
|
62
|
+
definition.$internals: (
|
|
63
|
+
palettes: (
|
|
64
|
+
primary: map.remove($color, neutral, neutral-variant, secondary),
|
|
65
|
+
secondary: map.get($color, secondary),
|
|
66
|
+
tertiary: map.remove($color, neutral, neutral-variant, secondary, error),
|
|
67
|
+
neutral: map.get($color, neutral),
|
|
68
|
+
neutral-variant: map.get($color, neutral-variant),
|
|
69
|
+
error: map.get($color, error),
|
|
70
|
+
),
|
|
71
|
+
theme-type: color-scheme,
|
|
72
|
+
)
|
|
73
|
+
);
|
|
74
|
+
} @else {
|
|
75
|
+
$primary: map.get($color, primary) or palettes.$violet-palette;
|
|
76
|
+
$tertiary: map.get($color, tertiary) or $primary;
|
|
77
|
+
$color-config: (
|
|
78
|
+
definition.$internals: (
|
|
79
|
+
palettes: (
|
|
80
|
+
primary: map.remove($primary, neutral, neutral-variant, secondary),
|
|
81
|
+
secondary: map.get($primary, secondary),
|
|
82
|
+
tertiary: map.remove($tertiary, neutral, neutral-variant, secondary, error),
|
|
83
|
+
neutral: map.get($primary, neutral),
|
|
84
|
+
neutral-variant: map.get($primary, neutral-variant),
|
|
85
|
+
error: map.get($primary, error),
|
|
86
|
+
),
|
|
87
|
+
theme-type: map.get($color, theme-type),
|
|
88
|
+
)
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
52
92
|
@include system-level-colors($color-config, $overrides, definition.$system-fallback-prefix);
|
|
53
93
|
@include system-level-elevation($color-config, $overrides, definition.$system-fallback-prefix);
|
|
54
94
|
}
|
|
@@ -56,9 +96,31 @@
|
|
|
56
96
|
$typography: map.get($config, typography);
|
|
57
97
|
$typography-config: null;
|
|
58
98
|
@if ($typography) {
|
|
59
|
-
$
|
|
60
|
-
|
|
61
|
-
|
|
99
|
+
$plain: (Roboto, sans-serif);
|
|
100
|
+
$brand: $plain;
|
|
101
|
+
$bold: 700;
|
|
102
|
+
$medium: 500;
|
|
103
|
+
$regular: 400;
|
|
104
|
+
@if (meta.type-of($typography) == map) {
|
|
105
|
+
$plain: map.get($typography, plain-family);
|
|
106
|
+
$brand: map.get($typography, brand-family) or $plain;
|
|
107
|
+
$bold: map.get($typography, bold-weight) or $bold;
|
|
108
|
+
$medium: map.get($typography, medium-weight) or $medium;
|
|
109
|
+
$regular: map.get($typography, regular-weight) or $regular;
|
|
110
|
+
} @else {
|
|
111
|
+
$plain: $typography;
|
|
112
|
+
}
|
|
113
|
+
$typography-config: (
|
|
114
|
+
definition.$internals: (
|
|
115
|
+
font-definition: (
|
|
116
|
+
plain: $plain,
|
|
117
|
+
brand: $brand,
|
|
118
|
+
bold: $bold,
|
|
119
|
+
medium: $medium,
|
|
120
|
+
regular: $regular,
|
|
121
|
+
)
|
|
122
|
+
)
|
|
123
|
+
);
|
|
62
124
|
@include system-level-typography(
|
|
63
125
|
$typography-config, $overrides, definition.$system-fallback-prefix);
|
|
64
126
|
}
|
|
@@ -66,17 +128,19 @@
|
|
|
66
128
|
$density: map.get($config, density);
|
|
67
129
|
$density-config: null;
|
|
68
130
|
@if ($density) {
|
|
69
|
-
$
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
131
|
+
$scale: 0;
|
|
132
|
+
@if (meta.type-of($density) == map) {
|
|
133
|
+
$scale: map.get($density, scale);
|
|
134
|
+
} @else {
|
|
135
|
+
$scale: $density;
|
|
136
|
+
}
|
|
73
137
|
@if ($scale != 0) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
138
|
+
// Emit component-level density tokens if the scale is lower than 0. The density tokens
|
|
139
|
+
// do not fallback to any system-level values and must be defined if the scale is different.
|
|
140
|
+
$density-tokens: get-density-tokens($scale);
|
|
141
|
+
@each $tokens in $density-tokens {
|
|
142
|
+
@each $token-name, $token-value in $tokens {
|
|
143
|
+
--mat-#{$token-name}: #{$token-value};
|
|
80
144
|
}
|
|
81
145
|
}
|
|
82
146
|
}
|
|
@@ -86,15 +150,38 @@
|
|
|
86
150
|
@include system-level-state($overrides: $overrides, $prefix: definition.$system-fallback-prefix);
|
|
87
151
|
}
|
|
88
152
|
|
|
153
|
+
// Gets all density-related tokens from the components.
|
|
154
|
+
@function get-density-tokens($scale) {
|
|
155
|
+
@return (
|
|
156
|
+
m3-alert.get-density-tokens($scale),
|
|
157
|
+
m3-colorpicker.get-density-tokens($scale),
|
|
158
|
+
m3-datetimepicker.get-density-tokens($scale),
|
|
159
|
+
m3-drawer.get-density-tokens($scale),
|
|
160
|
+
m3-grid.get-density-tokens($scale),
|
|
161
|
+
m3-loader.get-density-tokens($scale),
|
|
162
|
+
m3-popover.get-density-tokens($scale),
|
|
163
|
+
m3-progress.get-density-tokens($scale),
|
|
164
|
+
m3-select.get-density-tokens($scale),
|
|
165
|
+
m3-split.get-density-tokens($scale),
|
|
166
|
+
m3-tooltip.get-density-tokens($scale),
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
89
170
|
/// Emits the system-level CSS variables for each of the provided override values. E.g. to
|
|
90
171
|
/// change the primary color to red, use `mat.theme-overrides((primary: red));`
|
|
91
172
|
@mixin theme-overrides($overrides, $prefix: definition.$system-fallback-prefix) {
|
|
92
173
|
$sys-names: map-merge-all(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
174
|
+
m3.md-sys-color-values-light(palettes.$blue-palette),
|
|
175
|
+
m3.md-sys-typescale-values((
|
|
176
|
+
brand: (Roboto),
|
|
177
|
+
plain: (Roboto),
|
|
178
|
+
bold: 700,
|
|
179
|
+
medium: 500,
|
|
180
|
+
regular: 400
|
|
181
|
+
)),
|
|
182
|
+
m3.md-sys-elevation-values(),
|
|
183
|
+
m3.md-sys-shape-values(),
|
|
184
|
+
m3.md-sys-state-values());
|
|
98
185
|
|
|
99
186
|
& {
|
|
100
187
|
@each $name, $value in $overrides {
|
|
@@ -106,36 +193,21 @@
|
|
|
106
193
|
}
|
|
107
194
|
|
|
108
195
|
@mixin system-level-colors($theme, $overrides: (), $prefix: null) {
|
|
109
|
-
$palettes: map.get($theme,
|
|
110
|
-
$
|
|
111
|
-
neutral: map.get($palettes, neutral),
|
|
112
|
-
neutral-variant: map.get($palettes, neutral-variant),
|
|
113
|
-
secondary: map.get($palettes, secondary),
|
|
114
|
-
error: map.get($palettes, error),
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
$type: map.get($theme, _mat-theming-internals-do-not-access, theme-type);
|
|
118
|
-
$primary: map.merge(map.get($palettes, primary), $base-palettes);
|
|
119
|
-
$tertiary: map.merge(map.get($palettes, tertiary), $base-palettes);
|
|
120
|
-
$error: map.get($palettes, error);
|
|
196
|
+
$palettes: map.get($theme, definition.$internals, palettes);
|
|
197
|
+
$type: map.get($theme, definition.$internals, theme-type);
|
|
121
198
|
|
|
122
199
|
@if (not $prefix) {
|
|
123
|
-
$prefix: map.get($theme,
|
|
200
|
+
$prefix: map.get($theme, definition.$internals,
|
|
124
201
|
color-system-variables-prefix) or definition.$system-level-prefix;
|
|
125
202
|
}
|
|
126
203
|
|
|
127
|
-
$ref: (
|
|
128
|
-
md-ref-palette: m3-tokens.generate-ref-palette-tokens($primary, $tertiary, $error)
|
|
129
|
-
);
|
|
130
204
|
|
|
131
|
-
$sys-colors: _generate-sys-colors($
|
|
205
|
+
$sys-colors: _generate-sys-colors($palettes, $type);
|
|
132
206
|
|
|
133
207
|
// Manually insert a subset of palette values that are used directly by components
|
|
134
208
|
// instead of system variables.
|
|
135
|
-
$sys-colors: map.set($sys-colors,
|
|
136
|
-
|
|
137
|
-
$sys-colors: map.set($sys-colors,
|
|
138
|
-
'neutral10', map.get($ref, md-ref-palette, neutral10));
|
|
209
|
+
$sys-colors: map.set($sys-colors, neutral-variant20, map.get($palettes, neutral-variant, 20));
|
|
210
|
+
$sys-colors: map.set($sys-colors, neutral10, map.get($palettes, neutral, 10));
|
|
139
211
|
|
|
140
212
|
& {
|
|
141
213
|
@each $name, $value in $sys-colors {
|
|
@@ -144,13 +216,13 @@
|
|
|
144
216
|
}
|
|
145
217
|
}
|
|
146
218
|
|
|
147
|
-
@function _generate-sys-colors($
|
|
148
|
-
$light-sys-colors:
|
|
219
|
+
@function _generate-sys-colors($palettes, $type) {
|
|
220
|
+
$light-sys-colors: m3.md-sys-color-values-light($palettes);
|
|
149
221
|
@if ($type == light) {
|
|
150
222
|
@return $light-sys-colors;
|
|
151
223
|
}
|
|
152
224
|
|
|
153
|
-
$dark-sys-colors:
|
|
225
|
+
$dark-sys-colors: m3.md-sys-color-values-dark($palettes);
|
|
154
226
|
@if ($type == dark) {
|
|
155
227
|
@return $dark-sys-colors;
|
|
156
228
|
}
|
|
@@ -169,23 +241,15 @@
|
|
|
169
241
|
}
|
|
170
242
|
|
|
171
243
|
@mixin system-level-typography($theme, $overrides: (), $prefix: null) {
|
|
172
|
-
$font-definition: map.get($theme,
|
|
173
|
-
$brand: map.get($font-definition, brand);
|
|
174
|
-
$plain: map.get($font-definition, plain);
|
|
175
|
-
$bold: map.get($font-definition, bold);
|
|
176
|
-
$medium: map.get($font-definition, medium);
|
|
177
|
-
$regular: map.get($font-definition, regular);
|
|
178
|
-
$ref: (md-ref-typeface:
|
|
179
|
-
m3-tokens.generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular)
|
|
180
|
-
);
|
|
244
|
+
$font-definition: map.get($theme, definition.$internals, font-definition);
|
|
181
245
|
|
|
182
246
|
@if (not $prefix) {
|
|
183
|
-
$prefix: map.get($theme,
|
|
247
|
+
$prefix: map.get($theme, definition.$internals,
|
|
184
248
|
typography-system-variables-prefix) or definition.$system-level-prefix;
|
|
185
249
|
}
|
|
186
250
|
|
|
187
251
|
& {
|
|
188
|
-
@each $name, $value in
|
|
252
|
+
@each $name, $value in m3.md-sys-typescale-values($font-definition) {
|
|
189
253
|
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
190
254
|
}
|
|
191
255
|
}
|
|
@@ -193,9 +257,9 @@
|
|
|
193
257
|
|
|
194
258
|
@mixin system-level-elevation($theme, $overrides: (), $prefix: definition.$system-level-prefix) {
|
|
195
259
|
$shadow-color: map.get(
|
|
196
|
-
$theme,
|
|
260
|
+
$theme, definition.$internals, palettes, neutral, 0);
|
|
197
261
|
|
|
198
|
-
@each $name, $value in
|
|
262
|
+
@each $name, $value in m3.md-sys-elevation-values() {
|
|
199
263
|
$level: map.get($overrides, $name) or $value;
|
|
200
264
|
$value: elevation.get-box-shadow($level, $shadow-color);
|
|
201
265
|
|
|
@@ -207,7 +271,7 @@
|
|
|
207
271
|
|
|
208
272
|
@mixin system-level-shape($theme: (), $overrides: (), $prefix: definition.$system-level-prefix) {
|
|
209
273
|
& {
|
|
210
|
-
@each $name, $value in
|
|
274
|
+
@each $name, $value in m3.md-sys-shape-values() {
|
|
211
275
|
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
212
276
|
}
|
|
213
277
|
}
|
|
@@ -215,54 +279,12 @@
|
|
|
215
279
|
|
|
216
280
|
@mixin system-level-state($theme: (), $overrides: (), $prefix: definition.$system-level-prefix) {
|
|
217
281
|
& {
|
|
218
|
-
@each $name, $value in
|
|
282
|
+
@each $name, $value in m3.md-sys-state-values() {
|
|
219
283
|
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
220
284
|
}
|
|
221
285
|
}
|
|
222
286
|
}
|
|
223
287
|
|
|
224
|
-
// Return a new map where the values are the same as the provided map's
|
|
225
|
-
// keys, prefixed with "--mat-sys-". For example:
|
|
226
|
-
// (key1: '', key2: '') --> (key1: --mat-sys-key1, key2: --mat-sys-key2)
|
|
227
|
-
@function _create-system-app-vars-map($map) {
|
|
228
|
-
$new-map: ();
|
|
229
|
-
@each $key, $value in $map {
|
|
230
|
-
$new-map: map.set($new-map, $key, --#{definition.$system-fallback-prefix}-#{$key});
|
|
231
|
-
}
|
|
232
|
-
@return $new-map;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// Create a components tokens map where values are based on
|
|
236
|
-
// system fallback variables referencing Material's system keys.
|
|
237
|
-
// Includes density token fallbacks where density is 0.
|
|
238
|
-
@function create-system-fallbacks() {
|
|
239
|
-
$app-vars: (
|
|
240
|
-
'md-sys-color':
|
|
241
|
-
_create-system-app-vars-map(definitions.md-sys-color-values-light()),
|
|
242
|
-
'md-sys-typescale':
|
|
243
|
-
_create-system-app-vars-map(definitions.md-sys-typescale-values()),
|
|
244
|
-
'md-sys-elevation':
|
|
245
|
-
_create-system-app-vars-map(definitions.md-sys-elevation-values()),
|
|
246
|
-
'md-sys-state':
|
|
247
|
-
_create-system-app-vars-map(definitions.md-sys-state-values()),
|
|
248
|
-
'md-sys-shape':
|
|
249
|
-
_create-system-app-vars-map(definitions.md-sys-shape-values()),
|
|
250
|
-
// Add a subset of palette-specific colors used by components instead of system values
|
|
251
|
-
'md-ref-palette':
|
|
252
|
-
_create-system-app-vars-map(
|
|
253
|
-
(
|
|
254
|
-
neutral10: '', // Form field native select option text color
|
|
255
|
-
neutral-variant20: '', // Sidenav scrim (container background shadow when opened),
|
|
256
|
-
)
|
|
257
|
-
),
|
|
258
|
-
);
|
|
259
|
-
|
|
260
|
-
@return mat.private-deep-merge-all(
|
|
261
|
-
m3-tokens.generate-tokens($app-vars, true, true),
|
|
262
|
-
m3-tokens.generate-density-tokens(0)
|
|
263
|
-
);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
288
|
/// Creates a single merged map from the provided variable-length map arguments
|
|
267
289
|
@function map-merge-all($maps...) {
|
|
268
290
|
$result: ();
|