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

fix(list-item): Improve focus outline appearance #9653

Merged
merged 6 commits into from
Jun 20, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,14 @@ td {
@apply focus-base;
}

tr {
@apply relative;
}

tr:focus,
td:focus {
@apply focus-inset;
z-index: var(--calcite-app-z-index-sticky);
outline: 2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));
}

.content,
Expand Down Expand Up @@ -195,7 +200,7 @@ td:focus {

.actions-start,
.actions-end {
@apply p-0;
@apply p-0 relative;
::slotted(calcite-action),
::slotted(calcite-action-menu),
::slotted(calcite-handle),
Expand All @@ -206,6 +211,40 @@ td:focus {
}
}

tr:focus {
.actions-start,
.actions-end {
inset-block: theme("spacing[0.5]");
Copy link
Member

Choose a reason for hiding this comment

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

note: At some point these theme() vars will need to be updated to use calcite css vars.

.close,
::slotted(calcite-action),
::slotted(calcite-action-menu),
::slotted(calcite-handle),
::slotted(calcite-dropdown) {
block-size: calc(100% - theme("spacing[1]"));
}
}

&::after,
&::before {
@apply absolute;
content: "";
inline-size: theme("spacing[0]");
z-index: theme("zIndex.header");
Copy link
Member

Choose a reason for hiding this comment

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

optional: Might be able to use a css var here for z-index.

background-color: theme("colors.brand");
Copy link
Member

Choose a reason for hiding this comment

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

optional: Might be able to use a css var here for brand.

inset-block: 0;
}
&::before {
inset-inline-start: 0;
}
&::after {
inset-inline-end: 0;
}
}

.container--border:focus::before {
display: none;
}

::slotted(calcite-list:empty) {
@apply border-t-0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ export class ListItem
{closable ? (
<calcite-action
appearance="transparent"
class={CSS.close}
icon={ICONS.close}
key="close-action"
label={messages.close}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const CSS = {
selectionContainerSingle: "selection-container--single",
openContainer: "open-container",
dragContainer: "drag-container",
close: "close",
};

export const SLOTS = {
Expand Down
Loading