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

Remove padding from Home Link block #33461

Merged
merged 1 commit into from Jul 16, 2021
Merged

Remove padding from Home Link block #33461

merged 1 commit into from Jul 16, 2021

Conversation

ndiego
Copy link
Member

@ndiego ndiego commented Jul 15, 2021

Description

No other link block in core includes padding, yet the Home Link block does. This forces theme developers to override this padding to ensure link consistency. Removing this default padding will improve implementation of the Navigation block. The current workaround it to use a Custom Link that manually directs to the site's homepage.

How has this been tested?

Removing the offending CSS simply makes the Home Link block look like all other link blocks in the Navigation block.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

No other link block in core includes padding, yet the Home Link block does. This forces theme developers to override this padding to ensure link consistency. Removing this default padding will improve implementation of the Navigation block. The current workaround it to use a Custom Link that manually directs to the site's homepage.
@ndiego ndiego requested a review from ajitbohra as a code owner July 15, 2021 14:02
Copy link
Contributor

@gwwar gwwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, this test well for me. I think styles here diverged from navigation link and the navigation block, but

.wp-block-navigation:where(.has-background) a {
padding: 0.5em 1em;
}
should cover this.

cc @jasmussen

@gwwar
Copy link
Contributor

gwwar commented Jul 16, 2021

Here's a video of that padding in action when a background color is set

background-padding.mp4

@gwwar gwwar merged commit e7df86e into WordPress:trunk Jul 16, 2021
@gwwar
Copy link
Contributor

gwwar commented Jul 16, 2021

Thanks for this one @ndiego !

@github-actions github-actions bot added this to the Gutenberg 11.2 milestone Jul 16, 2021
@gwwar gwwar modified the milestones: Gutenberg 11.2, Gutenberg 11.1 Jul 19, 2021
@gwwar gwwar mentioned this pull request Jul 19, 2021
13 tasks
gwwar pushed a commit that referenced this pull request Jul 19, 2021
No other link block in core includes padding, yet the Home Link block does. This forces theme developers to override this padding to ensure link consistency. Removing this default padding will improve implementation of the Navigation block. The current workaround it to use a Custom Link that manually directs to the site's homepage.
@jasmussen
Copy link
Contributor

Thanks for the PR, thanks for the ping! This specific problem speaks also to both issues #31879 and #33048, as both of those are about enabling global style control. #31878 hopefully also helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants