|
29 | 29 | /// @param {List} $border-radius [null] - The border radius used for checkbox component.
|
30 | 30 | /// @param {List} $border-radius-ripple [null] - The border radius used for checkbox ripple.
|
31 | 31 | /// @param {Color} $focus-outline-color [null] - The focus outlined color.
|
| 32 | +/// @param {Color} $focus-outline-color-focused [null] - The focus outlined color for focused state. |
| 33 | +/// @param {Color} $focus-border-color [null] - The focus border color. |
32 | 34 | /// @param {Color} $error-color [null] - The border and fill colors in invalid state.
|
33 | 35 | /// @param {Color} $error-color-hover [null] - The border and fill colors in invalid state on hover.
|
| 36 | +/// @param {Color} $focus-outline-color-error [null] - The focus outline error color. |
34 | 37 | /// Set to light when the surrounding area is dark.
|
35 | 38 | ///
|
36 | 39 | /// @requires $light-material-schema
|
|
58 | 61 | $disabled-color-label: null,
|
59 | 62 | $border-radius-ripple: null,
|
60 | 63 | $focus-outline-color: null,
|
| 64 | + $focus-outline-color-focused: null, |
| 65 | + $focus-border-color: null, |
61 | 66 | $error-color: null,
|
62 | 67 | $error-color-hover: null,
|
| 68 | + $focus-outline-color-error: null, |
63 | 69 | ) {
|
64 | 70 | $name: 'igx-checkbox';
|
65 | 71 | $checkbox-schema: ();
|
|
71 | 77 | }
|
72 | 78 |
|
73 | 79 | $theme: digest-schema($checkbox-schema);
|
74 |
| - $meta: map.get($theme, '_meta'); |
| 80 | + $variant: map.get($theme, '_meta', 'theme'); |
| 81 | + |
| 82 | + @if not($empty-color-hover) and $empty-color { |
| 83 | + $empty-color-hover: hsl(from var(--empty-color) h s calc(l * 0.9)); |
| 84 | + } |
| 85 | + |
| 86 | + @if not($fill-color-hover) and $fill-color { |
| 87 | + $fill-color-hover: hsl(from var(--fill-color) h s calc(l * 0.9)); |
| 88 | + } |
| 89 | + |
| 90 | + @if not($tick-color) and $fill-color { |
| 91 | + $tick-color: adaptive-contrast(var(--fill-color)); |
| 92 | + } |
| 93 | + |
| 94 | + @if not($label-color-hover) and $label-color { |
| 95 | + $label-color-hover: hsl(from var(--label-color) h s calc(l * 0.9)); |
| 96 | + } |
| 97 | + |
| 98 | + @if not($focus-border-color) and $fill-color { |
| 99 | + $focus-border-color: var(--fill-color); |
| 100 | + } |
| 101 | + |
| 102 | + @if not($disabled-indeterminate-color) and $fill-color { |
| 103 | + $disabled-indeterminate-color: hsla(from var(--fill-color) h s l / 0.5); |
| 104 | + } |
| 105 | + |
| 106 | + @if not($error-color-hover) and $error-color { |
| 107 | + $error-color-hover: hsl(from var(--error-color) h s calc(l * 0.9)); |
| 108 | + } |
| 109 | + |
| 110 | + @if not($focus-outline-color-error) and $error-color { |
| 111 | + $focus-outline-color-error: hsla(from var(--error-color) h s l / .5); |
| 112 | + } |
| 113 | + |
| 114 | + @if $variant == 'bootstrap' { |
| 115 | + @if not($focus-outline-color) and $fill-color { |
| 116 | + $focus-outline-color: hsla(from var(--fill-color) h s l / .5); |
| 117 | + } |
| 118 | + } |
| 119 | + |
| 120 | + @if $variant == 'indigo' { |
| 121 | + @if not($focus-outline-color) and $empty-color { |
| 122 | + $focus-outline-color: hsla(from var(--empty-color) h s l / .5); |
| 123 | + } |
| 124 | + |
| 125 | + @if not($focus-outline-color-focused) and $fill-color { |
| 126 | + $focus-outline-color-focused: hsla(from var(--fill-color) h s l / .5); |
| 127 | + } |
| 128 | + } |
75 | 129 |
|
76 | 130 | @return extend($theme, (
|
77 | 131 | name: $name,
|
|
91 | 145 | border-radius: $border-radius,
|
92 | 146 | border-radius-ripple: $border-radius-ripple,
|
93 | 147 | focus-outline-color: $focus-outline-color,
|
| 148 | + focus-outline-color-focused: $focus-outline-color-focused, |
| 149 | + focus-border-color: $focus-border-color, |
94 | 150 | error-color: $error-color,
|
95 | 151 | error-color-hover: $error-color-hover,
|
96 |
| - theme: map.get($schema, '_meta', 'theme'), |
97 |
| - _meta: map.merge(if($meta, $meta, ()), ( |
98 |
| - variant: map.get($schema, '_meta', 'theme'), |
99 |
| - theme-variant: map.get($schema, '_meta', 'variant') |
100 |
| - )), |
| 152 | + focus-outline-color-error: $focus-outline-color-error |
101 | 153 | ));
|
102 | 154 | }
|
103 | 155 |
|
|
106 | 158 | /// @param {Map} $theme - The theme used to style the component.
|
107 | 159 | @mixin checkbox($theme) {
|
108 | 160 | @include css-vars($theme);
|
109 |
| - $theme-variant: map.get($theme, '_meta', 'theme-variant'); |
110 |
| - $variant: map.get($theme, '_meta', 'variant'); |
| 161 | + $theme-variant: map.get($theme, '_meta', 'variant'); |
| 162 | + $variant: map.get($theme, '_meta', 'theme'); |
111 | 163 | $material-theme: $variant == 'material';
|
112 | 164 | $bootstrap-theme: $variant == 'bootstrap';
|
113 | 165 |
|
|
591 | 643 | %igx-checkbox--focused-bootstrap {
|
592 | 644 | %cbx-composite {
|
593 | 645 | border-radius: var-get($theme, 'border-radius');
|
594 |
| - border-color: color($color: 'primary', $variant: 200); |
| 646 | + border-color: var-get($theme, 'focus-border-color'); |
595 | 647 | box-shadow: 0 0 0 rem(4px) var-get($theme, 'focus-outline-color');
|
596 | 648 | }
|
597 | 649 | }
|
598 | 650 |
|
599 |
| - %igx-checkbox--focused-hovered { |
| 651 | + %igx-checkbox--focused-hovered-bootstrap { |
600 | 652 | %cbx-composite {
|
601 |
| - border-color: color($color: 'primary', $variant: 300); |
| 653 | + border-color: hsl(from var-get($theme, 'focus-border-color') h calc(s * 1.12) calc(l * 0.82)); |
602 | 654 | }
|
603 | 655 | }
|
604 | 656 |
|
|
0 commit comments