Skip to content

Commit

Permalink
Try: Remove color inheritance specificity. (#35725)
Browse files Browse the repository at this point in the history
* Try: Remove color inheritance specificity.

* Try to target class instead of element.
  • Loading branch information
jasmussen committed Oct 19, 2021
1 parent 5562482 commit 5593e1b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions packages/block-library/src/navigation/style.scss
Expand Up @@ -41,12 +41,14 @@
}

// Menu item link.
// By targetting the markup directly we enable greater global styles compatibility.
// The extra container specificity is due to global styles outputting link styles that need overriding.
&.wp-block-navigation a {
// Inherit colors set by the block color definition.
// By adding low specificity, we enable compatibility with link colors set in theme.json,
// but still allow them to be overridden by user-set colors.
.wp-block-navigation-item__content {
color: inherit;
display: block;

// Set the default menu item padding to zero, to allow text-only buttons.
padding: 0;
}

// Force links to inherit text decoration applied to navigation block.
Expand Down Expand Up @@ -252,11 +254,6 @@
// That way if padding is set in theme.json, it still wins.
// https://css-tricks.com/almanac/selectors/w/where/

// Set the default menu item padding to zero, to allow text-only buttons.
.wp-block-navigation .wp-block-navigation-item__content {
padding: 0;
}

// When the menu has a background, items have paddings, reduce margins to compensate.
// Treat margins and paddings differently when the block has a background.
.wp-block-navigation:where(.has-background) a {
Expand Down

0 comments on commit 5593e1b

Please sign in to comment.