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

Update list layout action styling #61797

Merged
merged 8 commits into from
May 24, 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
11 changes: 8 additions & 3 deletions packages/components/src/dropdown-menu-v2/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@ describe( 'DropdownMenu', () => {

expect( toggleButton ).toHaveAttribute( 'aria-expanded', 'true' );

expect(
screen.getByRole( 'menu', { name: toggleButton.textContent ?? '' } )
).toHaveFocus();
await waitFor( () =>
expect(
screen.getByRole( 'menu', {
name: toggleButton.textContent ?? '',
} )
).toHaveFocus()
);

expect( screen.getByRole( 'separator' ) ).toHaveAttribute(
'aria-orientation',
'horizontal'
Expand Down
32 changes: 23 additions & 9 deletions packages/dataviews/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,27 @@
}
}

.dataviews-view-list__item-actions .components-button {
opacity: 0;
.dataviews-view-list__item-actions {
.components-button {
opacity: 0;
position: fixed;
}
}

&.is-selected,
&.is-hovered,
&:focus-within {
.dataviews-view-list__item-actions .components-button {
opacity: 1;
.dataviews-view-list__item-actions {
padding-right: $grid-unit-40;

.components-button {
opacity: 1;
position: static;
}
}

.dataviews-view-list__item {
padding-right: 0;
}
}

Expand Down Expand Up @@ -465,8 +477,7 @@
color: $gray-900;

.dataviews-view-list__primary-field,
.dataviews-view-list__fields,
.components-button {
.dataviews-view-list__fields {
color: var(--wp-admin-theme-color);
}
}
Expand All @@ -491,6 +502,7 @@
}
.dataviews-view-list__primary-field {
min-height: $grid-unit-05 * 5;
line-height: $grid-unit-05 * 5;
overflow: hidden;
}
}
Expand Down Expand Up @@ -534,17 +546,19 @@
gap: $grid-unit-10;
flex-wrap: wrap;
font-size: 12px;
line-height: $grid-unit-20;

.dataviews-view-list__field {
&:has(.dataviews-view-list__field-value:empty) {
display: none;
}
}
}

.dataviews-view-list__field-value {
line-height: $grid-unit-05 * 5;
display: inline-flex;
}
}
.dataviews-view-list__item-actions {
padding-top: $grid-unit-20;
padding-right: $grid-unit-30;
}

Expand Down
5 changes: 3 additions & 2 deletions packages/dataviews/src/view-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ function ListItem< Item extends AnyItem >( {
>
<HStack
className="dataviews-view-list__item-wrapper"
alignment="top"
alignment="center"
spacing={ 0 }
>
<div role="gridcell">
<CompositeItem
Expand All @@ -153,7 +154,7 @@ function ListItem< Item extends AnyItem >( {
<div className="dataviews-view-list__media-placeholder"></div>
) }
</div>
<VStack spacing={ 1 }>
<VStack spacing={ 0 }>
<span
className="dataviews-view-list__primary-field"
id={ labelId }
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-site/src/components/page-pages/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
.edit-site-page-pages__title-badge {
background: $gray-100;
color: $gray-700;
padding: $grid-unit-05 $grid-unit-10;
padding: 0 $grid-unit-05;
border-radius: $radius-block-ui;
font-size: 12px;
font-weight: 400;
Expand Down
Loading