Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(switch): updates focus outline to be rounded #7390

Merged
merged 8 commits into from
Jul 31, 2023
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
4 changes: 4 additions & 0 deletions packages/calcite-components/src/components/switch/switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
@apply focus-base w-auto;
}

.container {
@apply rounded-full;
}

.track {
@apply bg-foreground-2
border-color-2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,20 @@ export const darkModeRTL_TestOnly = (): string => html`
darkModeRTL_TestOnly.parameters = { modes: modesDarkDefault };

export const disabled_TestOnly = (): string => html`<calcite-switch disabled checked></calcite-switch>`;

export const Focus_TestOnly = (): string =>
Copy link
Member

@jcfranco jcfranco Jul 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you may need to add a delay to the story to ensure the screenshot is taken when the test setup is done.

@benelan Do you have any additional tips?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s currently not showing the focus outline.

1FE0E813-3A0C-4D40-BFDC-2F690F88BF8D

html`
<div style="width:300px;height:300px; padding: 20px">
<calcite-switch> </calcite-switch>
</div>
<script>
(async () => {
anveshmekala marked this conversation as resolved.
Show resolved Hide resolved
await customElements.whenDefined("calcite-switch");
await document.querySelector("calcite-switch").setFocus();
})();
</script>
`;

Focus_TestOnly.parameters = {
chromatic: { delay: 1000 },
};