Skip to content

Commit 966d42d

Browse files
committed
docs(list): fix comments
1 parent aaa1853 commit 966d42d

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

en/components/list.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -549,16 +549,16 @@ Finally, we need to apply the filtering pipe to our contacts data before we can
549549

550550
## List Item Selection
551551

552-
The list items have a `selected` state property that helps us track which items have been selected. This property allows us to identify and manage the selection status of each item.
552+
The list items have a `selected` property that helps us track which items are "selected". This property allows us to identify and manage the selection status of each item.
553553

554-
Here's an example, in which by using the `selected` property we apply a background color to the list items that we select:
554+
Here's an example illustrating how the visual style of the items changes when using the `selected` property:
555555

556556
<code-view style="height: 420px"
557557
data-demos-base-url="{environment:demosBaseUrl}"
558558
iframe-src="{environment:demosBaseUrl}/lists/list-item-selection" >
559559
</code-view>
560560

561-
To make list items selectable, we simply need to add the `selected` property value to each list item we want to be able to select. By default, this property will be set to `false`. Then, we add a `(click)` event to each list item, which will toggle the `selected` property value between `true` and `false`, effectively switching the selection state each time the item is clicked."
561+
By default, the `selected` property is set to `false`. We can toggle its value using an inline expression bound to the `(click)` event on each list item, effectively switching the visual state of the item each time it's clicked.
562562

563563
```html
564564
<igx-list>
@@ -576,11 +576,20 @@ To make list items selectable, we simply need to add the `selected` property val
576576
</igx-list>
577577
```
578578

579-
When a list item is selected, the class `.igx-list__item-base--selected` is added to the element. We can use this class to style the selected state of the element.
579+
The list item also exposes a few CSS variables which you can use to style different parts of the selected elements:
580+
581+
- `--item-background-selected`
582+
- `--item-text-color-selected`
583+
- `--item-title-color-selected`
584+
- `--item-action-color-selected`
585+
- `--item-subtitle-color-selected`
586+
- `--item-thumbnail-color-selected`
580587

581588
```scss
582-
.igx-list__item-base--selected .igx-list__item-content {
583-
background-color: var(--ig-secondary-500);
589+
igx-list-item {
590+
--item-background-selected: var(--ig-secondary-500);
591+
--item-title-color-selected: var(--ig-secondary-500-contrast);
592+
--item-subtitle-color-selected: var(--ig-info-100);
584593
}
585594
```
586595

0 commit comments

Comments
 (0)