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 site icon and title position #66171

Merged
merged 1 commit into from
Oct 17, 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
4 changes: 2 additions & 2 deletions packages/edit-site/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {

.edit-site-layout__view-mode-toggle-icon {
display: flex;
height: $grid-unit-80;
width: $grid-unit-80;
height: $header-height;
width: $header-height;
justify-content: center;
align-items: center;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/edit-site/src/components/site-hub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const SiteHub = memo(
label={ __( 'Go to the Dashboard' ) }
className="edit-site-layout__view-mode-toggle"
style={ {
transform: 'scale(0.5)',
transform: 'scale(0.5333) translateX(-4px)', // Offset to position the icon 12px from viewport edge
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is the trouble you're referring to. It's a curious number. How does the math work out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. The icon/button is 60x60 in the editor and gets scaled down when you exit the editor. The 0.5 scale transform results in a 30x30 icon, which doesn't align with standard button sizes and creates awkward alignments. Transforming by 0.5333 creates a 32px icon which is easier to align with other elements.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense. I wonder if this needs to be in a comment?

borderRadius: 4,
} }
>
Expand Down Expand Up @@ -99,7 +99,7 @@ const SiteHub = memo(
className="edit-site-site-hub__actions"
>
<Button
__next40pxDefaultSize
size="compact"
className="edit-site-site-hub_toggle-command-center"
icon={ search }
onClick={ () => openCommandCenter() }
Expand Down
4 changes: 4 additions & 0 deletions packages/edit-site/src/components/site-hub/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
justify-content: space-between;
gap: $grid-unit-10;
margin-right: $grid-unit-15;
height: $grid-unit-70;
}

.edit-site-site-hub__actions {
Expand All @@ -29,6 +30,9 @@
overflow: hidden;
// Add space for the ↗ to render.
padding-right: $grid-unit-20;

// Create 12px gap between site icon and site title
margin-left: - $grid-unit-05;
position: relative;
text-decoration: none;
text-overflow: ellipsis;
Expand Down
Loading