Skip to content

Commit 1cd9598

Browse files
committed
refactor(chip): only apply the color / background to hue classes
1 parent 3fd42cb commit 1cd9598

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

core/src/components/chip/chip.ionic.scss

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
* @prop --focus-ring-color: Color of the focus ring
1010
* @prop --focus-ring-width: Width of the focus ring
1111
*/
12-
--background: #{globals.$ion-primitives-neutral-100};
13-
--color: #{globals.$ion-primitives-neutral-800};
1412
--focus-ring-color: #{globals.$ion-border-focus-default};
1513
--focus-ring-width: #{globals.$ion-border-size-050};
1614

@@ -31,7 +29,6 @@
3129
:host(.chip-outline) {
3230
border-width: globals.$ion-border-size-025;
3331
border-style: globals.$ion-border-style-solid;
34-
border-color: globals.$ion-primitives-neutral-300;
3532
}
3633

3734
// Chip: Focus
@@ -46,15 +43,15 @@
4643
// ---------------------------------------------
4744

4845
@media (any-hover: hover) {
49-
:host(:hover) {
46+
:host(.chip-subtle:hover) {
5047
--background: #{globals.$ion-primitives-neutral-200};
5148
}
5249

5350
:host(.chip-bold:hover) {
5451
--background: #{globals.$ion-primitives-neutral-1100};
5552
}
5653

57-
:host(.ion-color:hover) {
54+
:host(.chip-subtle.ion-color:hover) {
5855
background: globals.current-color(tint, $subtle: true);
5956
}
6057

@@ -106,6 +103,18 @@
106103
font-size: globals.$ion-font-size-350;
107104
}
108105

106+
// Subtle Chip
107+
// ---------------------------------------------
108+
109+
:host(.chip-subtle) {
110+
--background: #{globals.$ion-primitives-neutral-100};
111+
--color: #{globals.$ion-primitives-neutral-800};
112+
}
113+
114+
:host(.chip-outline.chip-subtle) {
115+
border-color: globals.$ion-primitives-neutral-300;
116+
}
117+
109118
// Bold Chip
110119
// ---------------------------------------------
111120

@@ -124,12 +133,12 @@
124133
// ---------------------------------------------
125134

126135
// Subtle
127-
:host(.ion-color) {
136+
:host(.chip-subtle.ion-color) {
128137
background: globals.current-color(base, $subtle: true);
129138
color: globals.current-color(contrast, $subtle: true);
130139
}
131140

132-
:host(.chip-outline.ion-color) {
141+
:host(.chip-subtle.chip-outline.ion-color) {
133142
border-color: globals.current-color(shade, $subtle: true);
134143
}
135144

0 commit comments

Comments
 (0)