-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(chip): enhance component's interactivity states #11538
Changes from 3 commits
5887bc6
92ee5bc
4508fec
0f44d64
a9cf93e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,95 @@ | |
opacity: 1; | ||
} | ||
|
||
:host([appearance="solid"]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would internal CSS props help simplify this? .container {
&.selectable {
&:active {
background-color: var(--calcite-internal-chip-selectable-active-background-color);
border-color: var(--calcite-internal-chip-selectable-active-border-color);
}
&:hover {
background-color: var(--calcite-internal-chip-selectable-hover-background-color);
border-color: var(--calcite-internal-chip-selectable-hover-border-color);
}
}
:host([appearance="solid"]) {
&:host([kind="neutral"]) {
// using illustrative names
--calcite-internal-chip-selectable-active-background-color: var(--calcite-color-a);
--calcite-internal-chip-selectable-active-border-color: transparent;
--calcite-internal-chip-selectable-hover-background-color: var(--calcite-color-c);
--calcite-internal-chip-selectable-hover-border-color: transparent;
}
}
// ... This can be done in a follow-up if feasible. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can take a look at this and create a follow-up issue if it's feasible. |
||
&:host([kind="neutral"]) .container { | ||
&.selectable { | ||
&:hover { | ||
background-color: var(--calcite-color-foreground-3); | ||
} | ||
&:active { | ||
background-color: var(--calcite-color-border-3); | ||
} | ||
} | ||
} | ||
|
||
&:host([kind="inverse"]) .container { | ||
&.selectable { | ||
&:hover { | ||
background-color: var(--calcite-color-inverse-hover); | ||
} | ||
&:active { | ||
background-color: var(--calcite-color-inverse-press); | ||
} | ||
} | ||
} | ||
|
||
&:host([kind="brand"]) .container { | ||
&.selectable { | ||
&:hover { | ||
background-color: var(--calcite-color-brand-hover); | ||
} | ||
&:active { | ||
background-color: var(--calcite-color-brand-press); | ||
} | ||
} | ||
} | ||
} | ||
|
||
:host([appearance="outline-fill"]) { | ||
&:host([kind="neutral"]) .container { | ||
&.selectable { | ||
&:hover { | ||
background-color: var(--calcite-color-foreground-2); | ||
border-color: var(--calcite-color-border-input); | ||
} | ||
&:active { | ||
background-color: var(--calcite-color-foreground-3); | ||
border-color: var(--calcite-color-text-3); | ||
} | ||
} | ||
} | ||
|
||
&:host([kind="inverse"]) .container, | ||
&:host([kind="brand"]) .container { | ||
&.selectable { | ||
&:hover { | ||
background-color: var(--calcite-color-foreground-2); | ||
} | ||
&:active { | ||
background-color: var(--calcite-color-foreground-3); | ||
} | ||
} | ||
} | ||
} | ||
|
||
:host([appearance="outline"]) { | ||
&:host([kind="neutral"]) .container { | ||
&.selectable { | ||
&:hover { | ||
background-color: var(--calcite-color-transparent-hover); | ||
border-color: var(--calcite-color-border-input); | ||
} | ||
&:active { | ||
background-color: var(--calcite-color-transparent-press); | ||
border-color: var(--calcite-color-text-3); | ||
} | ||
} | ||
} | ||
|
||
&:host([kind="inverse"]) .container, | ||
&:host([kind="brand"]) .container { | ||
&.selectable { | ||
&:hover { | ||
background-color: var(--calcite-color-transparent-hover); | ||
} | ||
&:active { | ||
background-color: var(--calcite-color-transparent-press); | ||
} | ||
} | ||
} | ||
} | ||
|
||
:host([scale="s"]) { | ||
.container { | ||
--calcite-internal-chip-block-size: var(--calcite-size-sm, 1.5rem) /* 24px */; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not be the case, but let’s remove any non-essential inline styles for the test to keep it as focused and simple as possible.