igniteui-theming 19.1.1 → 19.2.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.
Files changed (64) hide show
  1. package/package.json +2 -2
  2. package/sass/themes/_index.scss +1 -0
  3. package/sass/themes/components/_index.scss +49 -0
  4. package/sass/themes/components/avatar/_avatar-theme.scss +66 -0
  5. package/sass/themes/components/badge/_badge-theme.scss +80 -0
  6. package/sass/themes/components/banner/_banner-theme.scss +70 -0
  7. package/sass/themes/components/bottom-nav/_bottom-nav-theme.scss +107 -0
  8. package/sass/themes/components/button/_button-theme.scss +240 -0
  9. package/sass/themes/components/button/_contained-button-theme.scss +300 -0
  10. package/sass/themes/components/button/_fab-button-theme.scss +276 -0
  11. package/sass/themes/components/button/_flat-button-theme.scss +335 -0
  12. package/sass/themes/components/button/_outlined-button-theme.scss +401 -0
  13. package/sass/themes/components/button-group/_button-group-theme.scss +299 -0
  14. package/sass/themes/components/calendar/_calendar-theme.scss +1101 -0
  15. package/sass/themes/components/card/_card-theme.scss +99 -0
  16. package/sass/themes/components/carousel/_carousel-theme.scss +225 -0
  17. package/sass/themes/components/checkbox/_checkbox-theme.scss +158 -0
  18. package/sass/themes/components/chip/_chip-theme.scss +256 -0
  19. package/sass/themes/components/column-actions/_column-actions-theme.scss +54 -0
  20. package/sass/themes/components/combo/_combo-theme.scss +131 -0
  21. package/sass/themes/components/date-range-picker/_date-range-picker-theme.scss +33 -0
  22. package/sass/themes/components/dialog/_dialog-theme.scss +81 -0
  23. package/sass/themes/components/divider/_divider-theme.scss +42 -0
  24. package/sass/themes/components/dock-manager/_dock-manager-theme.scss +77 -0
  25. package/sass/themes/components/drop-down/_drop-down-theme.scss +218 -0
  26. package/sass/themes/components/expansion-panel/_expansion-panel-theme.scss +103 -0
  27. package/sass/themes/components/grid/_grid-summary-theme.scss +91 -0
  28. package/sass/themes/components/grid/_grid-theme.scss +587 -0
  29. package/sass/themes/components/grid/_grid-toolbar-theme.scss +100 -0
  30. package/sass/themes/components/grid/_index.scss +3 -0
  31. package/sass/themes/components/highlight/_highlight-theme.scss +63 -0
  32. package/sass/themes/components/icon/_icon-theme.scss +51 -0
  33. package/sass/themes/components/icon-button/_contained-icon-button-theme.scss +201 -0
  34. package/sass/themes/components/icon-button/_flat-icon-button-theme.scss +193 -0
  35. package/sass/themes/components/icon-button/_icon-button-theme.scss +118 -0
  36. package/sass/themes/components/icon-button/_outlined-icon-button-theme.scss +237 -0
  37. package/sass/themes/components/input/_input-theme.scss +533 -0
  38. package/sass/themes/components/label/_label-theme.scss +39 -0
  39. package/sass/themes/components/list/_list-theme.scss +270 -0
  40. package/sass/themes/components/navbar/_navbar-theme.scss +97 -0
  41. package/sass/themes/components/navdrawer/_navdrawer-theme.scss +149 -0
  42. package/sass/themes/components/overlay/_overlay-theme.scss +43 -0
  43. package/sass/themes/components/paginator/_paginator-theme.scss +58 -0
  44. package/sass/themes/components/progress/_circular-theme.scss +79 -0
  45. package/sass/themes/components/progress/_linear-theme.scss +74 -0
  46. package/sass/themes/components/query-builder/_query-builder-theme.scss +109 -0
  47. package/sass/themes/components/radio/_radio-theme.scss +144 -0
  48. package/sass/themes/components/rating/_rating-theme.scss +50 -0
  49. package/sass/themes/components/ripple/_ripple-theme.scss +42 -0
  50. package/sass/themes/components/scrollbar/_scrollbar-theme.scss +89 -0
  51. package/sass/themes/components/select/_select-theme.scss +100 -0
  52. package/sass/themes/components/slider/_slider-theme.scss +198 -0
  53. package/sass/themes/components/snackbar/_snackbar-theme.scss +72 -0
  54. package/sass/themes/components/splitter/_splitter-theme.scss +78 -0
  55. package/sass/themes/components/stepper/_stepper-theme.scss +499 -0
  56. package/sass/themes/components/switch/_switch-theme.scss +273 -0
  57. package/sass/themes/components/tabs/_tabs-theme.scss +268 -0
  58. package/sass/themes/components/time-picker/_time-picker-theme.scss +163 -0
  59. package/sass/themes/components/toast/_toast-theme.scss +77 -0
  60. package/sass/themes/components/tooltip/_tooltip-theme.scss +70 -0
  61. package/sass/themes/components/tree/_tree-theme.scss +135 -0
  62. package/sass/themes/components/watermark/_watermark-theme.scss +68 -0
  63. package/sass/themes/schemas/components/dark/_dialog.scss +2 -2
  64. package/sass/themes/schemas/components/light/calendar/_days-view.scss +65 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-theming",
3
- "version": "19.1.1",
3
+ "version": "19.2.0",
4
4
  "description": "A set of Sass variables, mixins, and functions for generating palettes, typography, and elevations used by Ignite UI components.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -93,7 +93,7 @@
93
93
  "postcss-safe-parser": "^7.0.0",
94
94
  "prettier": "^3.2.5",
95
95
  "sass-true": "^7.0.0",
96
- "sassdoc-plugin-localization": "^1.4.3",
96
+ "sassdoc-plugin-localization": "^2.0.0",
97
97
  "shx": "^0.3.4",
98
98
  "stylelint": "^15.6.2",
99
99
  "stylelint-config-standard-scss": "^7.0.1",
@@ -1,3 +1,4 @@
1
1
  @forward 'functions';
2
2
  @forward 'mixins';
3
3
  @forward 'charts';
4
+ @forward 'components';
@@ -0,0 +1,49 @@
1
+ @forward 'avatar/avatar-theme';
2
+ @forward 'badge/badge-theme';
3
+ @forward 'banner/banner-theme';
4
+ @forward 'bottom-nav/bottom-nav-theme';
5
+ @forward 'button/button-theme';
6
+ @forward 'button-group/button-group-theme';
7
+ @forward 'calendar/calendar-theme';
8
+ @forward 'card/card-theme';
9
+ @forward 'carousel/carousel-theme';
10
+ @forward 'checkbox/checkbox-theme';
11
+ @forward 'chip/chip-theme';
12
+ @forward 'column-actions/column-actions-theme';
13
+ @forward 'combo/combo-theme';
14
+ @forward 'date-range-picker/date-range-picker-theme';
15
+ @forward 'dialog/dialog-theme';
16
+ @forward 'divider/divider-theme';
17
+ @forward 'dock-manager/dock-manager-theme';
18
+ @forward 'drop-down/drop-down-theme';
19
+ @forward 'expansion-panel/expansion-panel-theme';
20
+ @forward 'grid';
21
+ @forward 'highlight/highlight-theme';
22
+ @forward 'icon/icon-theme';
23
+ @forward 'icon-button/icon-button-theme';
24
+ @forward 'input/input-theme';
25
+ @forward 'label/label-theme';
26
+ @forward 'list/list-theme';
27
+ @forward 'navbar/navbar-theme';
28
+ @forward 'navdrawer/navdrawer-theme';
29
+ @forward 'overlay/overlay-theme';
30
+ @forward 'paginator/paginator-theme';
31
+ @forward 'progress/circular-theme';
32
+ @forward 'progress/linear-theme';
33
+ @forward 'query-builder/query-builder-theme';
34
+ @forward 'radio/radio-theme';
35
+ @forward 'rating/rating-theme';
36
+ @forward 'ripple/ripple-theme';
37
+ @forward 'scrollbar/scrollbar-theme';
38
+ @forward 'select/select-theme';
39
+ @forward 'slider/slider-theme';
40
+ @forward 'snackbar/snackbar-theme';
41
+ @forward 'splitter/splitter-theme';
42
+ @forward 'stepper/stepper-theme';
43
+ @forward 'switch/switch-theme';
44
+ @forward 'tabs/tabs-theme';
45
+ @forward 'time-picker/time-picker-theme';
46
+ @forward 'toast/toast-theme';
47
+ @forward 'tooltip/tooltip-theme';
48
+ @forward 'tree/tree-theme';
49
+ @forward 'watermark/watermark-theme';
@@ -0,0 +1,66 @@
1
+ @use 'sass:map';
2
+ @use '../../functions' as *;
3
+ @use '../../schemas/' as *;
4
+ @use '../../../utils/map' as *;
5
+ @use '../../../color/functions' as *;
6
+ @use '../../../elevations/' as *;
7
+
8
+ ////
9
+ /// @group themes
10
+ /// @access public
11
+ /// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a>
12
+ /// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
13
+ ////
14
+
15
+ /// If only background color is specified, text/icon color will be assigned automatically to a contrasting color.
16
+ /// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
17
+ /// @param {Color} $color [null] - The text color used of the avatar.
18
+ /// @param {Color} $icon-color [null] - The icon color used of the avatar.
19
+ /// @param {Color} $background [null] - The background color used of the avatar.
20
+ /// @param {Number} $border-radius [null] - The border-radius used of the avatar.
21
+ /// @param {Number} $size [null] - The size of the avatar.
22
+ /// @requires $light-material-schema
23
+ ///
24
+ /// @example scss Change the background and icon colors in icon avatars
25
+ /// $my-avatar-theme: avatar-theme($icon-background: black, $icon-color: white);
26
+ /// // Pass the theme to the css-vars() mixin
27
+ /// @include css-vars($my-avatar-theme);
28
+ @function avatar-theme(
29
+ $schema: $light-material-schema,
30
+ $background: null,
31
+ $color: null,
32
+ $icon-color: null,
33
+ $border-radius: null,
34
+ $size: null
35
+ ) {
36
+ $name: 'igx-avatar';
37
+ $avatar-schema: ();
38
+
39
+ @if map.has-key($schema, 'avatar') {
40
+ $avatar-schema: map.get($schema, 'avatar');
41
+ } @else {
42
+ $avatar-schema: $schema;
43
+ }
44
+
45
+ $theme: digest-schema($avatar-schema);
46
+
47
+ @if not($color) and $background {
48
+ $color: adaptive-contrast(var(--background));
49
+ }
50
+
51
+ @if not($icon-color) and $background {
52
+ $icon-color: adaptive-contrast(var(--background));
53
+ }
54
+
55
+ @return extend(
56
+ $theme,
57
+ (
58
+ name: $name,
59
+ background: $background,
60
+ color: $color,
61
+ icon-color: $icon-color,
62
+ border-radius: $border-radius,
63
+ size: $size,
64
+ )
65
+ );
66
+ }
@@ -0,0 +1,80 @@
1
+ @use 'sass:map';
2
+ @use '../../functions' as *;
3
+ @use '../../schemas/' as *;
4
+ @use '../../../utils/map' as *;
5
+ @use '../../../color/functions' as *;
6
+ @use '../../../elevations/' as *;
7
+
8
+ ////
9
+ /// @group themes
10
+ /// @access public
11
+ /// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a>
12
+ /// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
13
+ ////
14
+
15
+ /// If only background color is specified, text/icon color
16
+ /// will be assigned automatically to a contrasting color.
17
+ ///
18
+ /// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
19
+ /// @param {Color} $icon-color [null] - The icon color used.
20
+ /// @param {Color} $text-color [null] - The text color used.
21
+ /// @param {Color} $border-color [null] - The border color used.
22
+ /// @param {Color} $background-color [null] - The background color used.
23
+ /// @param {box-shadow} $shadow [null] - Sets a shadow to be used for the badge.
24
+ /// @param {Number} $border-radius [null] - The border radius used for badge component.
25
+ ///
26
+ /// @requires $light-material-schema
27
+ ///
28
+ /// @example scss Change the text and icon colors in a badge
29
+ /// $my-badge-theme: badge-theme($icon-color: black, $background-color: white);
30
+ /// // Pass the theme to the css-vars() mixin
31
+ /// @include css-vars($my-badge-theme);
32
+ @function badge-theme(
33
+ $schema: $light-material-schema,
34
+
35
+ $icon-color: null,
36
+ $text-color: null,
37
+
38
+ $border-color: null,
39
+ $border-radius: null,
40
+
41
+ $background-color: null,
42
+ $shadow: null
43
+ ) {
44
+ $name: 'igx-badge';
45
+ $badge-schema: ();
46
+
47
+ @if map.has-key($schema, 'badge') {
48
+ $badge-schema: map.get($schema, 'badge');
49
+ } @else {
50
+ $badge-schema: $schema;
51
+ }
52
+
53
+ $theme: digest-schema($badge-schema);
54
+
55
+ @if not($icon-color) and $background-color {
56
+ $icon-color: adaptive-contrast(var(--background-color));
57
+ }
58
+
59
+ @if not($text-color) and $background-color {
60
+ $text-color: adaptive-contrast(var(--background-color));
61
+ }
62
+
63
+ @if not($shadow) {
64
+ $elevation: map.get($badge-schema, 'elevation');
65
+ $shadow: elevation($elevation);
66
+ }
67
+
68
+ @return extend(
69
+ $theme,
70
+ (
71
+ name: $name,
72
+ icon-color: $icon-color,
73
+ text-color: $text-color,
74
+ border-color: $border-color,
75
+ border-radius: $border-radius,
76
+ background-color: $background-color,
77
+ shadow: $shadow,
78
+ )
79
+ );
80
+ }
@@ -0,0 +1,70 @@
1
+ @use 'sass:map';
2
+ @use '../../functions' as *;
3
+ @use '../../schemas/' as *;
4
+ @use '../../../utils/map' as *;
5
+ @use '../../../color/functions' as *;
6
+ @use '../../../elevations/' as *;
7
+
8
+ ////
9
+ /// @group themes
10
+ /// @access public
11
+ /// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
12
+ ////
13
+
14
+ /// If only background color is specified, text/icon color
15
+ /// will be assigned automatically to a contrasting color.
16
+ /// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
17
+ ///
18
+ /// @param {Color} $banner-background [null] - The color used for the banner background.
19
+ /// @param {Color} $banner-message-color [null] - The color used for the banner label.
20
+ /// @param {Color} $banner-border-color [null] - The color used for the banner border.
21
+ /// @param {Color} $banner-illustration-color [null] - The color used for the banner illustration.
22
+ /// @param {Number} $border-radius [null] - The border-radius for the banner.
23
+ ///
24
+ /// @requires $light-material-schema
25
+ ///
26
+ /// @example scss Change the background in banner
27
+ /// $my-banner-theme: banner-theme($banner-background: #000);
28
+ /// // Pass the theme to the css-vars() mixin
29
+ /// @include css-vars($my-banner-theme);
30
+ @function banner-theme(
31
+ $schema: $light-material-schema,
32
+ $banner-background: null,
33
+ $banner-message-color: null,
34
+ $banner-border-color: null,
35
+ $banner-illustration-color: null,
36
+ $border-radius: null
37
+ ) {
38
+ $name: 'igx-banner';
39
+ $selector: 'igx-banner, .igx-banner';
40
+ $banner-schema: ();
41
+
42
+ @if map.has-key($schema, 'banner') {
43
+ $banner-schema: map.get($schema, 'banner');
44
+ } @else {
45
+ $banner-schema: $schema;
46
+ }
47
+
48
+ $theme: digest-schema($banner-schema);
49
+
50
+ @if not($banner-message-color) and $banner-background {
51
+ $banner-message-color: adaptive-contrast(var(--banner-background));
52
+ }
53
+
54
+ @if not($banner-illustration-color) and $banner-background {
55
+ $banner-illustration-color: adaptive-contrast(var(--banner-background));
56
+ }
57
+
58
+ @return extend(
59
+ $theme,
60
+ (
61
+ name: $name,
62
+ selector: $selector,
63
+ banner-background: $banner-background,
64
+ banner-message-color: $banner-message-color,
65
+ banner-border-color: $banner-border-color,
66
+ banner-illustration-color: $banner-illustration-color,
67
+ border-radius: $border-radius,
68
+ )
69
+ );
70
+ }
@@ -0,0 +1,107 @@
1
+ @use 'sass:map';
2
+ @use '../../functions' as *;
3
+ @use '../../schemas/' as *;
4
+ @use '../../../utils/map' as *;
5
+ @use '../../../color/functions' as *;
6
+ @use '../../../elevations/' as *;
7
+
8
+ ////
9
+ /// @group themes
10
+ /// @access public
11
+ /// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a>
12
+ /// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
13
+ ////
14
+
15
+ /// If only background color is specified,
16
+ /// the label and icon colors will be assigned automatically to a contrasting color.
17
+ /// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
18
+ /// @param {Color} $background [null] - The background color used for the toast.
19
+ /// @param {Color} $label-color [null] - The label color used in idle state.
20
+ /// @param {Color} $icon-color [null] - The icon color used in idle state.
21
+ /// @param {Color} $label-selected-color [null] - The label color used in selected state.
22
+ /// @param {Color} $icon-selected-color [null] - The icon color used in selected state.
23
+ /// @param {Color} $icon-disabled-color [null] - The disabled color of the icon.
24
+ /// @param {Color} $label-disabled-color [null] - The disabled color of the label.
25
+ /// @param {Color} $border-color [null] - The border color of the bottom navigation.
26
+ /// @param {box-shadow} $shadow [null] - Sets a shadow to be used for the bar.
27
+ /// @requires $light-material-schema
28
+ /// @example scss Set a custom background color
29
+ /// $my-bottom-nav-theme: bottom-nav-theme($background: black);
30
+ /// // Pass the theme to the css-vars() mixin
31
+ /// @include css-vars($my-bottom-nav-theme);
32
+ @function bottom-nav-theme(
33
+ $schema: $light-material-schema,
34
+ $background: null,
35
+ $icon-color: null,
36
+ $icon-selected-color: null,
37
+ $label-color: null,
38
+ $label-selected-color: null,
39
+ $icon-disabled-color: null,
40
+ $label-disabled-color: null,
41
+ $border-color: null,
42
+ $shadow: null
43
+ ) {
44
+ $name: 'igx-bottom-nav';
45
+ $bottom-nav-schema: ();
46
+
47
+ @if map.has-key($schema, 'bottom-nav') {
48
+ $bottom-nav-schema: map.get($schema, 'bottom-nav');
49
+ } @else {
50
+ $bottom-nav-schema: $schema;
51
+ }
52
+
53
+ $theme: digest-schema($bottom-nav-schema);
54
+
55
+ @if not($label-color) and not($icon-color) and $background {
56
+ $label-color: adaptive-contrast(var(--background));
57
+ }
58
+
59
+ @if not($icon-color) and $label-color {
60
+ $icon-color: $label-color;
61
+ }
62
+
63
+ @if not($label-color) and $icon-color {
64
+ $label-color: $icon-color;
65
+ }
66
+
67
+ @if not($icon-disabled-color) and not($label-disabled-color) and $label-color {
68
+ $label-disabled-color: adaptive-contrast(var(--background));
69
+ }
70
+
71
+ @if not($icon-disabled-color) and $label-disabled-color {
72
+ $icon-disabled-color: $label-disabled-color;
73
+ }
74
+
75
+ @if not($label-disabled-color) and $icon-disabled-color {
76
+ $label-disabled-color: $icon-disabled-color;
77
+ }
78
+
79
+ @if not($icon-selected-color) and $label-selected-color {
80
+ $icon-selected-color: $label-selected-color;
81
+ }
82
+
83
+ @if not($label-selected-color) and $icon-selected-color {
84
+ $label-selected-color: $icon-selected-color;
85
+ }
86
+
87
+ @if not($shadow) {
88
+ $elevation: map.get($bottom-nav-schema, 'elevation');
89
+ $shadow: elevation($elevation);
90
+ }
91
+
92
+ @return extend(
93
+ $theme,
94
+ (
95
+ name: $name,
96
+ background: $background,
97
+ icon-color: $icon-color,
98
+ icon-selected-color: $icon-selected-color,
99
+ label-color: $label-color,
100
+ label-selected-color: $label-selected-color,
101
+ icon-disabled-color: $icon-disabled-color,
102
+ label-disabled-color: $label-disabled-color,
103
+ border-color: $border-color,
104
+ shadow: $shadow,
105
+ )
106
+ );
107
+ }
@@ -0,0 +1,240 @@
1
+ @use 'sass:map';
2
+ @use '../../functions' as *;
3
+ @use '../../schemas/' as *;
4
+ @use '../../../utils/map' as *;
5
+ @use '../../../color/functions' as *;
6
+ @use '../../../elevations/' as *;
7
+ @forward './flat-button-theme';
8
+ @forward './contained-button-theme';
9
+ @forward './outlined-button-theme';
10
+ @forward './fab-button-theme';
11
+
12
+ ////
13
+ /// @group themes
14
+ /// @access public
15
+ /// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
16
+ /// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a>
17
+ ////
18
+
19
+ /// If only background color is specified, text/icon color
20
+ /// will be assigned automatically to a contrasting color.
21
+ /// Does ___not___ apply for disabled state colors.
22
+ /// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
23
+ /// @param {Color} $background [null] - The background color of the button.
24
+ /// @param {Color} $foreground [null] - The text color of the button.
25
+ /// @param {Color} $icon-color [null] - The icon color in the button.
26
+ /// @param {Color} $icon-color-hover [null] - The icon color in the button on hover.
27
+ /// @param {Color} $hover-background [null] - The hover background color of the button.
28
+ /// @param {Color} $hover-foreground [null] - The hover text color of the button.
29
+ /// @param {Color} $focus-background [null] - The focus background color of the button.
30
+ /// @param {Color} $focus-foreground [null] - The focus text color of the button.
31
+ /// @param {Color} $focus-hover-background [null] - The background color on focus hovered state of the button.
32
+ /// @param {Color} $focus-hover-foreground [null] - The text color on focus hovered state of the button.
33
+ /// @param {Color} $focus-visible-background [null] - The focus-visible background color of the button.
34
+ /// @param {Color} $focus-visible-foreground [null] - The focus-visible text color of the button.
35
+ /// @param {Color} $active-background [null] - The active background of the button.
36
+ /// @param {Color} $active-foreground [null] - The active text color of the button.
37
+ /// @param {List} $border-radius [null] - The border radius of the button.
38
+ /// @param {Color} $border-color [null] - The border color of the button.
39
+ /// @param {Color} $hover-border-color [null] - The hover border color of the button.
40
+ /// @param {Color} $focus-border-color [null] - The focus border color of the button.
41
+ /// @param {Color} $focus-visible-border-color [null] - The focus-visible border color of the button.
42
+ /// @param {Color} $active-border-color [null] - The active border color of the button.
43
+ /// @param {Color} $shadow-color [null] - The shadow color of the button.
44
+ /// @param {Color} $resting-shadow [null] - The shadow of the button in its idle state.
45
+ /// @param {Color} $hover-shadow [null] - The shadow of the button in its hover state.
46
+ /// @param {Color} $focus-shadow [null] - The shadow of the button in its focus state.
47
+ /// @param {Color} $active-shadow [null] - The shadow of the button in its active state.
48
+ /// @param {Color} $disabled-background [null] - The disabled background color of the button.
49
+ /// @param {Color} $disabled-foreground [null] - The disabled text color of the button.
50
+ /// @param {Color} $disabled-icon-color [null] - The disabled icon color of the button.
51
+ /// @param {Color} $disabled-border-color [null] - The disabled border color of the button.
52
+ ///
53
+ /// @requires $light-material-schema
54
+ ///
55
+ /// @example scss Change the background and text colors in contained buttons
56
+ /// $my-button-theme: button-theme(
57
+ /// $foreground: white,
58
+ /// $background: black
59
+ /// );
60
+ /// // Pass the theme to the css-vars() mixin
61
+ /// @include css-vars($my-button-theme);
62
+ @function button-theme(
63
+ $schema: $light-material-schema,
64
+
65
+ $background: null,
66
+ $foreground: null,
67
+
68
+ $hover-background: null,
69
+ $hover-foreground: null,
70
+
71
+ $icon-color: $foreground,
72
+ $icon-color-hover: $hover-foreground,
73
+
74
+ $focus-background: null,
75
+ $focus-foreground: null,
76
+
77
+ $focus-hover-background: null,
78
+ $focus-hover-foreground: null,
79
+
80
+ $focus-visible-background: null,
81
+ $focus-visible-foreground: null,
82
+
83
+ $active-background: null,
84
+ $active-foreground: null,
85
+
86
+ $border-radius: null,
87
+ $border-color: null,
88
+ $hover-border-color: null,
89
+ $focus-border-color: null,
90
+ $focus-visible-border-color: null,
91
+ $active-border-color: null,
92
+
93
+ $shadow-color: null,
94
+
95
+ $resting-shadow: null,
96
+ $hover-shadow: null,
97
+ $focus-shadow: null,
98
+ $active-shadow: null,
99
+
100
+ $disabled-background: null,
101
+ $disabled-foreground: null,
102
+ $disabled-icon-color: $disabled-foreground,
103
+ $disabled-border-color: null,
104
+ $size: null
105
+ ) {
106
+ $name: 'igx-button';
107
+ $button-schema: ();
108
+
109
+ @if map.has-key($schema, 'button') {
110
+ $button-schema: map.get($schema, 'button');
111
+ } @else {
112
+ $button-schema: $schema;
113
+ }
114
+
115
+ $themes: ();
116
+ $variant: null;
117
+
118
+ @each $_name, $_schema in $button-schema {
119
+ $_resting-shadow: $resting-shadow;
120
+ $_hover-shadow: $hover-shadow;
121
+ $_focus-shadow: $focus-shadow;
122
+ $_active-shadow: $active-shadow;
123
+ $_border-radius: $border-radius;
124
+
125
+ @if not($variant) {
126
+ $variant: map.get($schema, '_meta', 'theme');
127
+ }
128
+
129
+ @if not($foreground) and $background {
130
+ $foreground: adaptive-contrast(var(--background));
131
+ }
132
+
133
+ @if not($icon-color) and $background {
134
+ $icon-color: adaptive-contrast(var(--background));
135
+ }
136
+
137
+ @if not($hover-foreground) and $hover-background {
138
+ $hover-foreground: adaptive-contrast(var(--hover-background));
139
+ }
140
+
141
+ @if not($icon-color-hover) and $hover-foreground {
142
+ $icon-color-hover: var(--hover-foreground);
143
+ }
144
+
145
+ @if not($focus-foreground) and $focus-background {
146
+ $focus-foreground: adaptive-contrast(var(--focus-background));
147
+ }
148
+
149
+ @if not($focus-hover-foreground) and $focus-hover-background {
150
+ $focus-hover-foreground: adaptive-contrast(var(--focus-hover-background));
151
+ }
152
+
153
+ @if not($focus-visible-background) and $focus-background {
154
+ $focus-visible-background: var(--focus-background);
155
+ }
156
+
157
+ @if not($focus-visible-foreground) and $focus-visible-background {
158
+ $focus-visible-foreground: adaptive-contrast(var(--focus-visible-background));
159
+ }
160
+
161
+ @if not($focus-visible-border-color) and $focus-border-color {
162
+ $focus-visible-border-color: var(--focus-border-color);
163
+ }
164
+
165
+ @if not($_resting-shadow) {
166
+ $resting-elevation: map.get($_schema, 'resting-elevation');
167
+ $_resting-shadow: elevation($resting-elevation);
168
+ }
169
+
170
+ @if not($_hover-shadow) {
171
+ $hover-elevation: map.get($_schema, 'hover-elevation');
172
+ $_hover-shadow: elevation($hover-elevation);
173
+ }
174
+
175
+ @if not($_focus-shadow) {
176
+ $focus-elevation: map.get($_schema, 'focus-elevation');
177
+ $_focus-shadow: elevation($focus-elevation);
178
+ }
179
+
180
+ @if not($_active-shadow) {
181
+ $active-elevation: map.get($_schema, 'active-elevation');
182
+ $_active-shadow: elevation($active-elevation);
183
+ }
184
+
185
+ $themes: map.merge(
186
+ $themes,
187
+ (
188
+ $_name:
189
+ extend(
190
+ digest-schema($_schema),
191
+ (
192
+ name: $name,
193
+ background: $background,
194
+ foreground: $foreground,
195
+
196
+ icon-color: $icon-color,
197
+ icon-color-hover: $icon-color-hover,
198
+
199
+ hover-background: $hover-background,
200
+ hover-foreground: $hover-foreground,
201
+
202
+ focus-background: $focus-background,
203
+ focus-foreground: $focus-foreground,
204
+
205
+ focus-hover-background: $focus-hover-background,
206
+ focus-hover-foreground: $focus-hover-foreground,
207
+
208
+ focus-visible-background: $focus-visible-background,
209
+ focus-visible-foreground: $focus-visible-foreground,
210
+
211
+ active-background: $active-background,
212
+ active-foreground: $active-foreground,
213
+
214
+ border-radius: $_border-radius,
215
+ border-color: $border-color,
216
+ hover-border-color: $hover-border-color,
217
+ focus-border-color: $focus-border-color,
218
+ focus-visible-border-color: $focus-visible-border-color,
219
+ active-border-color: $active-border-color,
220
+
221
+ shadow-color: $shadow-color,
222
+
223
+ resting-shadow: $_resting-shadow,
224
+ hover-shadow: $_hover-shadow,
225
+ focus-shadow: $_focus-shadow,
226
+ active-shadow: $_active-shadow,
227
+
228
+ disabled-background: $disabled-background,
229
+ disabled-foreground: $disabled-foreground,
230
+ disabled-icon-color: $disabled-icon-color,
231
+ disabled-border-color: $disabled-border-color,
232
+ size: $size,
233
+ )
234
+ ),
235
+ )
236
+ );
237
+ }
238
+
239
+ @return (name: $name, variant: $variant, themes: $themes);
240
+ }