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
Changes from 1 commit
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 @@ -14,6 +14,16 @@

@include disabled();

.indent {
Copy link
Member

Choose a reason for hiding this comment

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

indent isn't a valid class on the list-item. Can this part be reverted? It should be on .nested-container. I'm guessing this was copied from a previous release.

@apply flex
flex-col
border-solid
border-0
border-color-3;

margin-inline-start: var(--calcite-list-item-spacing-indent, theme("spacing.6"));
}

.container {
@apply bg-foreground-1
box-border
Expand Down Expand Up @@ -52,16 +62,11 @@
}

.nested-container {
@apply hidden flex-col
border-solid
border-0
border-color-3;

margin-inline-start: var(--calcite-list-item-spacing-indent, theme("spacing.6"));
@apply flex flex-col;
}

.nested-container--open {
@apply flex;
.nested-container--hidden {
Copy link
Member

Choose a reason for hiding this comment

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

This should be reverted as well.

@apply hidden;
}

.content-container {
Expand All @@ -79,9 +84,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 +205,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 +216,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
Loading