From 14dd871a8514ab5b002e6e024263521c714dfb37 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Fri, 1 Mar 2019 12:38:34 -0500 Subject: [PATCH] fix(item): slotted ion-icon receives custom color (#17585) * fix slotted icon color md * fix same issue in item divider * aevert "fix same issue in item divider" a ahis reverts commit c3748a8ed40d710d81cd8142d15b6b979ce0d9c3. a a Please enter the commit message for your changes. Lines starting a with '#' will be ignored, and an empty message aborts the commit. a a On branch fix-slot-icon-color-md a Changes to be committed: a modified: core/src/components/item-divider/item-divider.md.scss a * Revert "fix slotted icon color md" This reverts commit e80abea5cf41a54131b90d17f496a8aa5d32e75d. * fix case where no color * chore(): update selector to make it easier to override --- core/src/components/item-divider/item-divider.md.scss | 5 ++++- core/src/components/item-divider/test/preview/index.html | 7 +++++++ core/src/components/item/item.md.scss | 4 ++++ core/src/components/item/test/icons/index.html | 8 ++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/core/src/components/item-divider/item-divider.md.scss b/core/src/components/item-divider/item-divider.md.scss index 6c9d95a5c1..6eadfdf906 100644 --- a/core/src/components/item-divider/item-divider.md.scss +++ b/core/src/components/item-divider/item-divider.md.scss @@ -43,12 +43,15 @@ // -------------------------------------------------- ::slotted(ion-icon) { - color: $item-md-icon-slot-color; font-size: $item-md-icon-slot-font-size; } +:host(.ion-color) ::slotted(ion-icon) { + color: current-color(contrast); +} + ::slotted(ion-icon[slot]) { @include margin($item-md-icon-slot-margin-top, $item-md-icon-slot-margin-end, $item-md-icon-slot-margin-bottom, $item-md-icon-slot-margin-start); } diff --git a/core/src/components/item-divider/test/preview/index.html b/core/src/components/item-divider/test/preview/index.html index 686cfcdfda..f0d09880da 100644 --- a/core/src/components/item-divider/test/preview/index.html +++ b/core/src/components/item-divider/test/preview/index.html @@ -29,6 +29,13 @@ + + + Divider with a slotted icon + + + + Divider in List diff --git a/core/src/components/item/item.md.scss b/core/src/components/item/item.md.scss index bc87126498..0e37905a49 100644 --- a/core/src/components/item/item.md.scss +++ b/core/src/components/item/item.md.scss @@ -104,6 +104,10 @@ font-size: $item-md-icon-slot-font-size; } +:host(.ion-color) ::slotted(ion-icon) { + color: current-color(contrast); +} + ::slotted(ion-icon[slot]) { @include margin($item-md-icon-slot-margin-top, $item-md-icon-slot-margin-end, $item-md-icon-slot-margin-bottom, $item-md-icon-slot-margin-start); } diff --git a/core/src/components/item/test/icons/index.html b/core/src/components/item/test/icons/index.html index 170e85509d..68480f236d 100644 --- a/core/src/components/item/test/icons/index.html +++ b/core/src/components/item/test/icons/index.html @@ -21,6 +21,14 @@ + + + + ion-item w/ color + + + + ion-item [detail] attr