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): hide nested list items by default #9474

Merged
merged 1 commit into from
Jun 6, 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 @@ -14,16 +14,6 @@

@include disabled();

.indent {
@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 @@ -62,11 +52,16 @@
}

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

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

.nested-container--hidden {
@apply hidden;
.nested-container--open {
@apply flex;
}

.content-container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ export class ListItem
<div
class={{
[CSS.nestedContainer]: true,
[CSS.nestedContainerHidden]: this.openable && !this.open,
[CSS.nestedContainerOpen]: this.openable && this.open,
}}
>
<slot
Expand Down Expand Up @@ -701,7 +701,7 @@ export class ListItem
</tr>
{this.renderContentBottom()}
</div>
<div class={CSS.indent}>{this.renderDefaultContainer()}</div>
{this.renderDefaultContainer()}
</InteractiveContainer>
</Host>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export const CSS = {
wrapper: "wrapper",
wrapperBordered: "wrapper--bordered",
container: "container",
indent: "indent",
containerHover: "container--hover",
containerBorder: "container--border",
containerBorderSelected: "container--border-selected",
Expand All @@ -11,7 +10,7 @@ export const CSS = {
contentContainerSelectable: "content-container--selectable",
contentContainerHasCenterContent: "content-container--has-center-content",
nestedContainer: "nested-container",
nestedContainerHidden: "nested-container--hidden",
nestedContainerOpen: "nested-container--open",
content: "content",
customContent: "custom-content",
actionsStart: "actions-start",
Expand Down
Loading