Skip to content

Commit

Permalink
Try fix for nav submenu broken styles.
Browse files Browse the repository at this point in the history
See: #9
  • Loading branch information
justintadlock committed May 11, 2024
1 parent 27f4897 commit 82330c8
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 59 deletions.
128 changes: 79 additions & 49 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/css/blocks/core/navigation-submenu.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '92da88d02afa523cfe25');
<?php return array('dependencies' => array(), 'version' => '8a7da49046cc1e353945');
2 changes: 1 addition & 1 deletion public/css/blocks/core/navigation-submenu.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions resources/scss/blocks/core/navigation-submenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@
/// @link https://github.com/x3p0-dev/x3p0-ideas
////

// -----------------------------------------------------------------------------
// Block customizations.
// -----------------------------------------------------------------------------

///
/// Gutenberg 18.1 broke `theme.json`-based styles for nav sub-menus by reducing
/// specificity of global style rules. Therefore, we needed to move some CSS to
/// custom presets.
///
/// @link https://github.com/x3p0-dev/x3p0-ideas/issues/9
/// @link https://github.com/WordPress/gutenberg/pull/60106
/// @link https://github.com/WordPress/gutenberg/pull/59457
///
.wp-block-navigation-submenu .wp-block-navigation__submenu-container {
padding: var(--wp--custom--padding, var(--wp--preset--spacing--base));
}

nav.wp-block-navigation .wp-block-navigation-submenu .wp-block-navigation__submenu-container,
nav.wp-block-navigation.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
color: var(--wp--custom--color, var(--wp--preset--color--contrast));
background: var(--wp--custom--background, var(--wp--preset--color--base));
}


// -----------------------------------------------------------------------------
// Block customizations.
// -----------------------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions styles/chestnut-rose.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
}
}
},
"core/navigation-submenu": {
"custom": {
"color": "var:preset|color|contrast",
"background": "var:preset|color|neutral-50"
}
},
"core/post-comments-form": {
"custom": {
"commentNotes": {
Expand Down
2 changes: 2 additions & 0 deletions styles/extant.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
},
"core/navigation-submenu": {
"custom": {
"color": "var:preset|color|neutral-50",
"background": "var:preset|color|neutral-950",
"minWidth": "18rem"
}
},
Expand Down
6 changes: 6 additions & 0 deletions styles/saga.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
"borderWidth": "3px 0 0"
}
}
},
"core/navigation-submenu": {
"custom": {
"background": "var:preset|color|neutral-950",
"color": "var:preset|color|base"
}
}
},
"custom": {
Expand Down
Loading

0 comments on commit 82330c8

Please sign in to comment.