Skip to content

Commit 2616b82

Browse files
authored
feat(switch): updates focus outline to be rounded (#7390)
**Related Issue:** #4633 ## Summary This PR will replace the block focus outline of `calcite-switch` with a rounded one. Before the change: ![25C47646-4B10-45A7-94E3-3CD884D35370_4_5005_c](https://github.com/Esri/calcite-design-system/assets/88453586/02313b88-8c2e-4f51-9b45-7b9631dff59f) After the change: ![92B6D3BC-5B7E-4041-B424-BAB2F89E3C32_4_5005_c](https://github.com/Esri/calcite-design-system/assets/88453586/4d47a41f-dd8d-43f2-8390-1b89a9120440)
1 parent 87bd496 commit 2616b82

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

packages/calcite-components/src/components/switch/switch.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
@apply focus-base w-auto;
5353
}
5454

55+
.container {
56+
@apply rounded-full;
57+
}
58+
5559
.track {
5660
@apply bg-foreground-2
5761
border-color-2

packages/calcite-components/src/components/switch/switch.stories.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,20 @@ export const darkModeRTL_TestOnly = (): string => html`
3535
darkModeRTL_TestOnly.parameters = { modes: modesDarkDefault };
3636

3737
export const disabled_TestOnly = (): string => html`<calcite-switch disabled checked></calcite-switch>`;
38+
39+
export const Focus_TestOnly = (): string =>
40+
html`
41+
<div style="width:300px;height:300px; padding: 20px">
42+
<calcite-switch> </calcite-switch>
43+
</div>
44+
<script>
45+
(async () => {
46+
await customElements.whenDefined("calcite-switch");
47+
await document.querySelector("calcite-switch").setFocus();
48+
})();
49+
</script>
50+
`;
51+
52+
Focus_TestOnly.parameters = {
53+
chromatic: { delay: 1000 },
54+
};

0 commit comments

Comments
 (0)