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

Appearance > Design in classic themes: admin-bar class name in the Site Editor breaks designs #68511

Closed
3 of 6 tasks
carolinan opened this issue Jan 7, 2025 · 1 comment · Fixed by #68519
Closed
3 of 6 tasks
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

Description

When a classic theme is previewed under Appearance > Design, the admin-bar class name is not removed from the body even though the admin bar is not visible inside the Site Editor iframe.

This may break themes that use this CSS class name.
For example, Twenty-Fourteen uses the following CSS to move the sticky header when the admin bar is visible:

@media screen and (min-width: 783px) {
    .admin-bar.masthead-fixed .site-header {
        top: 32px;
    }
}

In the preview, the theme's header is pushed down and the content is displayed above the header when scrolling:

Step-by-step reproduction instructions

Activate Gutenberg
Activate Twenty Fourteen
Go to Appearance > Design

Screenshots, screen recording, code snippet

appearance-design-twentyfourteen.mp4

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@carolinan carolinan added the [Type] Bug An existing feature does not function as intended label Jan 7, 2025
@carolinan carolinan changed the title Stylebook in classic themes: admin-bar class name in the Site Editor breaks designs Design > Styles in classic themes: admin-bar class name in the Site Editor breaks designs Jan 7, 2025
@carolinan carolinan changed the title Design > Styles in classic themes: admin-bar class name in the Site Editor breaks designs Appearance > Design in classic themes: admin-bar class name in the Site Editor breaks designs Jan 7, 2025
@himanshupathak95
Copy link
Contributor

himanshupathak95 commented Jan 7, 2025

Thanks @carolinan for pointing this out.

I was able to observe a similar behavior, the admin-bar class applied to the body is messing up the styles -

Image

When removed, the layout looks correct and better -

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants