From f666848392f78e613348d195d012209ab396afd6 Mon Sep 17 00:00:00 2001 From: Jose Carcamo Date: Mon, 24 Jun 2024 11:38:17 -0700 Subject: [PATCH 1/2] fix(list-item): Improve item outline --- .../src/components/list-item/list-item.scss | 40 ++++++++++++++++++- .../src/components/list-item/list-item.tsx | 1 + .../src/components/list-item/resources.ts | 1 + 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/packages/calcite-components/src/components/list-item/list-item.scss b/packages/calcite-components/src/components/list-item/list-item.scss index d183d842738..3866913621f 100755 --- a/packages/calcite-components/src/components/list-item/list-item.scss +++ b/packages/calcite-components/src/components/list-item/list-item.scss @@ -79,6 +79,10 @@ td { @apply focus-base; } +tr { + @apply relative; +} + tr:focus, td:focus { @apply focus-inset; @@ -195,7 +199,7 @@ td:focus { .actions-start, .actions-end { - @apply p-0; + @apply p-0 relative; ::slotted(calcite-action), ::slotted(calcite-action-menu), ::slotted(calcite-handle), @@ -206,6 +210,40 @@ td:focus { } } +tr:focus { + .actions-start, + .actions-end { + inset-block: theme("spacing[0.5]"); + .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.5]"); + z-index: theme("zIndex.header"); + background-color: theme("colors.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; } diff --git a/packages/calcite-components/src/components/list-item/list-item.tsx b/packages/calcite-components/src/components/list-item/list-item.tsx index bc8bf02e23f..6d9e924f41e 100644 --- a/packages/calcite-components/src/components/list-item/list-item.tsx +++ b/packages/calcite-components/src/components/list-item/list-item.tsx @@ -533,6 +533,7 @@ export class ListItem {closable ? ( Date: Mon, 24 Jun 2024 12:44:00 -0700 Subject: [PATCH 2/2] Re-added code lost during merge of dev --- .../calcite-components/src/components/list-item/list-item.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/calcite-components/src/components/list-item/list-item.scss b/packages/calcite-components/src/components/list-item/list-item.scss index 018fea0e2c7..3866913621f 100755 --- a/packages/calcite-components/src/components/list-item/list-item.scss +++ b/packages/calcite-components/src/components/list-item/list-item.scss @@ -85,8 +85,7 @@ tr { tr:focus, td:focus { - z-index: var(--calcite-app-z-index-sticky); - outline: 2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand)); + @apply focus-inset; } .content,