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

Block navigation items distorted #3598

Closed
swissspidy opened this issue Oct 22, 2019 · 5 comments
Closed

Block navigation items distorted #3598

swissspidy opened this issue Oct 22, 2019 · 5 comments
Labels
Bug Something isn't working Integration: Gutenberg
Milestone

Comments

@swissspidy
Copy link
Collaborator

swissspidy commented Oct 22, 2019

Bug Description

Items are currently not aligned in the block navigation, probably due to some change in upstream Gutenberg CSS.

Expected Behaviour

All items in the block navigation should be full width. Upstream CSS changes should ideally not affect our custom block navigation.

Steps to reproduce

  1. Create a new page.
  2. Add a text block
  3. Add a CTA block
  4. Notice difference

Screenshots

Screenshot 2019-10-22 at 20 37 22

Additional context

  • WordPress version: 5.3 RC 1
  • Plugin version: develop
  • Gutenberg plugin version (if applicable): 6.7
  • AMP plugin template mode:
  • PHP version:
  • OS:
  • Browser: [e.g. chrome, safari]
  • Device: [e.g. iPhone6]

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • All items in the block navigation should be as wide as the CTA item, and not just 2/3rd wide.

Implementation brief

  • Make sure padding and margin is as intended for the block navigation list.
  • Do this.

QA testing instructions

  • Make sure you are using Gutenberg version 6.7.
  • Add a text block to a story page.
  • Add a CTA block to a story page.
  • Verify that the two block titles are aligned in the block navigator.

Demo

Changelog entry

  • Improved Gutenberg compatibility
@barklund
Copy link
Contributor

barklund commented Oct 22, 2019

The surrounding UL has gotten some extra spacing:

.editor-styles-wrapper ol,
.editor-styles-wrapper ul {
  padding: inherit;
  padding-left: 1.3em;
  margin-left: 1.3em;
}

I don't know where it comes from, it's just part of a <style> directly added to the DOM. All rules with similar defaults for .editor-styles-wrapper element.

@swissspidy swissspidy changed the title Block Block navigation items distorted Oct 22, 2019
@swissspidy
Copy link
Collaborator Author

@barklund FYI, this explains where those inline styles come from: https://developer.wordpress.org/block-editor/developers/themes/theme-support/#editor-styles

Although I thought we are removing any theme styles from the stories editor 🤔
I'll try to check tomorrow where this is coming from, out of curiosity

We should be able to fix the styles by changing https://github.com/ampproject/amp-wp/blob/5e4ac3befd3ad548fc88ea27feecb23c77656b87/assets/src/stories-editor/components/block-navigation/edit.css accordingly.

@barklund
Copy link
Contributor

@swissspidy, I have done as you suggested and it seems to work.

Should we make it more idiot-proof (resetting more potential custom editor stylings from theme) or is this sufficient?

@swissspidy
Copy link
Collaborator Author

Looks like the culprit is WordPress/gutenberg#17958 and the offending CSS is defined here:

https://github.com/WordPress/gutenberg/blob/2ea41bf03762cd9874e066c5456181d168fddeaf/packages/editor/src/editor-styles.scss#L103-L120

I think your proposed fix is fine for now 👍

@csossi
Copy link

csossi commented Oct 23, 2019

Verified in QA
image

@csossi csossi removed their assignment Oct 23, 2019
@swissspidy swissspidy added this to the v1.4 milestone Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Integration: Gutenberg
Projects
None yet
Development

No branches or pull requests

3 participants