Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions packages/calcite-components/src/components/block/block.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,11 +555,7 @@ describe("calcite-block", () => {
targetProp: "backgroundColor",
state: { press: `calcite-block >>> .${CSS.toggle}` },
},
"--calcite-block-text-color": {
shadowSelector: `.${CSS.contentStart}`,
targetProp: "color",
},
"--calcite-block-heading-text-color-press": {
"--calcite-block-heading-text-color": {
shadowSelector: `.${CSS.heading}`,
targetProp: "color",
state: { press: { attribute: "class", value: CSS.heading } },
Expand Down Expand Up @@ -590,10 +586,38 @@ describe("calcite-block", () => {
},
);
});

describe("collapsed", () => {
themed(html`<calcite-block heading="heading"></calcite-block>`, {
"--calcite-block-heading-text-color": { shadowSelector: `.${CSS.heading}`, targetProp: "color" },
});
});

describe("deprecated", () => {
themed(
html`<calcite-block
heading="heading"
description="description"
expanded
collapsible
icon-end="pen"
icon-start="pen"
>
<calcite-icon icon="compass" slot="content-start"></calcite-icon>
<div>content</div>
</calcite-block>`,
{
"--calcite-block-text-color": {
shadowSelector: `.${CSS.contentStart}`,
targetProp: "color",
},
"--calcite-block-heading-text-color-press": {
shadowSelector: `.${CSS.heading}`,
targetProp: "color",
state: { press: { attribute: "class", value: CSS.heading } },
},
},
);
});
});
});
10 changes: 7 additions & 3 deletions packages/calcite-components/src/components/block/block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* @prop --calcite-block-header-background-color-hover: Specifies the component's `heading` background color when hovered.
* @prop --calcite-block-header-background-color-press: Specifies the component's `heading` background color when pressed.
* @prop --calcite-block-heading-text-color: Specifies the component's `heading` text color.
* @prop --calcite-block-heading-text-color-press: When the component is `expanded`, specifies the `heading` text color.
* @prop --calcite-block-heading-text-color-press: [Deprecated] use `--calcite-block-heading-text-color` instead - When the component is `expanded`, specifies the `heading` text color.
* @prop --calcite-block-padding: [Deprecated] use `--calcite-block-content-space` instead - Specifies the padding of the component's `default` slot.
* @prop --calcite-block-text-color: Specifies the component's text color.
* @prop --calcite-block-text-color:[Deprecated] Specifies the component's text color.
* @prop --calcite-block-description-text-color: Specifies the component's `description` text color.
* @prop --calcite-block-icon-color: Specifies the component's `collapsible` icon, `iconStart` and `iconEnd` color.
* @prop --calcite-block-icon-color-hover: Specifies the component's `collapsible` icon color when hovered.
Expand Down Expand Up @@ -260,6 +260,7 @@ calcite-handle {
.content-start {
@apply flex items-center;

// Deprecated
color: var(--calcite-block-text-color, var(--calcite-color-text-3));
}

Expand All @@ -280,7 +281,10 @@ calcite-action-menu {
@apply my-2;

.header .title .heading {
color: var(--calcite-block-heading-text-color-press, var(--calcite-color-text-1));
color: var(
--calcite-block-heading-text-color,
var(--calcite-block-heading-text-color-press, var(--calcite-color-text-1))
);
}

.description {
Expand Down
Loading