Skip to content

Commit 33312d5

Browse files
authored
feat(block): enhance component's interactivity states (#11827)
**Related Issue:** [#10017](#10017) ## Summary - Update `:active` background color to `--calcite-color-foreground-3`. - Update description to `--calcite-color-text-2` when `expanded`. - Update icon-start | end to `--calcite-color-text-1` when `expanded`.
1 parent f2735b8 commit 33312d5

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Diff for: packages/calcite-components/src/components/block/block.e2e.ts

+5
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,11 @@ describe("calcite-block", () => {
494494
targetProp: "backgroundColor",
495495
state: "hover",
496496
},
497+
"--calcite-block-header-background-color-press": {
498+
shadowSelector: `.${CSS.toggle}`,
499+
targetProp: "backgroundColor",
500+
state: { press: `calcite-block >>> .${CSS.toggle}` },
501+
},
497502
"--calcite-block-text-color": [
498503
{ shadowSelector: `.${CSS.description}`, targetProp: "color" },
499504
{ shadowSelector: `.${CSS.contentStart}`, targetProp: "color" },

Diff for: packages/calcite-components/src/components/block/block.scss

+13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* @prop --calcite-block-border-color: Specifies the component's border color.
77
* @prop --calcite-block-header-background-color: Specifies the component's `heading` background color.
88
* @prop --calcite-block-header-background-color-hover: Specifies the component's `heading` background color when hovered.
9+
* @prop --calcite-block-header-background-color-press: Specifies the component's `heading` background color when pressed.
910
* @prop --calcite-block-heading-text-color: Specifies the component's `heading` text color.
1011
* @prop --calcite-block-heading-text-color-press: When the component is `expanded`, specifies the `heading` text color.
1112
* @prop --calcite-block-padding: [Deprecated] Specifies the padding of the component's `default` slot.
@@ -93,6 +94,9 @@
9394
&:focus {
9495
@apply focus-inset;
9596
}
97+
&:active {
98+
background-color: var(--calcite-block-header-background-color-press, var(--calcite-color-foreground-3));
99+
}
96100
}
97101

98102
calcite-loader[inline] {
@@ -210,6 +214,15 @@ calcite-action-menu {
210214
.header .title .heading {
211215
color: var(--calcite-block-heading-text-color-press, var(--calcite-color-text-1));
212216
}
217+
218+
.description {
219+
color: var(--calcite-block-text-color, var(--calcite-color-text-2));
220+
}
221+
222+
.icon--start,
223+
.icon--end {
224+
color: var(--calcite-block-text-color, var(--calcite-color-text-1));
225+
}
213226
}
214227

215228
@include base-component();

0 commit comments

Comments
 (0)