Skip to content

Update alignment of template label on FSE#45683

Closed
bangank36 wants to merge 3 commits intoWordPress:trunkfrom
bangank36:fix/centering-fse-title
Closed

Update alignment of template label on FSE#45683
bangank36 wants to merge 3 commits intoWordPress:trunkfrom
bangank36:fix/centering-fse-title

Conversation

@bangank36
Copy link
Contributor

@bangank36 bangank36 commented Nov 9, 2022

What?

Centering the template label in top bar of FSE

Why?

Originated from this issue: #29673
Fixes #29673

How?

  1. Set flex: 1 to the edit-site-header-edit-mode__start and edit-site-header-edit-mode__end, making them grow equally to fill the remaining space left by edit-site-header-edit-mode__center
  2. Thus, the label will tend to be centered.

Testing Instructions

  • Open FSE
  • Edit a template
  • Confirm that the template label on the top bar is centered aligned

Screenshots or screencast

image

@codesandbox
Copy link

codesandbox bot commented Nov 9, 2022

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Nov 9, 2022
@github-actions
Copy link

github-actions bot commented Nov 9, 2022

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @bangank36! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@bangank36 bangank36 changed the title Update space of center item Update alignment of template label on FSE Nov 9, 2022
@glendaviesnz
Copy link
Contributor

Thanks @bangank36. For me it is still showing as slightly more aligned to the left:

centre2.mp4

@glendaviesnz
Copy link
Contributor

For me it is still showing as slightly more aligned to the left

have discussed this with @scruffian, and this may be worth overlooking for the flexibility this approach gives.

@bangank36
Copy link
Contributor Author

For me it is still showing as slightly more aligned to the left

have discussed this with @scruffian, and this may be worth overlooking for the flexibility this approach gives.

I think the left mis-alignment can be solved in follow-up PR, as it may be caused by the children of the center item 

Screenshot on 2022-11-09 at 16-53-03.png

@jameskoster
Copy link
Contributor

Just leaving a note to clarify the title isn't correctly aligned:

Screenshot 2022-11-10 at 12 15 45

Copy link
Member

@mikachan mikachan left a comment

Choose a reason for hiding this comment

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

With this PR, the title looks less-centered to me compared to what we currently have on trunk. The title moves further to the right with these changes.

I believe this is because the width of the WordPress logo isn't taken into account (60px) in the overall width of the flex container. In order to do this we can apply set widths to the left and right columns, which I have attempted here: #45682

@jameskoster
Copy link
Contributor

Oh yes, good spot. Maybe we should just offset the title position by 60px?

@bangank36
Copy link
Contributor Author

Just leaving a note to clarify the title isn't correctly aligned:

I think you are right, this PR did not include the logo width in account as @mikachan mentioned WordPress logo isn't taken into account (60px), can we fix it like take the logo width into account?

Oh yes, good spot. Maybe we should just offset the title position by 60px?

@mikachan
Copy link
Member

Maybe we should just offset the title position by 60px?

Yeah! Looks like setting margin-left: -60px; on .edit-site-header-edit-mode__center works well at all resolutions ✨

@scruffian
Copy link
Contributor

It would be nice if the 60px was in a variable for future proofing.

@mikachan
Copy link
Member

I've gone ahead and offset the center column by the width of the WordPress logo. I've also added a variable for the logo width. I think this is working well, it's ready for another review!

@annezazu annezazu added [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") and removed [Feature] Full Site Editing labels Jul 24, 2023
@bangank36 bangank36 closed this Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Full Site Editing: Template label in top bar is not correctly centrally aligned

6 participants