|
19 | 19 | /// @param {Color} $item-background [null] - The list item background color. |
20 | 20 | /// @param {Color} $item-background-hover [null] - The list item hover background color. |
21 | 21 | /// @param {Color} $item-background-active [null] - The active list item background color. |
| 22 | +/// @param {Color} $item-background-selected [null] - The selected list item background color. |
22 | 23 | /// @param {Color} $item-text-color [null] - The list item text color. |
23 | 24 | /// @param {Color} $item-text-color-hover [null] - The list item hover text color. |
24 | 25 | /// @param {Color} $item-text-color-active [null] - The active list item text color. |
| 26 | +/// @param {Color} $item-text-color-selected [null] - The selected list item text color. |
25 | 27 | /// @param {Color} $item-title-color [null] - The list item title color. |
26 | 28 | /// @param {Color} $item-title-color-hover [null] - The list item hover title color. |
27 | 29 | /// @param {Color} $item-title-color-active [null] - The active list item title color. |
| 30 | +/// @param {Color} $item-title-color-selected [null] - The selected list item title color. |
28 | 31 | /// @param {Color} $item-subtitle-color [null] - The list item subtitle color. |
29 | 32 | /// @param {Color} $item-subtitle-color-hover [null] - The list item hover subtitle color. |
30 | 33 | /// @param {Color} $item-subtitle-color-active [null] - The active list item subtitle color. |
| 34 | +/// @param {Color} $item-subtitle-color-selected [null] - The selected list item subtitle color. |
31 | 35 | /// @param {Color} $item-action-color [null] - The list item action color. |
32 | 36 | /// @param {Color} $item-action-color-hover [null] - The list item hover action color. |
33 | 37 | /// @param {Color} $item-action-color-active [null] - The active list item action color. |
| 38 | +/// @param {Color} $item-action-color-selected [null] - The selected list item action color. |
34 | 39 | /// @param {Color} $item-thumbnail-color [null] - The list item thumbnail color. |
35 | 40 | /// @param {Color} $item-thumbnail-color-hover [null] - The list item hover thumbnail color. |
36 | 41 | /// @param {Color} $item-thumbnail-color-active [null] - The active list item thumbnail color. |
| 42 | +/// @param {Color} $item-thumbnail-color-selected [null] - The selected list item thumbnail color. |
37 | 43 | /// @param {List} $border-radius [null] - The border radius used for list component. |
38 | 44 | /// @param {List} $item-border-radius [null] - The border radius used for list item. |
39 | 45 | /// @param {Color} $border-width [null] - The list border width. |
|
54 | 60 | $item-background: null, |
55 | 61 | $item-background-hover: null, |
56 | 62 | $item-background-active: null, |
| 63 | + $item-background-selected: null, |
57 | 64 | $item-text-color: null, |
58 | 65 | $item-text-color-hover: null, |
59 | 66 | $item-text-color-active: null, |
| 67 | + $item-text-color-selected: null, |
60 | 68 | $item-title-color: null, |
61 | 69 | $item-title-color-hover: null, |
62 | 70 | $item-title-color-active: null, |
| 71 | + $item-title-color-selected: null, |
63 | 72 | $item-subtitle-color: null, |
64 | 73 | $item-subtitle-color-hover: null, |
65 | 74 | $item-subtitle-color-active: null, |
| 75 | + $item-subtitle-color-selected: null, |
66 | 76 | $item-action-color: null, |
67 | 77 | $item-action-color-hover: null, |
68 | 78 | $item-action-color-active: null, |
| 79 | + $item-action-color-selected: null, |
69 | 80 | $item-thumbnail-color: null, |
70 | 81 | $item-thumbnail-color-hover: null, |
71 | 82 | $item-thumbnail-color-active: null, |
| 83 | + $item-thumbnail-color-selected: null, |
72 | 84 | $border-color: null, |
73 | 85 | $border-width: null, |
74 | 86 | ) { |
|
120 | 132 | } |
121 | 133 | } |
122 | 134 |
|
| 135 | + @if not($item-background-selected) and $item-background { |
| 136 | + @if meta.type-of($item-background) == 'color' { |
| 137 | + @if luminance($item-background) < .5 { |
| 138 | + $item-background-selected: color.scale($item-background, $lightness: 8%); |
| 139 | + } @else { |
| 140 | + $item-background-selected: color.scale($item-background, $lightness: -8%); |
| 141 | + } |
| 142 | + } |
| 143 | + } |
| 144 | + |
123 | 145 | @if not($header-text-color) and $header-background { |
124 | 146 | $header-text-color: text-contrast($header-background); |
125 | 147 | } |
|
180 | 202 | $item-text-color-active: text-contrast($item-background-active); |
181 | 203 | } |
182 | 204 |
|
| 205 | + @if not($item-text-color-selected) and $item-background-selected { |
| 206 | + $item-text-color-selected: text-contrast($item-background-selected); |
| 207 | + } |
| 208 | + |
183 | 209 | @if not($item-title-color-active) and $item-background-active { |
184 | 210 | $item-title-color-active: text-contrast($item-background-active); |
185 | 211 | } |
186 | 212 |
|
| 213 | + @if not($item-title-color-selected) and $item-background-selected { |
| 214 | + $item-title-color-selected: text-contrast($item-background-selected); |
| 215 | + } |
| 216 | + |
187 | 217 | @if not($item-action-color-active) and $item-background-active { |
188 | 218 | $item-action-color-active: text-contrast($item-background-active); |
189 | 219 | } |
190 | 220 |
|
| 221 | + @if not($item-action-color-selected) and $item-background-selected { |
| 222 | + $item-action-color-selected: text-contrast($item-background-selected); |
| 223 | + } |
| 224 | + |
191 | 225 | @if not($item-thumbnail-color-active) and $item-background-active { |
192 | 226 | $item-thumbnail-color-active: text-contrast($item-background-active); |
193 | 227 | } |
194 | 228 |
|
| 229 | + @if not($item-thumbnail-color-selected) and $item-background-selected { |
| 230 | + $item-thumbnail-color-selected: text-contrast($item-background-selected); |
| 231 | + } |
| 232 | + |
195 | 233 | @if not($item-subtitle-color-active) and $item-background-active { |
196 | 234 | @if meta.type-of($item-background-active) == 'color' { |
197 | 235 | $item-subtitle-color-active: rgba(text-contrast($item-background-active), .74); |
198 | 236 | } |
199 | 237 | } |
200 | 238 |
|
| 239 | + @if not($item-subtitle-color-selected) and $item-background-selected { |
| 240 | + @if meta.type-of($item-background-selected) == 'color' { |
| 241 | + $item-subtitle-color-selected: rgba(text-contrast($item-background-selected), .74); |
| 242 | + } |
| 243 | + } |
| 244 | + |
201 | 245 | @if not($item-subtitle-color-active) and $item-text-color-active { |
202 | 246 | $item-subtitle-color-active: $item-text-color-active; |
203 | 247 | } |
204 | 248 |
|
| 249 | + @if not($item-subtitle-color-selected) and $item-text-color-selected { |
| 250 | + $item-subtitle-color-selected: $item-text-color-selected; |
| 251 | + } |
| 252 | + |
205 | 253 | @return extend($theme, ( |
206 | 254 | name: $name, |
207 | 255 | border-radius: $border-radius, |
|
212 | 260 | item-background: $item-background, |
213 | 261 | item-background-hover: $item-background-hover, |
214 | 262 | item-background-active: $item-background-active, |
| 263 | + item-background-selected: $item-background-selected, |
215 | 264 | item-text-color: $item-text-color, |
216 | 265 | item-text-color-hover: $item-text-color-hover, |
217 | 266 | item-text-color-active: $item-text-color-active, |
| 267 | + item-text-color-selected: $item-text-color-selected, |
218 | 268 | item-title-color:$item-title-color, |
219 | 269 | item-title-color-hover:$item-title-color-hover, |
220 | 270 | item-title-color-active:$item-title-color-active, |
| 271 | + item-title-color-selected:$item-title-color-selected, |
221 | 272 | item-subtitle-color: $item-subtitle-color, |
222 | 273 | item-subtitle-color-hover: $item-subtitle-color-hover, |
223 | 274 | item-subtitle-color-active: $item-subtitle-color-active, |
| 275 | + item-subtitle-color-selected: $item-subtitle-color-selected, |
224 | 276 | item-action-color: $item-action-color, |
225 | 277 | item-action-color-hover: $item-action-color-hover, |
226 | 278 | item-action-color-active: $item-action-color-active, |
| 279 | + item-action-color-selected: $item-action-color-selected, |
227 | 280 | item-thumbnail-color: $item-thumbnail-color, |
228 | 281 | item-thumbnail-color-hover: $item-thumbnail-color-hover, |
229 | 282 | item-thumbnail-color-active: $item-thumbnail-color-active, |
| 283 | + item-thumbnail-color-selected: $item-thumbnail-color-selected, |
230 | 284 | border-color: $border-color, |
231 | 285 | border-width: $border-width, |
232 | 286 | theme: map.get($schema, '_meta', 'theme'), |
|
423 | 477 | } |
424 | 478 | } |
425 | 479 |
|
| 480 | + %igx-list-item-base--selected { |
| 481 | + %igx-list-item-content { |
| 482 | + @extend %igx-list-item-content--selected; |
| 483 | + } |
| 484 | + } |
| 485 | + |
426 | 486 | %igx-list-item-pan { |
427 | 487 | position: absolute; |
428 | 488 | visibility: hidden; |
|
550 | 610 | } |
551 | 611 | } |
552 | 612 |
|
| 613 | + %igx-list-item-content--selected { |
| 614 | + color: var-get($theme, 'item-text-color-selected'); |
| 615 | + background: var-get($theme, 'item-background-selected'); |
| 616 | + z-index: 3; |
| 617 | + |
| 618 | + %igx-list__item-line-title { |
| 619 | + color: var-get($theme, 'item-title-color-selected') |
| 620 | + } |
| 621 | + |
| 622 | + %igx-list__item-line-subtitle { |
| 623 | + color: var-get($theme, 'item-subtitle-color-selected') |
| 624 | + } |
| 625 | + |
| 626 | + %igx-list__item-actions { |
| 627 | + color: var-get($theme, 'item-action-color-selected'); |
| 628 | + |
| 629 | + igx-icon, |
| 630 | + igc-icon { |
| 631 | + color: var-get($theme, 'item-action-color-selected')} |
| 632 | + } |
| 633 | + |
| 634 | + %igx-list__item-thumbnail { |
| 635 | + color: var-get($theme, 'item-thumbnail-color-selected'); |
| 636 | + |
| 637 | + igx-icon, |
| 638 | + igc-icon { |
| 639 | + color: var-get($theme, 'item-thumbnail-color-selected') |
| 640 | + } |
| 641 | + } |
| 642 | + } |
| 643 | + |
553 | 644 | %igx-list-item-content--inactive { |
554 | 645 | transition: transform .3s $out-quad; |
555 | 646 | } |
|
0 commit comments