|
2 | 2 | @use '../../base' as *; |
3 | 3 | @use '../../themes/schemas' as *; |
4 | 4 |
|
5 | | -//// |
6 | | -/// @group themes |
7 | | -/// @access public |
8 | | -/// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a> |
9 | | -/// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a> |
10 | | -//// |
11 | | - |
12 | | -/// If only background color is specified, text/icon color will be assigned automatically to a contrasting color. |
13 | | -/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component. |
14 | | -/// |
15 | | -/// @param {Color} $icon-color [null] - The color used for the actions icons. |
16 | | -/// @param {Color} $background [null] - The color used for the action strip component content background. |
17 | | -/// @param {Color} $actions-background [null] - The color used for the actions background. |
18 | | -/// @param {Color} $delete-action [null] - The color used for the delete icon in action strip component. |
19 | | -/// @param {List} $actions-border-radius [null] - The border radius used for actions container inside action strip component. |
20 | | -/// |
21 | | -/// @example scss Change the background and icon colors in action strip |
22 | | -/// $my-action-strip-theme: action-strip-theme($background: black); |
23 | | -/// // Pass the theme to the css-vars() mixin |
24 | | -/// @include css-vars($my-action-strip-theme); |
25 | | -@function action-strip-theme( |
26 | | - $schema: $light-material-schema, |
27 | | -
|
28 | | - $background: null, |
29 | | - $actions-background: null, |
30 | | - $icon-color: null, |
31 | | - $delete-action: null, |
32 | | - $actions-border-radius: null, |
33 | | -) { |
34 | | - $name: 'igx-action-strip'; |
35 | | - $action-strip-schema: (); |
36 | | - |
37 | | - @if map.has-key($schema, 'action-strip') { |
38 | | - $action-strip-schema: map.get($schema, 'action-strip'); |
39 | | - } @else { |
40 | | - $action-strip-schema: $schema; |
41 | | - } |
42 | | - |
43 | | - $theme: digest-schema($action-strip-schema); |
44 | | - |
45 | | - @if not($icon-color) and $actions-background { |
46 | | - $icon-color: adaptive-contrast(var(--actions-background)); |
47 | | - } |
48 | | - |
49 | | - @if not($actions-border-radius) { |
50 | | - $actions-border-radius: map.get($theme, 'actions-border-radius'); |
51 | | - } |
52 | | - |
53 | | - @return extend($theme, ( |
54 | | - name: $name, |
55 | | - background: $background, |
56 | | - actions-background: $actions-background, |
57 | | - icon-color: $icon-color, |
58 | | - delete-action: $delete-action, |
59 | | - actions-border-radius: $actions-border-radius, |
60 | | - )); |
61 | | -} |
62 | | - |
63 | 5 | /// @deprecated Use the `css-vars` mixin instead. |
64 | 6 | /// @see {mixin} css-vars |
65 | 7 | /// @param {Map} $theme - The theme used to style the component. |
|
0 commit comments