Skip to content

Social Icons having top and bottom margin issue in the editor with classic themes #69098

Closed

Description

@viralsampat-multidots

Description

Hello Team,

I have checked "Social Icons" block and found that the icons contains extra "top" & "bottom" margin space into the editor side.

I have checked it into the various theme, It happens in the bundled themes from Twenty Ten to Twenty Twenty, plus other classic themes.

But, front-end it looks good. So, I think that it should be same on both(Front-end & Back-end)sides.

For better understanding, here I have attached its screenshots.

Thanks,

Step-by-step reproduction instructions

  • Type / to choose a block
  • Select Social Icons block
  • Add number of social icons and its link
  • Now, we can see the extra top & bottom margin into the icons on the editor side
  • Save the changes and publish the page.
  • View the editor side & front-end side.
  • Just see the difference

Screenshots, screen recording, code snippet

Image
Image

Environment info

  • WordPress version: WordPress 6.7.1 running
  • Theme: Twenty Nineteen
  • Browser: Google Chrome, Version 132.0.6834.160 (Official Build) (arm64)
  • Device: MacBook Air M1
  • OS: macOS 15.3 (24D60)
  • Gutenberg plugin: Version Version Version 20.2.0

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

Activity

  1. singhakanshu00 commented on Feb 7, 2025

    @singhakanshu00
    Contributor

    Hi @viralsampat-multidots

    Upon investigation, this problem occurs for the theme from Twenty Ten to Twenty Twenty due to styles coming from classic.css file

    Image

    Will raise the PR with the solution for the fix.

  2. t-hamano commented on Feb 10, 2025

    @t-hamano
    Contributor

    Thanks for the report.

    I think this is a regression caused by #64883.

    In #64883, the element to which the useBlockProps hook applies was changed from the li element to the button element. As a result, the .wp-block CSS class was applied to the button element, causing the element to have unintended default margin for the classic theme:

    html :where(.wp-block) {
    max-width: $content-width;
    // Provide every block with a default base margin. This margin provides a consistent spacing
    // between blocks in the editor.
    margin-top: $default-block-margin;
    margin-bottom: $default-block-margin;

  3. added
    [Block] SocialAffects the Social Block - used to display Social Media accounts
    on Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] SocialAffects the Social Block - used to display Social Media accounts[Status] In ProgressTracking issues with work in progress[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