Tab 4 Content
Tab 1 Content
Tab 2 Content
diff --git a/src/assets/styles/includes.scss b/src/assets/styles/includes.scss
index 151624b7e1c..0fc6a3c2422 100644
--- a/src/assets/styles/includes.scss
+++ b/src/assets/styles/includes.scss
@@ -41,3 +41,18 @@
z-index: -1 !important;
}
}
+
+// mixin to provide base disabled styles for interactive components
+// additional styling can be passed via @content
+@mixin disabled() {
+ :host([disabled]) {
+ @apply cursor-default opacity-disabled pointer-events-none select-none;
+ @content;
+
+ ::slotted([calcite-hydrated][disabled]),
+ [calcite-hydrated][disabled] {
+ /* prevent opacity stacking */
+ @apply opacity-100;
+ }
+ }
+}
diff --git a/src/components/action/action.e2e.ts b/src/components/action/action.e2e.ts
index ea079d7f110..7adb28be1ab 100755
--- a/src/components/action/action.e2e.ts
+++ b/src/components/action/action.e2e.ts
@@ -1,5 +1,5 @@
import { newE2EPage } from "@stencil/core/testing";
-import { accessible, hidden, renders } from "../../tests/commonTests";
+import { accessible, disabled, hidden, renders } from "../../tests/commonTests";
import { CSS } from "./resources";
describe("calcite-action", () => {
@@ -7,6 +7,8 @@ describe("calcite-action", () => {
it("honors hidden attribute", async () => hidden("calcite-action"));
+ it("can be disabled", () => disabled("calcite-action"));
+
it("should have visible text when text is enabled", async () => {
const page = await newE2EPage();
await page.setContent(`
Tab 4 Content
Tab 1 Content
Tab 2 Content