@ng-matero/extensions 16.3.0 → 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 +35 -41
- 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,463 +0,0 @@
|
|
|
1
|
-
@use 'sass:list';
|
|
2
|
-
@use 'sass:map';
|
|
3
|
-
@use 'sass:meta';
|
|
4
|
-
@use 'palette';
|
|
5
|
-
|
|
6
|
-
// Whether duplication warnings should be disabled. Warnings enabled by default.
|
|
7
|
-
$theme-ignore-duplication-warnings: false !default;
|
|
8
|
-
|
|
9
|
-
// Whether density should be generated by default.
|
|
10
|
-
$_generate-default-density: true !default;
|
|
11
|
-
|
|
12
|
-
// Warning that will be printed if duplicated styles are generated by a theme.
|
|
13
|
-
$_duplicate-warning: 'Read more about how style duplication can be avoided in a dedicated ' +
|
|
14
|
-
'guide. https://github.com/angular/components/blob/main/guides/duplicate-theming-styles.md';
|
|
15
|
-
|
|
16
|
-
// Warning that will be printed if the legacy theming API is used.
|
|
17
|
-
$_legacy-theme-warning: 'Angular Material themes should be created from a map containing the ' +
|
|
18
|
-
'keys "color", "typography", and "density". The color value should be a map containing the ' +
|
|
19
|
-
'palette values for "primary", "accent", and "warn". ' +
|
|
20
|
-
'See https://material.angular.io/guide/theming for more information.';
|
|
21
|
-
|
|
22
|
-
// Flag whether theme config getter functions should warn if a key is expected to exist but not
|
|
23
|
-
// present in the config. This can be transformed internally in Google to ensure all clients have
|
|
24
|
-
// comprehensive theme configurations.
|
|
25
|
-
$_enable-strict-theme-config: false;
|
|
26
|
-
|
|
27
|
-
// Flag whether to disable theme definitions copying color values to the top-level theme config.
|
|
28
|
-
// This copy is to preserve backwards compatibility.
|
|
29
|
-
$_disable-color-backwards-compatibility: false;
|
|
30
|
-
|
|
31
|
-
// These variable are not intended to be overridden externally. They use `!default` to
|
|
32
|
-
// avoid being reset every time this file is imported.
|
|
33
|
-
$_emitted-color: () !default;
|
|
34
|
-
$_emitted-typography: () !default;
|
|
35
|
-
$_emitted-density: () !default;
|
|
36
|
-
|
|
37
|
-
/// Extracts a color from a palette or throws an error if it doesn't exist.
|
|
38
|
-
/// @param {Map} $palette The palette from which to extract a color.
|
|
39
|
-
/// @param {String | Number} $hue The hue for which to get the color.
|
|
40
|
-
@function _get-color-from-palette($palette, $hue) {
|
|
41
|
-
@if map.has-key($palette, $hue) {
|
|
42
|
-
@return map.get($palette, $hue);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@error 'Hue "' + $hue + '" does not exist in palette. Available hues are: ' + map.keys($palette);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/// For a given hue in a palette, return the contrast color from the map of contrast palettes.
|
|
49
|
-
/// @param {Map} $palette The palette from which to extract a color.
|
|
50
|
-
/// @param {String | Number} $hue The hue for which to get a contrast color.
|
|
51
|
-
/// @returns {Color} The contrast color for the given palette and hue.
|
|
52
|
-
@function get-contrast-color-from-palette($palette, $hue) {
|
|
53
|
-
@return map.get(map.get($palette, contrast), $hue);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/// Creates a map of hues to colors for a theme. This is used to define a theme palette in terms
|
|
57
|
-
/// of the Material Design hues.
|
|
58
|
-
/// @param {Map} $base-palette Map of hue keys to color values for the basis for this palette.
|
|
59
|
-
/// @param {String | Number} $default Default hue for this palette.
|
|
60
|
-
/// @param {String | Number} $lighter "lighter" hue for this palette.
|
|
61
|
-
/// @param {String | Number} $darker "darker" hue for this palette.
|
|
62
|
-
/// @param {String | Number} $text "text" hue for this palette.
|
|
63
|
-
/// @returns {Map} A complete Angular Material theming palette.
|
|
64
|
-
@function define-palette($base-palette, $default: 500, $lighter: 100, $darker: 700,
|
|
65
|
-
$text: $default) {
|
|
66
|
-
$result: map.merge(
|
|
67
|
-
$base-palette,
|
|
68
|
-
(
|
|
69
|
-
default: _get-color-from-palette($base-palette, $default),
|
|
70
|
-
lighter: _get-color-from-palette($base-palette, $lighter),
|
|
71
|
-
darker: _get-color-from-palette($base-palette, $darker),
|
|
72
|
-
text: _get-color-from-palette($base-palette, $text),
|
|
73
|
-
default-contrast: get-contrast-color-from-palette($base-palette, $default),
|
|
74
|
-
lighter-contrast: get-contrast-color-from-palette($base-palette, $lighter),
|
|
75
|
-
darker-contrast: get-contrast-color-from-palette($base-palette, $darker)
|
|
76
|
-
)
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
// For each hue in the palette, add a "-contrast" color to the map.
|
|
80
|
-
@each $hue, $color in $base-palette {
|
|
81
|
-
$result: map.merge(
|
|
82
|
-
$result,
|
|
83
|
-
(
|
|
84
|
-
'#{$hue}-contrast': get-contrast-color-from-palette($base-palette, $hue)
|
|
85
|
-
)
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
@return $result;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/// Gets a color from a theme palette (the output of mat-palette).
|
|
93
|
-
/// The hue can be one of the standard values (500, A400, etc.), one of the three preconfigured
|
|
94
|
-
/// hues (default, lighter, darker), or any of the aforementioned suffixed with "-contrast".
|
|
95
|
-
///
|
|
96
|
-
/// @param {Map} $palette The palette from which to extract a color.
|
|
97
|
-
/// @param {String | Number} $hue The hue from the palette to use. If this is a value between 0
|
|
98
|
-
// and 1, it will be treated as opacity.
|
|
99
|
-
/// @param {Number} $opacity The alpha channel value for the color.
|
|
100
|
-
/// @returns {Color} The color for the given palette, hue, and opacity.
|
|
101
|
-
@function get-color-from-palette($palette, $hue: default, $opacity: null) {
|
|
102
|
-
// If hueKey is a number between zero and one, then it actually contains an
|
|
103
|
-
// opacity value, so recall this function with the default hue and that given opacity.
|
|
104
|
-
@if meta.type-of($hue) == number and $hue >= 0 and $hue <= 1 {
|
|
105
|
-
@return get-color-from-palette($palette, default, $hue);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// We cast the $hue to a string, because some hues starting with a number, like `700-contrast`,
|
|
109
|
-
// might be inferred as numbers by Sass. Casting them to string fixes the map lookup.
|
|
110
|
-
$color: if(map.has-key($palette, $hue), map.get($palette, $hue), map.get($palette, $hue + ''));
|
|
111
|
-
|
|
112
|
-
@if (meta.type-of($color) != color) {
|
|
113
|
-
// If the $color resolved to something different from a color (e.g. a CSS variable),
|
|
114
|
-
// we can't apply the opacity anyway so we return the value as is, otherwise Sass can
|
|
115
|
-
// throw an error or output something invalid.
|
|
116
|
-
@return $color;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
@return rgba($color, if($opacity == null, opacity($color), $opacity));
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// Validates the specified theme by ensuring that the optional color config defines
|
|
123
|
-
// a primary, accent and warn palette. Returns the theme if no failures were found.
|
|
124
|
-
@function _mat-validate-theme($theme) {
|
|
125
|
-
@if map.get($theme, color) {
|
|
126
|
-
$color: map.get($theme, color);
|
|
127
|
-
@if not map.get($color, primary) {
|
|
128
|
-
@error 'Theme does not define a valid "primary" palette.';
|
|
129
|
-
}
|
|
130
|
-
@else if not map.get($color, accent) {
|
|
131
|
-
@error 'Theme does not define a valid "accent" palette.';
|
|
132
|
-
}
|
|
133
|
-
@else if not map.get($color, warn) {
|
|
134
|
-
@error 'Theme does not define a valid "warn" palette.';
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
@return $theme;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// Creates a light-themed color configuration from the specified
|
|
141
|
-
// primary, accent and warn palettes.
|
|
142
|
-
@function _mat-create-light-color-config($primary, $accent, $warn: null) {
|
|
143
|
-
@return (
|
|
144
|
-
primary: $primary,
|
|
145
|
-
accent: $accent,
|
|
146
|
-
warn: if($warn != null, $warn, define-palette(palette.$red-palette)),
|
|
147
|
-
is-dark: false,
|
|
148
|
-
foreground: palette.$light-theme-foreground-palette,
|
|
149
|
-
background: palette.$light-theme-background-palette,
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// Creates a dark-themed color configuration from the specified
|
|
154
|
-
// primary, accent and warn palettes.
|
|
155
|
-
@function _mat-create-dark-color-config($primary, $accent, $warn: null) {
|
|
156
|
-
@return (
|
|
157
|
-
primary: $primary,
|
|
158
|
-
accent: $accent,
|
|
159
|
-
warn: if($warn != null, $warn, define-palette(palette.$red-palette)),
|
|
160
|
-
is-dark: true,
|
|
161
|
-
foreground: palette.$dark-theme-foreground-palette,
|
|
162
|
-
background: palette.$dark-theme-background-palette,
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// TODO: Remove legacy API and rename `$primary` below to `$config`. Currently it cannot be renamed
|
|
167
|
-
// as it would break existing apps that set the parameter by name.
|
|
168
|
-
|
|
169
|
-
/// Creates a container object for a light theme to be given to individual component theme mixins.
|
|
170
|
-
/// @param {Map} $primary The theme configuration object.
|
|
171
|
-
/// @returns {Map} A complete Angular Material theme map.
|
|
172
|
-
@function define-light-theme($primary, $accent: null, $warn: define-palette(palette.$red-palette)) {
|
|
173
|
-
// This function creates a container object for the individual component theme mixins. Consumers
|
|
174
|
-
// can construct such an object by calling this function, or by building the object manually.
|
|
175
|
-
// There are two possible ways to invoke this function in order to create such an object:
|
|
176
|
-
//
|
|
177
|
-
// (1) Passing in a map that holds optional configurations for individual parts of the
|
|
178
|
-
// theming system. For `color` configurations, the function only expects the palettes
|
|
179
|
-
// for `primary` and `accent` (and optionally `warn`). The function will expand the
|
|
180
|
-
// shorthand into an actual configuration that can be consumed in `-color` mixins.
|
|
181
|
-
// (2) Legacy pattern: Passing in the palettes as parameters. This is not as flexible
|
|
182
|
-
// as passing in a configuration map because only the `color` system can be configured.
|
|
183
|
-
//
|
|
184
|
-
// If the legacy pattern is used, we generate a container object only with a light-themed
|
|
185
|
-
// configuration for the `color` theming part.
|
|
186
|
-
@if $accent != null {
|
|
187
|
-
@warn $_legacy-theme-warning;
|
|
188
|
-
@return private-create-backwards-compatibility-theme(_mat-validate-theme((
|
|
189
|
-
_is-legacy-theme: true,
|
|
190
|
-
color: _mat-create-light-color-config($primary, $accent, $warn),
|
|
191
|
-
)));
|
|
192
|
-
}
|
|
193
|
-
// If the map pattern is used (1), we just pass-through the configurations for individual
|
|
194
|
-
// parts of the theming system, but update the `color` configuration if set. As explained
|
|
195
|
-
// above, the color shorthand will be expanded to an actual light-themed color configuration.
|
|
196
|
-
$result: $primary;
|
|
197
|
-
@if map.get($primary, color) {
|
|
198
|
-
$color-settings: map.get($primary, color);
|
|
199
|
-
$primary: map.get($color-settings, primary);
|
|
200
|
-
$accent: map.get($color-settings, accent);
|
|
201
|
-
$warn: map.get($color-settings, warn);
|
|
202
|
-
$result: map.merge($result, (color: _mat-create-light-color-config($primary, $accent, $warn)));
|
|
203
|
-
}
|
|
204
|
-
@return private-create-backwards-compatibility-theme(_mat-validate-theme($result));
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// TODO: Remove legacy API and rename below `$primary` to `$config`. Currently it cannot be renamed
|
|
208
|
-
// as it would break existing apps that set the parameter by name.
|
|
209
|
-
|
|
210
|
-
/// Creates a container object for a dark theme to be given to individual component theme mixins.
|
|
211
|
-
/// @param {Map} $primary The theme configuration object.
|
|
212
|
-
/// @returns {Map} A complete Angular Material theme map.
|
|
213
|
-
@function define-dark-theme($primary, $accent: null, $warn: define-palette(palette.$red-palette)) {
|
|
214
|
-
// This function creates a container object for the individual component theme mixins. Consumers
|
|
215
|
-
// can construct such an object by calling this function, or by building the object manually.
|
|
216
|
-
// There are two possible ways to invoke this function in order to create such an object:
|
|
217
|
-
//
|
|
218
|
-
// (1) Passing in a map that holds optional configurations for individual parts of the
|
|
219
|
-
// theming system. For `color` configurations, the function only expects the palettes
|
|
220
|
-
// for `primary` and `accent` (and optionally `warn`). The function will expand the
|
|
221
|
-
// shorthand into an actual configuration that can be consumed in `-color` mixins.
|
|
222
|
-
// (2) Legacy pattern: Passing in the palettes as parameters. This is not as flexible
|
|
223
|
-
// as passing in a configuration map because only the `color` system can be configured.
|
|
224
|
-
//
|
|
225
|
-
// If the legacy pattern is used, we generate a container object only with a dark-themed
|
|
226
|
-
// configuration for the `color` theming part.
|
|
227
|
-
@if $accent != null {
|
|
228
|
-
@warn $_legacy-theme-warning;
|
|
229
|
-
@return private-create-backwards-compatibility-theme(_mat-validate-theme((
|
|
230
|
-
_is-legacy-theme: true,
|
|
231
|
-
color: _mat-create-dark-color-config($primary, $accent, $warn),
|
|
232
|
-
)));
|
|
233
|
-
}
|
|
234
|
-
// If the map pattern is used (1), we just pass-through the configurations for individual
|
|
235
|
-
// parts of the theming system, but update the `color` configuration if set. As explained
|
|
236
|
-
// above, the color shorthand will be expanded to an actual dark-themed color configuration.
|
|
237
|
-
$result: $primary;
|
|
238
|
-
@if map.get($primary, color) {
|
|
239
|
-
$color-settings: map.get($primary, color);
|
|
240
|
-
$primary: map.get($color-settings, primary);
|
|
241
|
-
$accent: map.get($color-settings, accent);
|
|
242
|
-
$warn: map.get($color-settings, warn);
|
|
243
|
-
$result: map.merge($result, (color: _mat-create-dark-color-config($primary, $accent, $warn)));
|
|
244
|
-
}
|
|
245
|
-
@return private-create-backwards-compatibility-theme(_mat-validate-theme($result));
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
/// Gets the color configuration from the given theme or configuration.
|
|
249
|
-
/// @param {Map} $theme The theme map returned from `define-light-theme` or `define-dark-theme`.
|
|
250
|
-
/// @param {Map} $default The default value returned if the given `$theme` does not include a
|
|
251
|
-
/// `color` configuration.
|
|
252
|
-
/// @returns {Map} Color configuration for a theme.
|
|
253
|
-
@function get-color-config($theme, $default: null) {
|
|
254
|
-
// If a configuration has been passed, return the config directly.
|
|
255
|
-
@if not private-is-theme-object($theme) {
|
|
256
|
-
@return $theme;
|
|
257
|
-
}
|
|
258
|
-
// If the theme has been constructed through the legacy theming API, we use the theme object
|
|
259
|
-
// as color configuration instead of the dedicated `color` property. We do this because for
|
|
260
|
-
// backwards compatibility, we copied the color configuration from `$theme.color` to `$theme`.
|
|
261
|
-
// Hence developers could customize the colors at top-level and want to respect these changes
|
|
262
|
-
// TODO: Remove when legacy theming API is removed.
|
|
263
|
-
@if private-is-legacy-constructed-theme($theme) {
|
|
264
|
-
@return $theme;
|
|
265
|
-
}
|
|
266
|
-
@if map.has-key($theme, color) {
|
|
267
|
-
@return map.get($theme, color);
|
|
268
|
-
}
|
|
269
|
-
@else if ($_enable-strict-theme-config) {
|
|
270
|
-
@error 'Angular Material theme configuration is missing a "color" value';
|
|
271
|
-
}
|
|
272
|
-
@return $default;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/// Gets the density configuration from the given theme or configuration.
|
|
276
|
-
/// @param {Map} $theme-or-config The theme map returned from `define-light-theme` or
|
|
277
|
-
/// `define-dark-theme`.
|
|
278
|
-
/// @param {Map} $default The default value returned if the given `$theme` does not include a
|
|
279
|
-
/// `density` configuration.
|
|
280
|
-
/// @returns {Map} Density configuration for a theme.
|
|
281
|
-
@function get-density-config($theme-or-config, $default: 0) {
|
|
282
|
-
// If a configuration has been passed, return the config directly.
|
|
283
|
-
@if not private-is-theme-object($theme-or-config) {
|
|
284
|
-
@return $theme-or-config;
|
|
285
|
-
}
|
|
286
|
-
// In case a theme has been passed, extract the configuration if present,
|
|
287
|
-
// or fall back to the default density config.
|
|
288
|
-
@if map.has-key($theme-or-config, density) {
|
|
289
|
-
@return map.get($theme-or-config, density);
|
|
290
|
-
}
|
|
291
|
-
@else if ($_enable-strict-theme-config) {
|
|
292
|
-
@error 'Angular Material theme configuration is missing a "density" value';
|
|
293
|
-
}
|
|
294
|
-
@return $default;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/// Gets the typography configuration from the given theme or configuration.
|
|
298
|
-
/// For backwards compatibility, typography is not included by default.
|
|
299
|
-
/// @param {Map} $theme-or-config The theme map returned from `define-light-theme` or
|
|
300
|
-
/// `define-dark-theme`.
|
|
301
|
-
/// @param {Map} $default The default value returned if the given `$theme` does not include a
|
|
302
|
-
/// `typography` configuration.
|
|
303
|
-
/// @returns {Map} Typography configuration for a theme.
|
|
304
|
-
@function get-typography-config($theme-or-config, $default: null) {
|
|
305
|
-
// If a configuration has been passed, return the config directly.
|
|
306
|
-
@if not private-is-theme-object($theme-or-config) {
|
|
307
|
-
@return $theme-or-config;
|
|
308
|
-
}
|
|
309
|
-
// In case a theme has been passed, extract the configuration if present,
|
|
310
|
-
// or fall back to the default typography config.
|
|
311
|
-
@if (map.has-key($theme-or-config, typography)) {
|
|
312
|
-
@return map.get($theme-or-config, typography);
|
|
313
|
-
}
|
|
314
|
-
@else if ($_enable-strict-theme-config) {
|
|
315
|
-
@error 'Angular Material theme configuration is missing a "typography" value';
|
|
316
|
-
}
|
|
317
|
-
@return $default;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
//
|
|
321
|
-
// Private APIs
|
|
322
|
-
//
|
|
323
|
-
|
|
324
|
-
// Checks if configurations that have been declared in the given theme have been generated
|
|
325
|
-
// before. If so, warnings will be reported. This should notify developers in case duplicate
|
|
326
|
-
// styles are accidentally generated due to wrong usage of the all-theme mixins.
|
|
327
|
-
//
|
|
328
|
-
// Additionally, this mixin controls the default value for the density configuration. By
|
|
329
|
-
// default, density styles are generated at scale zero. If the same density styles would be
|
|
330
|
-
// generated a second time though, the default value will change to avoid duplicate styles.
|
|
331
|
-
//
|
|
332
|
-
// The mixin keeps track of all configurations in a list that is scoped to the specified
|
|
333
|
-
// id. This is necessary because a given theme can be passed to multiple disjoint theme mixins
|
|
334
|
-
// (e.g. `all-component-themes` and `all-legacy-component-themes`) without causing any
|
|
335
|
-
// style duplication.
|
|
336
|
-
@mixin private-check-duplicate-theme-styles($theme-or-color-config, $id) {
|
|
337
|
-
$theme: private-legacy-get-theme($theme-or-color-config);
|
|
338
|
-
$color-config: get-color-config($theme);
|
|
339
|
-
$density-config: get-density-config($theme);
|
|
340
|
-
$typography-config: get-typography-config($theme);
|
|
341
|
-
// Lists of previous `color`, `density` and `typography` configurations.
|
|
342
|
-
$previous-color: map.get($_emitted-color, $id) or ();
|
|
343
|
-
$previous-typography: map.get($_emitted-typography, $id) or ();
|
|
344
|
-
$previous-density: map.get($_emitted-density, $id) or ();
|
|
345
|
-
// Whether duplicate legacy density styles would be generated.
|
|
346
|
-
$duplicate-legacy-density: false;
|
|
347
|
-
|
|
348
|
-
// Check if the color configuration has been generated before.
|
|
349
|
-
@if $color-config != null {
|
|
350
|
-
@if list.index($previous-color, $color-config) != null and
|
|
351
|
-
not $theme-ignore-duplication-warnings {
|
|
352
|
-
@warn 'The same color styles are generated multiple times. ' + $_duplicate-warning;
|
|
353
|
-
}
|
|
354
|
-
$previous-color: list.append($previous-color, $color-config);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
// Check if the typography configuration has been generated before.
|
|
358
|
-
@if $typography-config != null {
|
|
359
|
-
@if list.index($previous-typography, $typography-config) != null and
|
|
360
|
-
not $theme-ignore-duplication-warnings {
|
|
361
|
-
@warn 'The same typography styles are generated multiple times. ' + $_duplicate-warning;
|
|
362
|
-
}
|
|
363
|
-
$previous-typography: list.append($previous-typography, $typography-config);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
// Check if the density configuration has been generated before.
|
|
367
|
-
@if $density-config != null {
|
|
368
|
-
@if list.index($previous-density, $density-config) != null {
|
|
369
|
-
// Only report a warning if density styles would be duplicated for non-legacy theme
|
|
370
|
-
// definitions. For legacy themes, we have compatibility logic that avoids duplication
|
|
371
|
-
// of default density styles. We don't want to report a warning in those cases.
|
|
372
|
-
@if private-is-legacy-constructed-theme($theme) {
|
|
373
|
-
$duplicate-legacy-density: true;
|
|
374
|
-
}
|
|
375
|
-
@else if not $theme-ignore-duplication-warnings {
|
|
376
|
-
@warn 'The same density styles are generated multiple times. ' + $_duplicate-warning;
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
$previous-density: list.append($previous-density, $density-config);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
$_emitted-color: map.merge($_emitted-color, ($id: $previous-color)) !global;
|
|
383
|
-
$_emitted-density: map.merge($_emitted-density, ($id: $previous-density)) !global;
|
|
384
|
-
$_emitted-typography: map.merge($_emitted-typography, ($id: $previous-typography)) !global;
|
|
385
|
-
|
|
386
|
-
// Optionally, consumers of this mixin can wrap contents inside so that nested
|
|
387
|
-
// duplicate style checks do not report another warning. e.g. if developers include
|
|
388
|
-
// the `all-component-themes` mixin twice, only the top-level duplicate styles check
|
|
389
|
-
// should report a warning. Not all individual components should report a warning too.
|
|
390
|
-
$orig-mat-theme-ignore-duplication-warnings: $theme-ignore-duplication-warnings;
|
|
391
|
-
$theme-ignore-duplication-warnings: true !global;
|
|
392
|
-
|
|
393
|
-
@content;
|
|
394
|
-
$theme-ignore-duplication-warnings: $orig-mat-theme-ignore-duplication-warnings !global;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
// Checks whether the given value resolves to a theme object. Theme objects are always
|
|
398
|
-
// of type `map` and can optionally only specify `color`, `density` or `typography`.
|
|
399
|
-
@function private-is-theme-object($value) {
|
|
400
|
-
@return meta.type-of($value) == 'map' and (
|
|
401
|
-
map.has-key($value, color) or
|
|
402
|
-
map.has-key($value, density) or
|
|
403
|
-
map.has-key($value, typography) or
|
|
404
|
-
list.length($value) == 0
|
|
405
|
-
);
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
// Checks whether a given value corresponds to a legacy constructed theme.
|
|
409
|
-
@function private-is-legacy-constructed-theme($value) {
|
|
410
|
-
@return meta.type-of($value) == 'map' and map.get($value, '_is-legacy-theme');
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
// Creates a backwards compatible theme. Previously in Angular Material, theme objects
|
|
414
|
-
// contained the color configuration directly. With the recent refactoring of the theming
|
|
415
|
-
// system to allow for density and typography configurations, this is no longer the case.
|
|
416
|
-
// To ensure that constructed themes which will be passed to custom theme mixins do not break,
|
|
417
|
-
// we copy the color configuration and put its properties at the top-level of the theme object.
|
|
418
|
-
// Here is an example of a pattern that should still work until it's officially marked as a
|
|
419
|
-
// breaking change:
|
|
420
|
-
//
|
|
421
|
-
// @mixin my-custom-component-theme($theme) {
|
|
422
|
-
// .my-comp {
|
|
423
|
-
// background-color: mat.get-color-from-palette(map.get($theme, primary));
|
|
424
|
-
// }
|
|
425
|
-
// }
|
|
426
|
-
//
|
|
427
|
-
// Note that the `$theme.primary` key does usually not exist since the color configuration
|
|
428
|
-
// is stored in `$theme.color` which contains a property for `primary`. This method copies
|
|
429
|
-
// the map from `$theme.color` to `$theme` for backwards compatibility.
|
|
430
|
-
@function private-create-backwards-compatibility-theme($theme) {
|
|
431
|
-
@if ($_disable-color-backwards-compatibility or not map.get($theme, color)) {
|
|
432
|
-
@return $theme;
|
|
433
|
-
}
|
|
434
|
-
$color: map.get($theme, color);
|
|
435
|
-
@return map.merge($theme, $color);
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
// Gets the theme from the given value that is either already a theme, or a color configuration.
|
|
439
|
-
// This handles the legacy case where developers pass a color configuration directly to the
|
|
440
|
-
// theme mixin. Before we introduced the new pattern for constructing a theme, developers passed
|
|
441
|
-
// the color configuration directly to the theme mixins. This can be still the case if developers
|
|
442
|
-
// construct a theme manually and pass it to a theme. We support this for backwards compatibility.
|
|
443
|
-
// TODO(devversion): remove this in the future. Constructing themes manually is rare,
|
|
444
|
-
// and the code can be easily updated to the new API.
|
|
445
|
-
@function private-legacy-get-theme($theme-or-color-config) {
|
|
446
|
-
@if private-is-theme-object($theme-or-color-config) {
|
|
447
|
-
@return $theme-or-color-config;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
@warn $_legacy-theme-warning;
|
|
451
|
-
@return private-create-backwards-compatibility-theme((
|
|
452
|
-
_is-legacy-theme: true,
|
|
453
|
-
color: $theme-or-color-config
|
|
454
|
-
));
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// Approximates an rgba color into a solid hex color, given a background color.
|
|
458
|
-
@function private-rgba-to-hex($color, $background-color) {
|
|
459
|
-
// We convert the rgba color into a solid one by taking the opacity from the rgba
|
|
460
|
-
// value and using it to determine the percentage of the background to put
|
|
461
|
-
// into foreground when mixing the colors together.
|
|
462
|
-
@return mix($background-color, rgba($color, 1), (1 - opacity($color)) * 100%);
|
|
463
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
@use 'sass:list';
|
|
2
|
-
@use 'sass:map';
|
|
3
|
-
@use 'sass:math';
|
|
4
|
-
@use 'sass:meta';
|
|
5
|
-
@use 'sass:string';
|
|
6
|
-
|
|
7
|
-
// Utility for fetching a nested value from a typography config.
|
|
8
|
-
@function _mat-get-type-value($config, $level, $name) {
|
|
9
|
-
@return map.get(map.get($config, $level), $name);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/// Gets the font size for a level inside a typography config.
|
|
13
|
-
/// @param {Map} $config A typography config.
|
|
14
|
-
/// @param {Map} $level A typography level.
|
|
15
|
-
@function font-size($config, $level) {
|
|
16
|
-
@return _mat-get-type-value($config, $level, font-size);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/// Gets the line height for a level inside a typography config.
|
|
20
|
-
/// @param {Map} $config A typography config.
|
|
21
|
-
/// @param {Map} $level A typography level.
|
|
22
|
-
@function line-height($config, $level) {
|
|
23
|
-
@return _mat-get-type-value($config, $level, line-height);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/// Gets the font weight for a level inside a typography config.
|
|
27
|
-
/// @param {Map} $config A typography config.
|
|
28
|
-
/// @param {Map} $level A typography level.
|
|
29
|
-
@function font-weight($config, $level) {
|
|
30
|
-
@return _mat-get-type-value($config, $level, font-weight);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/// Gets the letter spacing for a level inside a typography config.
|
|
34
|
-
/// @param {Map} $config A typography config.
|
|
35
|
-
/// @param {Map} $level A typography level.
|
|
36
|
-
@function letter-spacing($config, $level) {
|
|
37
|
-
@return _mat-get-type-value($config, $level, letter-spacing);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/// Gets the font-family from a typography config and removes the quotes around it.
|
|
41
|
-
/// @param {Map} $config A typography config.
|
|
42
|
-
/// @param {Map} $level A typography level.
|
|
43
|
-
@function font-family($config, $level: null) {
|
|
44
|
-
$font-family: map.get($config, font-family);
|
|
45
|
-
|
|
46
|
-
@if $level != null {
|
|
47
|
-
$font-family: _mat-get-type-value($config, $level, font-family);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Guard against unquoting non-string values, because it's deprecated.
|
|
51
|
-
@return if(meta.type-of($font-family) == string, string.unquote($font-family), $font-family);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/// Outputs the shorthand `font` CSS property, based on a set of typography values. Falls back to
|
|
55
|
-
/// the individual properties if a value that isn't allowed in the shorthand is passed in.
|
|
56
|
-
/// @param {String} $font-size The font-size value.
|
|
57
|
-
/// @param {String | Number} $font-weight The font-weight value.
|
|
58
|
-
/// @param {String | Number} $line-height The line-height value.
|
|
59
|
-
/// @param {String} $font-family The font-family value.
|
|
60
|
-
/// @returns {String} The `font` shorthand value combining the given parts.
|
|
61
|
-
@mixin font-shorthand($font-size, $font-weight, $line-height, $font-family) {
|
|
62
|
-
// If any of the values are set to `inherit`, we can't use the shorthand
|
|
63
|
-
// so we fall back to passing in the individual properties.
|
|
64
|
-
@if ($font-size == inherit or
|
|
65
|
-
$font-weight == inherit or
|
|
66
|
-
$line-height == inherit or
|
|
67
|
-
$font-family == inherit or
|
|
68
|
-
$font-size == null or
|
|
69
|
-
$font-weight == null or
|
|
70
|
-
$line-height == null or
|
|
71
|
-
$font-family == null) {
|
|
72
|
-
font-size: $font-size;
|
|
73
|
-
font-weight: $font-weight;
|
|
74
|
-
line-height: $line-height;
|
|
75
|
-
font-family: $font-family;
|
|
76
|
-
}
|
|
77
|
-
@else {
|
|
78
|
-
// Otherwise use the shorthand `font`, because it's the least amount of bytes.
|
|
79
|
-
font: $font-weight list.slash($font-size, $line-height) $font-family;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/// Emits CSS styles for the given typography level.
|
|
84
|
-
/// @param {Map} $config A typography config.
|
|
85
|
-
/// @param {Map} $level A typography level.
|
|
86
|
-
@mixin typography-level($config, $level) {
|
|
87
|
-
$font-size: font-size($config, $level);
|
|
88
|
-
$font-weight: font-weight($config, $level);
|
|
89
|
-
$line-height: line-height($config, $level);
|
|
90
|
-
$font-family: font-family($config, $level);
|
|
91
|
-
|
|
92
|
-
@include font-shorthand($font-size, $font-weight, $line-height, $font-family);
|
|
93
|
-
|
|
94
|
-
letter-spacing: letter-spacing($config, $level);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/// Coerce a value to `em` if it is a unitless number, otherwise returns
|
|
98
|
-
/// the value provided.
|
|
99
|
-
@function private-coerce-unitless-to-em($value) {
|
|
100
|
-
@return if(math.is-unitless($value), 1em * $value, $value);
|
|
101
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
@forward 'datetimepicker-theme' hide $selected-today-box-shadow-width, $calendar-body-font-size,
|
|
2
|
-
$calendar-weekday-table-font-size, $calendar-header-font-size, $clock-font-size,
|
|
3
|
-
color, density, theme, typography;
|
|
4
|
-
@forward 'datetimepicker-theme' as mtx-datetimepicker-*;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
|
-
@use 'sass:math';
|
|
3
|
-
@use '@material/density' as mdc-density;
|
|
4
|
-
@use '@material/textfield' as mdc-textfield;
|
|
5
|
-
@use '../core/theming/theming';
|
|
6
|
-
|
|
7
|
-
@mixin _infix-vertical-spacing-filled($with-label-padding, $no-label-padding) {
|
|
8
|
-
.ng-select {
|
|
9
|
-
padding-top: map.get($with-label-padding, top);
|
|
10
|
-
padding-bottom: map.get($with-label-padding, bottom);
|
|
11
|
-
margin-top: - map.get($with-label-padding, top);
|
|
12
|
-
margin-bottom: - map.get($with-label-padding, bottom);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.mdc-text-field--no-label .ng-select {
|
|
16
|
-
padding-top: map.get($no-label-padding, top);
|
|
17
|
-
padding-bottom: map.get($no-label-padding, bottom);
|
|
18
|
-
margin-top: - map.get($no-label-padding, top);
|
|
19
|
-
margin-bottom: - map.get($no-label-padding, bottom);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@mixin _infix-vertical-spacing-outlined($padding) {
|
|
24
|
-
.mdc-text-field--outlined .ng-select {
|
|
25
|
-
padding-top: map.get($padding, top);
|
|
26
|
-
padding-bottom: map.get($padding, bottom);
|
|
27
|
-
margin-top: - map.get($padding, top);
|
|
28
|
-
margin-bottom: - map.get($padding, bottom);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@mixin private-select-density($config-or-theme) {
|
|
33
|
-
$density-scale: theming.get-density-config($config-or-theme);
|
|
34
|
-
// Height of the form field that is based on the current density scale.
|
|
35
|
-
$height: mdc-density.prop-value(
|
|
36
|
-
$density-config: mdc-textfield.$density-config,
|
|
37
|
-
$density-scale: $density-scale,
|
|
38
|
-
$property-name: height,
|
|
39
|
-
);
|
|
40
|
-
// Whether floating labels for filled form fields should be hidden. MDC hides the label in
|
|
41
|
-
// their density styles when the height decreases too much. We match their density styles.
|
|
42
|
-
$hide-filled-floating-label: $height < mdc-textfield.$minimum-height-for-filled-label;
|
|
43
|
-
// We computed the desired height of the form-field using the density configuration. The
|
|
44
|
-
// spec only describes vertical spacing/alignment in non-dense mode. This means that we
|
|
45
|
-
// cannot update the spacing to explicit numbers based on the density scale. Instead, we
|
|
46
|
-
// determine the height reduction and equally subtract it from the default `top` and `bottom`
|
|
47
|
-
// padding that is provided by the Material Design specification.
|
|
48
|
-
$vertical-deduction: math.div(mdc-textfield.$height - $height, 2);
|
|
49
|
-
// Map that describes the padding for form-fields with label.
|
|
50
|
-
$with-label-padding: (
|
|
51
|
-
top: 24px - $vertical-deduction,
|
|
52
|
-
bottom: 8px - $vertical-deduction,
|
|
53
|
-
);
|
|
54
|
-
// Map that describes the padding for form-fields without label.
|
|
55
|
-
$no-label-padding: (
|
|
56
|
-
top: 16px - $vertical-deduction,
|
|
57
|
-
bottom: 16px - $vertical-deduction,
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
@include _infix-vertical-spacing-outlined($no-label-padding);
|
|
61
|
-
|
|
62
|
-
@if $hide-filled-floating-label {
|
|
63
|
-
@include _infix-vertical-spacing-filled($no-label-padding, $no-label-padding);
|
|
64
|
-
}
|
|
65
|
-
@else {
|
|
66
|
-
@include _infix-vertical-spacing-filled($with-label-padding, $no-label-padding);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@forward 'tooltip-theme' as mtx-mdc-tooltip-*;
|