|
21 | 21 | /// @param {Color} $button-disabled-arrow-color [null] - The previous/next buttons disabled arrow color. |
22 | 22 | /// @param {Color} $button-border-color [null] - The previous/next buttons idle border color. |
23 | 23 | /// @param {Color} $button-hover-border-color [null] - The previous/next buttons hover border color. |
| 24 | +/// @param {Color} $button-focus-border-color [null] - The navigation buttons border color on focus. |
24 | 25 | /// @param {Color} $button-disabled-border-color [null] - The previous/next buttons disabled border color. |
| 26 | +/// @param {Color} $indicator-background [null] - The indicators container background color. |
| 27 | +/// @param {Color} $label-indicator-background [null] - The label indicator container background color. |
25 | 28 | /// @param {Color} $indicator-dot-color [null] - The idle indicator dot color. |
26 | 29 | /// @param {Color} $indicator-hover-dot-color [null] - The hover indicator dot color. |
| 30 | +/// @param {Color} $indicator-focus-color [null] - The indicators border and dot color on focus. |
27 | 31 | /// @param {Color} $indicator-border-color [null] - The idle indicator border color. |
28 | 32 | /// @param {Color} $indicator-active-dot-color [null] - The active indicator dot color. |
29 | 33 | /// @param {Color} $indicator-active-border-color [null] - The active indicator border color. |
|
54 | 58 | $button-disabled-background: null, |
55 | 59 | $button-arrow-color: null, |
56 | 60 | $button-hover-arrow-color: null, |
| 61 | + $button-focus-arrow-color: null, |
57 | 62 | $button-disabled-arrow-color: null, |
58 | 63 | $button-border-color: null, |
59 | 64 | $button-hover-border-color: null, |
| 65 | + $button-focus-border-color: null, |
60 | 66 | $button-disabled-border-color: null, |
61 | 67 |
|
| 68 | + $indicator-background: null, |
| 69 | + $label-indicator-background: null, |
62 | 70 | $indicator-dot-color: null, |
63 | 71 | $indicator-hover-dot-color: null, |
| 72 | + $indicator-focus-color: null, |
64 | 73 | $indicator-border-color: null, |
65 | 74 | $indicator-active-dot-color: null, |
66 | 75 | $indicator-active-border-color: null, |
|
76 | 85 | } |
77 | 86 |
|
78 | 87 | $theme: digest-schema($carousel-schema); |
79 | | - $meta: map.get($theme, '_meta'); |
| 88 | + $variant: map.get($theme, '_meta', 'theme'); |
| 89 | + |
| 90 | + @if $variant == 'indigo' { |
| 91 | + @if not($button-hover-background) and $button-background { |
| 92 | + $button-hover-background: hsl(from var(--button-background) h s calc(l * 0.9)); |
| 93 | + } |
| 94 | + |
| 95 | + @if not($button-border-color) and $button-background { |
| 96 | + $button-border-color: hsl(from var(--button-background) h s calc(l * 0.9)); |
| 97 | + } |
| 98 | + |
| 99 | + @if not($button-hover-border-color) and $button-border-color { |
| 100 | + $button-hover-border-color: hsl(from var(--button-border-color) h s calc(l * 0.9)); |
| 101 | + } |
| 102 | + |
| 103 | + @if not($indicator-active-dot-color) and not($indicator-background) and $button-background { |
| 104 | + $indicator-active-dot-color: var(--button-background); |
| 105 | + } |
| 106 | + } |
80 | 107 |
|
81 | 108 | @if not($button-shadow) { |
82 | 109 | $button-elevation: map.get($carousel-schema, 'button-elevation'); |
83 | 110 | $button-shadow: elevation($button-elevation); |
84 | 111 | } |
85 | 112 |
|
86 | 113 | @if not($button-arrow-color) and $button-background { |
87 | | - $button-arrow-color: text-contrast($button-background); |
| 114 | + $button-arrow-color: hsla(from (adaptive-contrast(var(--button-background)) h s l / 0.85)); |
| 115 | + } |
| 116 | + |
| 117 | + @if not($button-hover-background) and $button-background { |
| 118 | + $button-hover-background: var(--button-background); |
88 | 119 | } |
89 | 120 |
|
90 | 121 | @if not($button-hover-arrow-color) and $button-hover-background { |
91 | | - $button-hover-arrow-color: text-contrast($button-hover-background); |
| 122 | + $button-hover-arrow-color: adaptive-contrast(var(--button-hover-background)); |
| 123 | + } |
| 124 | + |
| 125 | + @if not($button-focus-arrow-color) and $button-hover-arrow-color { |
| 126 | + $button-focus-arrow-color: var(--button-hover-arrow-color); |
| 127 | + } |
| 128 | + |
| 129 | + @if not($button-disabled-background) and $button-background { |
| 130 | + $button-disabled-background: var(--button-background); |
92 | 131 | } |
93 | 132 |
|
94 | 133 | @if not($button-disabled-arrow-color) and $button-disabled-background { |
95 | | - @if meta.type-of($button-disabled-background) == 'color' { |
96 | | - $button-disabled-arrow-color: rgba(text-contrast($button-disabled-background), .3); |
| 134 | + $button-disabled-arrow-color: hsla(from adaptive-contrast(var(--button-disabled-background)) h s l / .4); |
| 135 | + } |
| 136 | + |
| 137 | + @if not($indicator-dot-color) and $indicator-background { |
| 138 | + $indicator-dot-color: hsla(from adaptive-contrast(var(--indicator-background)) h s l / .8); |
| 139 | + } |
| 140 | + |
| 141 | + @if not($indicator-hover-dot-color) and $indicator-dot-color { |
| 142 | + $indicator-hover-dot-color: hsla(from var(--indicator-dot-color) h s l / 1); |
| 143 | + } |
| 144 | + |
| 145 | + @if not($indicator-border-color) and $indicator-dot-color { |
| 146 | + $indicator-border-color: var(--indicator-dot-color); |
| 147 | + } |
| 148 | + |
| 149 | + @if not($indicator-active-dot-color) and $indicator-background { |
| 150 | + $indicator-active-dot-color: hsl(from adaptive-contrast(var(--indicator-background)) h s calc(l * 0.9)); |
| 151 | + } |
| 152 | + |
| 153 | + @if not($indicator-active-hover-dot-color) and $indicator-active-dot-color { |
| 154 | + $indicator-active-hover-dot-color: hsl(from var(--indicator-active-dot-color) h s calc(l * 1.1)); |
| 155 | + } |
| 156 | + |
| 157 | + @if not($indicator-active-border-color) and $indicator-active-dot-color { |
| 158 | + $indicator-active-border-color: var(--indicator-active-dot-color); |
| 159 | + } |
| 160 | + |
| 161 | + @if $variant == 'material' { |
| 162 | + @if not($button-focus-border-color) and $button-focus-arrow-color { |
| 163 | + $button-focus-border-color: var(--button-focus-arrow-color); |
| 164 | + } |
| 165 | + } |
| 166 | + |
| 167 | + @if $variant == 'fluent' or $variant == 'bootstrap' { |
| 168 | + @if not($button-focus-border-color) and $button-background { |
| 169 | + $button-focus-border-color: hsla(from adaptive-contrast(var(--button-background)) h s l / 0.5); |
| 170 | + } |
| 171 | + } |
| 172 | + |
| 173 | + @if $variant == 'indigo' { |
| 174 | + @if not($button-focus-border-color) and $indicator-active-dot-color { |
| 175 | + $button-focus-border-color: var(--indicator-active-dot-color); |
| 176 | + } |
| 177 | + |
| 178 | + @if not($indicator-focus-color) and $indicator-active-hover-dot-color { |
| 179 | + $indicator-focus-color: hsla(from var(--indicator-active-hover-dot-color) h s l / .5); |
| 180 | + } |
| 181 | + } @else { |
| 182 | + @if not($indicator-focus-color) and not($indicator-background) and $button-background { |
| 183 | + $indicator-focus-color: var(--button-background); |
| 184 | + } |
| 185 | + |
| 186 | + @if not($indicator-focus-color) and $indicator-background { |
| 187 | + $indicator-focus-color: adaptive-contrast(var(--indicator-background)); |
97 | 188 | } |
98 | 189 | } |
99 | 190 |
|
|
110 | 201 | button-hover-background: $button-hover-background, |
111 | 202 | button-arrow-color: $button-arrow-color, |
112 | 203 | button-hover-arrow-color: $button-hover-arrow-color, |
| 204 | + button-focus-arrow-color: $button-focus-arrow-color, |
113 | 205 | button-disabled-arrow-color: $button-disabled-arrow-color, |
114 | 206 | button-border-color: $button-border-color, |
115 | 207 | button-hover-border-color: $button-hover-border-color, |
| 208 | + button-focus-border-color: $button-focus-border-color, |
116 | 209 | button-disabled-border-color: $button-disabled-border-color, |
117 | 210 |
|
| 211 | + indicator-background: $indicator-background, |
| 212 | + label-indicator-background: $label-indicator-background, |
118 | 213 | indicator-dot-color: $indicator-dot-color, |
119 | 214 | indicator-hover-dot-color: $indicator-hover-dot-color, |
| 215 | + indicator-focus-color: $indicator-focus-color, |
120 | 216 | indicator-border-color: $indicator-border-color, |
121 | 217 | indicator-active-dot-color: $indicator-active-dot-color, |
122 | 218 | indicator-active-border-color: $indicator-active-border-color, |
123 | 219 | indicator-active-hover-dot-color: $indicator-active-hover-dot-color, |
124 | | - theme: map.get($schema, '_meta', 'theme'), |
125 | | - _meta: map.merge(if($meta, $meta, ()), ( |
126 | | - variant: map.get($schema, '_meta', 'theme') |
127 | | - )), |
128 | 220 | )); |
129 | 221 | } |
130 | 222 |
|
|
139 | 231 | $indicator-border-style: rem(2px) solid; |
140 | 232 | $btn-indent: rem(3px); |
141 | 233 |
|
142 | | - $variant: map.get($theme, '_meta', 'variant'); |
| 234 | + $variant: map.get($theme, '_meta', 'theme'); |
143 | 235 | $not-bootstrap-theme: $variant != 'bootstrap'; |
144 | 236 |
|
145 | 237 | %igx-carousel-display { |
|
206 | 298 | border: rem(2px) solid var-get($theme, 'button-focus-border-color'); |
207 | 299 |
|
208 | 300 | igx-icon { |
209 | | - color: var-get($theme, 'button-focus-border-color'); |
| 301 | + color: var-get($theme, 'button-focus-arrow-color'); |
210 | 302 | } |
211 | 303 |
|
212 | 304 | @if $variant == 'bootstrap' { |
213 | 305 | box-shadow: 0 0 0 rem(4px) var-get($theme, 'button-focus-border-color'); |
214 | 306 | border-color: var-get($theme, 'button-border-color'); |
215 | | - |
216 | | - igx-icon { |
217 | | - color: var-get($theme, 'button-arrow-color'); |
218 | | - } |
219 | 307 | } |
220 | 308 |
|
221 | 309 | @if $variant == 'fluent' { |
222 | 310 | border: none; |
223 | 311 |
|
224 | | - igx-icon { |
225 | | - color: var-get($theme, 'indicator-focus-color'); |
226 | | - } |
227 | | - |
228 | 312 | &::after { |
229 | 313 | position: absolute; |
230 | 314 | content: ''; |
|
239 | 323 |
|
240 | 324 | @if $variant == 'indigo' { |
241 | 325 | box-shadow: 0 0 0 rem(3px) var-get($theme, 'indicator-focus-color'); |
242 | | - |
243 | | - igx-icon { |
244 | | - color: var-get($theme, 'button-arrow-color'); |
245 | | - } |
246 | 326 | } |
247 | 327 | } |
248 | 328 |
|
|
0 commit comments