Skip to content

Commit

Permalink
navigation: rename background color CSS class (#20018)
Browse files Browse the repository at this point in the history
  • Loading branch information
retrofox committed Feb 3, 2020
1 parent f3d8bd1 commit 1ded40d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function NavigationLinkEdit( {
'has-child': hasDescendants,
'has-text-color': rgbTextColor,
[ `has-${ textColor }-color` ]: !! textColor,
'has-background-color': rgbBackgroundColor,
'has-background': rgbBackgroundColor,
[ `has-${ backgroundColor }-background-color` ]: !! backgroundColor,
} ) }
style={ {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function Navigation( {
} = __experimentalUseColors(
[
{ name: 'textColor', property: 'color' },
{ name: 'backgroundColor', className: 'has-background-color' },
{ name: 'backgroundColor', className: 'has-background' },
],
{
contrastCheckers: [
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function build_css_colors( $attributes ) {

// If has background color.
if ( $has_custom_background_color || $has_named_background_color ) {
// Add has-background-color class.
$colors['css_classes'][] = 'has-background-color';
// Add has-background class.
$colors['css_classes'][] = 'has-background';
}

if ( $has_named_background_color ) {
Expand Down
8 changes: 4 additions & 4 deletions packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ $navigation-sub-menu-width: $grid-size * 25;
}

// No background color
&:not(.has-background-color) > .block-editor-inner-blocks,
&:not(.has-background-color) > .wp-block-navigation__container {
&:not(.has-background) > .block-editor-inner-blocks,
&:not(.has-background) > .wp-block-navigation__container {
background-color: $light-style-sub-menu-background-color;
}
}
Expand All @@ -223,8 +223,8 @@ $navigation-sub-menu-width: $grid-size * 25;
}

// No background color
&:not(.has-background-color) > .block-editor-inner-blocks,
&:not(.has-background-color) > .wp-block-navigation__container {
&:not(.has-background) > .block-editor-inner-blocks,
&:not(.has-background) > .wp-block-navigation__container {
background-color: $dark-style-sub-menu-background-color;
}
}
Expand Down

0 comments on commit 1ded40d

Please sign in to comment.