Skip to content

Commit 7fb506f

Browse files
alisonaileabenelan
authored andcommitted
feat(button): add component tokens (#10358)
**Related Issue:** #7180 Blocked issues: #11210 ## Summary ### Calcite Button --calcite-button-background-color: Specifies the component's background color when appearance="solid" or appearance="outline-fill". --calcite-button-border-color: Specifies the component's border color when it has appearance="outline" or appearance="outline-fill". --calcite-button-corner-radius: Specifies the component's corner radius. --calcite-button-text-color: Specifies the component's text color.
1 parent f9f6abd commit 7fb506f

File tree

2 files changed

+315
-208
lines changed

2 files changed

+315
-208
lines changed

packages/calcite-components/src/components/button/button.e2e.ts

+56-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-strict-ignore
22
import { newE2EPage, E2EElement } from "@arcgis/lumina-compiler/puppeteerTesting";
33
import { describe, expect, it } from "vitest";
4-
import { accessible, defaults, disabled, hidden, HYDRATED_ATTR, labelable, t9n } from "../../tests/commonTests";
4+
import { accessible, defaults, disabled, hidden, HYDRATED_ATTR, labelable, t9n, themed } from "../../tests/commonTests";
55
import { GlobalTestProps } from "../../tests/utils";
66
import { html } from "../../../support/formatting";
77
import { CSS } from "./resources";
@@ -713,4 +713,59 @@ describe("calcite-button", () => {
713713
expect(elementHost).toEqualAttribute("width", "full");
714714
expect(await elementAsButton.getComputedStyle()["width"]).toEqual(await elementHost.getComputedStyle()["width"]);
715715
});
716+
717+
describe("theme", () => {
718+
describe("default", () => {
719+
themed("calcite-button", {
720+
"--calcite-button-background-color": {
721+
shadowSelector: "button",
722+
targetProp: "backgroundColor",
723+
},
724+
"--calcite-button-corner-radius": {
725+
shadowSelector: "button",
726+
targetProp: "borderRadius",
727+
},
728+
"--calcite-button-text-color": {
729+
shadowSelector: "button",
730+
targetProp: "color",
731+
},
732+
"--calcite-button-border-color": {
733+
shadowSelector: "button",
734+
targetProp: "borderColor",
735+
},
736+
});
737+
});
738+
describe("loading", () => {
739+
themed(html`<calcite-button loading></calcite-button>`, {
740+
"--calcite-button-background-color": {
741+
shadowSelector: "button",
742+
targetProp: "backgroundColor",
743+
},
744+
"--calcite-button-corner-radius": {
745+
shadowSelector: "button",
746+
targetProp: "borderRadius",
747+
},
748+
"--calcite-button-text-color": {
749+
shadowSelector: "button",
750+
targetProp: "color",
751+
},
752+
"--calcite-button-loader-color": {
753+
shadowSelector: `.${CSS.loadingIn}`,
754+
targetProp: "color",
755+
},
756+
"--calcite-button-border-color": {
757+
shadowSelector: "button",
758+
targetProp: "borderColor",
759+
},
760+
});
761+
});
762+
describe("outline", () => {
763+
themed(html`<calcite-button appearance="outline"></calcite-button>`, {
764+
"--calcite-button-border-color": {
765+
shadowSelector: "button",
766+
targetProp: "borderColor",
767+
},
768+
});
769+
});
770+
});
716771
});

0 commit comments

Comments
 (0)