Skip to content

Remove padding from Home Link block - #33461

Merged
gwwar merged 1 commit into
WordPress:trunkfrom
ndiego:patch-2
Jul 16, 2021
Merged

gwwar merged 1 commit into
WordPress:trunkfrom
ndiego:patch-2

Conversation

@ndiego

@ndiego ndiego commented Jul 15, 2021

Copy link
Copy Markdown
Member

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

@gwwar gwwar left a comment

Copy link
Copy Markdown
Contributor

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

gwwar commented Jul 16, 2021

Copy link
Copy Markdown
Contributor

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

gwwar commented Jul 16, 2021

Copy link
Copy Markdown
Contributor

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 done
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
Copy Markdown
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.

3 participants