Make WordPress Core

Changeset 57572


Ignore:
Timestamp:
02/08/2024 11:29:18 PM (10 months ago)
Author:
joedolson
Message:

Users: Replace table tags for color palettes in profiles.

Replace the table element used to present color palette selection in the user profile screen with generic elements. The extra semantics of a table are at best unhelpful and have some potential to great extraneous verbosity for screen readers.

Props sabernhardt, desrosj.
Fixes #53157.

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

Legend:

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

    r57553 r57572  
    934934
    935935.color-palette {
     936    display: table;
    936937    width: 100%;
    937938    border-spacing: 0;
    938939    border-collapse: collapse;
    939940}
     941.color-palette .color-palette-shade,
    940942.color-palette td {
     943    display: table-cell;
    941944    height: 20px;
    942945    padding: 0;
     
    16021605    }
    16031606
     1607    .form-table .color-palette .color-palette-shade,
    16041608    .form-table .color-palette td {
    16051609        display: table-cell;
    16061610        width: 15px;
    1607     }
    1608 
    1609     .form-table table.color-palette {
     1611        height: 30px;
     1612        padding: 0;
     1613    }
     1614
     1615    .form-table .color-palette {
    16101616        margin-right: 10px;
    16111617    }
  • trunk/src/wp-admin/includes/misc.php

    r57289 r57572  
    10391039                <input type="hidden" class="icon_colors" value="<?php echo esc_attr( wp_json_encode( array( 'icons' => $color_info->icon_colors ) ) ); ?>" />
    10401040                <label for="admin_color_<?php echo esc_attr( $color ); ?>"><?php echo esc_html( $color_info->name ); ?></label>
    1041                 <table class="color-palette">
    1042                     <tr>
     1041                <div class="color-palette">
     1042                <?php
     1043                foreach ( $color_info->colors as $html_color ) {
     1044                    ?>
     1045                    <div class="color-palette-shade" style="background-color: <?php echo esc_attr( $html_color ); ?>">&nbsp;</div>
    10431046                    <?php
    1044                     foreach ( $color_info->colors as $html_color ) {
    1045                         ?>
    1046                         <td style="background-color: <?php echo esc_attr( $html_color ); ?>">&nbsp;</td>
    1047                         <?php
    1048                     }
    1049                     ?>
    1050                     </tr>
    1051                 </table>
     1047                }
     1048                ?>
     1049                </div>
    10521050            </div>
    10531051            <?php
Note: See TracChangeset for help on using the changeset viewer.