Skip to content

TT3 Style Variations show a scrollbar for one variation #44515

Closed

Description

@annezazu

Description

When using 6.1 beta 2 with the new TT3 theme, one of the style variations shows a scrollbar in chrome. FYI @ndiego .

Step-by-step reproduction instructions

  1. Use beta 2 for 6.1
  2. Activate TT3
  3. Open Site Editor
  4. Open Styles
  5. Notice whisper variation has a scrollbar

Screenshots, screen recording, code snippet

Screen Shot 2022-09-27 at 2 00 25 PM

Environment info

  • WordPress 6.1 beta 2
  • TT3
  • Chrome

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

  1. added
    [Type] Bug
    [Feature] Theme Style Variations
    on Sep 27, 2022
  2. ndiego commented on Sep 27, 2022

    @ndiego
    Member

    Yes I can confirm. The reason is that variation has a site border, which is reflected in the Global Styles preview.

    image

    image

  3. added
    Needs Design Feedback
    on Sep 28, 2022
  4. talldan commented on Sep 28, 2022

    @talldan
    Contributor

    I think a developer may need design feedback on the right way to fix this, so I've added the label.

    Should the preview show the variation's border? I suppose that's possible but it might be difficult to account for any border and still fit the contents of the preview neatly in the rectangle.

    Possibly a better option would for the border not to be shown, the preview iframe could have a reset for any border (as well as margin if that isn't already in place).

  5. ndiego commented on Sep 28, 2022

    @ndiego
    Member

    Possibly a better option would for the border not to be shown, the preview iframe could have a reset for any border (as well as margin if that isn't already in place).

    Yeah I agree with this approach. Likely the easiest to implement and the best way to ensure consistency in the variation previews.

  6. t-hamano commented on Sep 28, 2022

    @t-hamano
    Contributor

    I was just investigating this issue as well, and I think useResizeObserver is not getting a width that takes borders into account.

    <Iframe
    className="edit-site-global-styles-preview__iframe"
    head={ <EditorStyles styles={ editorStyles } /> }
    style={ {
    height: normalizedHeight * ratio,
    visibility: ! width ? 'hidden' : 'visible',
    } }
    onMouseEnter={ () => setIsHovered( true ) }
    onMouseLeave={ () => setIsHovered( false ) }
    tabIndex={ -1 }
    >
    { containerResizeListener }

    I also agree with not displaying borders in the preview, as a very thick border would squash the preview area.

  7. added
    [Status] In Progress
    on Sep 29, 2022
  8. moved this from Triage to In Progress in WordPress 6.1 Editor Taskson Sep 29, 2022
  9. Repository owner moved this from In Progress to Done in WordPress 6.1 Editor Taskson Sep 29, 2022
  10. removed
    [Status] In Progress
    on Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Needs Design Feedback[Feature] Theme Style Variations[Type] Bug

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions