Skip to content
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
2 changes: 1 addition & 1 deletion packages/edit-site/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
z-index: z-index(".edit-site-layout__hub");

@include break-medium {
width: calc(#{$nav-sidebar-width} - #{$grid-unit-30});
width: calc(#{$nav-sidebar-width} - #{$grid-unit-15});
}

.edit-site-layout.is-full-canvas & {
Expand Down
43 changes: 25 additions & 18 deletions packages/edit-site/src/components/site-hub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,25 +156,32 @@ const SiteHub = memo( ( { isTransparent, className } ) => {
<div className="edit-site-site-hub__title">
{ decodeEntities( siteTitle ) }
</div>
<HStack
spacing={ 0 }
expanded={ false }
className="edit-site-site-hub__actions"
>
<Button
href={ homeUrl }
target="_blank"
label={ __(
'View site (opens in a new tab)'
) }
aria-label={ __(
'View site (opens in a new tab)'
) }
icon={ external }
className="edit-site-site-hub__site-view-link"
/>

<Button
href={ homeUrl }
target="_blank"
label={ __( 'View site (opens in a new tab)' ) }
aria-label={ __(
'View site (opens in a new tab)'
) }
icon={ external }
className="edit-site-site-hub__site-view-link"
/>

<Button
className="edit-site-site-hub_toggle-command-center"
icon={ search }
onClick={ () => openCommandCenter() }
label={ __( 'Open command palette' ) }
shortcut={ displayShortcut.primary( 'k' ) }
/>
<Button
className="edit-site-site-hub_toggle-command-center"
icon={ search }
onClick={ () => openCommandCenter() }
label={ __( 'Open command palette' ) }
shortcut={ displayShortcut.primary( 'k' ) }
/>
</HStack>
</HStack>
) }
</AnimatePresence>
Expand Down
6 changes: 4 additions & 2 deletions packages/edit-site/src/components/site-hub/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
align-items: center;
justify-content: space-between;
gap: $grid-unit-10;
overflow: hidden;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@youknowriad you added this recently but I noticed it was cutting off the focus ring on the search button. Removing it doesn't seem to have caused any issues. Do you remember why it was added?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was important for long site titles, did you try that

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's fine to keep it but the icons are pushed to the right, so you'll need a flex-shrink: 0 somewhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there's a flex-grow rule that is now unnecessary in .edit-site-site-hub__site-view-link as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Long titles seem to mess things up regardless, even with overflow hidden:

Screenshot 2024-04-05 at 13 49 36

I'll continue tweaking.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes by adding flex-shrink: 0 to your new hstack it will solve the long titles issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2024-04-05 at 14 00 28

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Still not seeing a need for this overflow style 🤔

}

.edit-site-site-hub__actions {
flex-shrink: 0;
}

.edit-site-site-hub__view-mode-toggle-container {
Expand All @@ -29,7 +32,6 @@
}

.edit-site-site-hub__site-view-link {
flex-grow: 0;
margin-right: var(--wp-admin-border-width-focus);
svg {
fill: $gray-200;
Expand Down