Skip to content

Commit

Permalink
Update list layout action styling (#61797)
Browse files Browse the repository at this point in the history
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: keoshi <keoshi@git.wordpress.org>
  • Loading branch information
5 people committed May 24, 2024
1 parent 4af3817 commit e2f1516
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 15 deletions.
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

1 comment on commit e2f1516

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in e2f1516.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9226224144
📝 Reported issues:

Please sign in to comment.