From 2531718ced023dcf652d1f7a438222928e960a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Fri, 14 May 2021 14:49:33 +0300 Subject: [PATCH] Nav block: remove list markup --- packages/block-library/src/home-link/edit.js | 4 ++-- packages/block-library/src/home-link/index.php | 4 ++-- .../block-library/src/navigation-link/edit.js | 6 +++--- .../block-library/src/navigation-link/index.php | 6 +++--- .../block-library/src/navigation/editor.scss | 11 ----------- packages/block-library/src/navigation/index.php | 4 ++-- .../block-library/src/navigation/style.scss | 17 ++--------------- packages/block-library/src/page-list/index.php | 8 ++++---- 8 files changed, 18 insertions(+), 42 deletions(-) diff --git a/packages/block-library/src/home-link/edit.js b/packages/block-library/src/home-link/edit.js index 85571c518c8621..464ccf18d144eb 100644 --- a/packages/block-library/src/home-link/edit.js +++ b/packages/block-library/src/home-link/edit.js @@ -56,7 +56,7 @@ export default function HomeEdit( { return ( <> -
  • +
    -
  • + ); } diff --git a/packages/block-library/src/home-link/index.php b/packages/block-library/src/home-link/index.php index eafd27461c0972..98807b0f56bf37 100644 --- a/packages/block-library/src/home-link/index.php +++ b/packages/block-library/src/home-link/index.php @@ -127,7 +127,7 @@ function render_block_core_home_link( $attributes, $content, $block ) { $wrapper_attributes = block_core_home_link_build_li_wrapper_attributes( $block->context ); - $html = '
  • -
  • +
    { /* eslint-disable jsx-a11y/anchor-is-valid */ } { /* eslint-enable */ } @@ -611,8 +611,8 @@ export default function NavigationLinkEdit( { ) } - ', + '', $inner_blocks_html ); } - $html .= '
  • '; + $html .= ''; return $html; } diff --git a/packages/block-library/src/navigation/editor.scss b/packages/block-library/src/navigation/editor.scss index c761af9f0cc04c..a50730478d724a 100644 --- a/packages/block-library/src/navigation/editor.scss +++ b/packages/block-library/src/navigation/editor.scss @@ -2,17 +2,6 @@ * Editor only CSS. */ -// Undo default editor styles. -// These need extra specificity. -.editor-styles-wrapper .wp-block-navigation { - ul { - margin-top: 0; - margin-bottom: 0; - margin-left: 0; - padding-left: 0; - } -} - /** * Submenus. diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index 0dff15eeaa1978..37e87f5b69170e 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -166,7 +166,7 @@ function render_block_core_navigation( $attributes, $content, $block ) { // return early if they don't. if ( ! isset( $attributes['isResponsive'] ) || false === $attributes['isResponsive'] ) { return sprintf( - '', + '', $wrapper_attributes, $inner_blocks_html ); @@ -179,7 +179,7 @@ function render_block_core_navigation( $attributes, $content, $block ) { diff --git a/packages/block-library/src/navigation/style.scss b/packages/block-library/src/navigation/style.scss index 0dd657fed37123..5371420a528dc9 100644 --- a/packages/block-library/src/navigation/style.scss +++ b/packages/block-library/src/navigation/style.scss @@ -5,14 +5,6 @@ // Page List block inside your navigation block. .wp-block-navigation { position: relative; - // Normalize list styles. - ul, - ul li { - list-style: none; - - // Overrides generic ".entry-content li" styles on the front end. - padding: 0; - } // Menu item container. .wp-block-pages-list__item, @@ -299,11 +291,6 @@ // Vertically center child blocks, like Social Links or Search. align-items: center; - // Reset the default list styles - list-style: none; - margin: 0; - padding-left: 0; - // Only hide the menu by default if responsiveness is active. .is-responsive { display: none; @@ -338,11 +325,11 @@ } // Vertical justification. -.is-vertical.items-justified-center > ul { +.is-vertical.items-justified-center > div { align-items: center; } -.is-vertical.items-justified-right > ul { +.is-vertical.items-justified-right > div { align-items: flex-end; .wp-block-navigation-link, diff --git a/packages/block-library/src/page-list/index.php b/packages/block-library/src/page-list/index.php index a0cadde487d571..5acbb5603c4ea5 100644 --- a/packages/block-library/src/page-list/index.php +++ b/packages/block-library/src/page-list/index.php @@ -102,16 +102,16 @@ function render_nested_page_list( $nested_pages ) { if ( isset( $page['children'] ) ) { $css_class .= ' has-child'; } - $markup .= '
  • '; + $markup .= '
    '; $markup .= '' . wp_kses( $page['title'], wp_kses_allowed_html( 'post' ) ) . ''; if ( isset( $page['children'] ) ) { $markup .= ''; - $markup .= ''; + $markup .= ''; } - $markup .= '
  • '; + $markup .= ''; } return $markup; } @@ -182,7 +182,7 @@ function render_block_core_page_list( $attributes, $content, $block ) { $nested_pages = nest_pages( $top_level_pages, $pages_with_children ); - $wrapper_markup = ''; + $wrapper_markup = '
    %2$s
    '; $items_markup = render_nested_page_list( $nested_pages );