Skip to content

Social icons: Styles meant for front end disrupt the editing UI #60159

Open
@afercia

Description

Description

Splitting this out from #60032 (comment)

It appears that styles that are meant for the social links appearance on the front end actually disrupt the editing user interface on the editor. Also, it appears a theme.json styles > spacing > blockGap value does conflict with the UI in the editor, which it's something that should not happen.

Step-by-step reproduction instructions

  • Set Twenty Twenty-Four as active theme.
  • Edit a post or site, add a Navigation block.
  • Add a couple links and a Social Icons block to the Navigation.
  • The Social Icons block will show a placeholder text Click plus to add followed by a plus icon button. Screenshot:

Screenshot 2024-03-25 at 10 44 03

  • Observe there's some excessive gap between the text and the plus icon button.
  • In your browser dev tools, inspect the source and select the flex container that wraps the text Click plus to add and the plus icon: these are flex items within a flex container. Observe the container has a CSS class is-layout-flex.
  • Observe the styles applied to the flex container. One of them is the following ruleset:
:where(body .is-layout-flex) {
    gap: 1.2rem;
}
  • This ruleset appears to come from the theme.json styles > spacing > blockGap, and generated by the style engine.
  • Expected: theme's CSS to not alter the editor UI (the placeholder).
  • In the block inspector Social Icons settings, play with the Layout settings. For example. set orientation to vertical and Justify items center. Observe these settings get applied to the editor UI as well, which should not happen. Screenshot:

Screenshot 2024-03-25 at 10 43 54

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    [Block] SocialAffects the Social Block - used to display Social Media accounts[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions