Make WordPress Core

Changeset 62097


Ignore:
Timestamp:
03/24/2026 05:56:12 AM (4 days ago)
Author:
audrasjb
Message:

Menus: Remove floats from custom links section in the Nav Menus screen.

With the new admin design, there were some issues with floating elements in the custom links section of the classic Menu screen. This changeset simplifies the CSS implementation by removing floats and wp-clearfix classes from some elements in favor of a more robust implementation based on flex positionning.

Props audrasjb, huzaifaalmesbah, shailu25, nikunj8866, joedolson, khushi1501, ozgursar.
Fixes #64692.
See #64308.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/nav-menus.css

    r61682 r62097  
    376376
    377377/* Add Menu Item Boxes */
    378 .postbox .howto input,
    379 .customlinkdiv .menu-item-textbox,
    380 .customlinkdiv .error-message {
     378.postbox .howto input {
    381379    width: 180px;
    382380    float: right;
    383 }
    384 
    385 .customlinkdiv .error-message {
    386     clear: right;
    387381}
    388382
     
    478472}
    479473
    480 .customlinkdiv label,
     474.customlinkdiv .menu-item-textbox {
     475    width: 100%;
     476}
     477
    481478.nav-menus-php .howto span {
    482479    float: left;
     
    877874}
    878875
     876.button-controls-customlinkdiv {
     877    justify-content: flex-end;
     878}
     879
    879880/* =Media Queries
    880881-------------------------------------------------------------- */
  • trunk/src/wp-admin/includes/nav-menu.php

    r61454 r62097  
    364364        <input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
    365365        <p id="menu-item-url-wrap" class="wp-clearfix">
    366             <label class="howto" for="custom-menu-item-url"><?php _e( 'URL' ); ?></label>
     366            <label for="custom-menu-item-url"><?php _e( 'URL' ); ?></label>
    367367            <input id="custom-menu-item-url" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]"
    368368                type="text"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?>
     
    373373
    374374        <p id="menu-item-name-wrap" class="wp-clearfix">
    375             <label class="howto" for="custom-menu-item-name"><?php _e( 'Link Text' ); ?></label>
     375            <label for="custom-menu-item-name"><?php _e( 'Link Text' ); ?></label>
    376376            <input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]"
    377377                type="text"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?>
     
    380380        </p>
    381381
    382         <p class="button-controls wp-clearfix">
     382        <p class="button-controls button-controls-customlinkdiv">
    383383            <span class="add-to-menu">
    384384                <input id="submit-customlinkdiv" name="add-custom-menu-item"
     
    821821        </div><!-- /.tabs-panel -->
    822822
    823         <p class="button-controls wp-clearfix" data-items-type="<?php echo esc_attr( "posttype-{$post_type_name}" ); ?>">
     823        <p class="button-controls" data-items-type="<?php echo esc_attr( "posttype-{$post_type_name}" ); ?>">
    824824            <span class="list-controls hide-if-no-js">
    825825                <input type="checkbox"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?>
     
    11161116        </div><!-- /.tabs-panel -->
    11171117
    1118         <p class="button-controls wp-clearfix" data-items-type="<?php echo esc_attr( "taxonomy-{$taxonomy_name}" ); ?>">
     1118        <p class="button-controls" data-items-type="<?php echo esc_attr( "taxonomy-{$taxonomy_name}" ); ?>">
    11191119            <span class="list-controls hide-if-no-js">
    11201120                <input type="checkbox"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?>
Note: See TracChangeset for help on using the changeset viewer.