Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile: replace color palette table with div #5657

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/wp-admin/css/forms.css
Original file line number Diff line number Diff line change
Expand Up @@ -921,11 +921,14 @@ table.form-table td .updated p {
}

.color-palette {
display: table;
width: 100%;
border-spacing: 0;
border-collapse: collapse;
}
.color-palette .color-palette-shade,
.color-palette td {
display: table-cell;
height: 20px;
padding: 0;
border: none;
Expand Down Expand Up @@ -1589,12 +1592,15 @@ table.form-table td .updated p {
margin-bottom: 0;
}

.form-table .color-palette .color-palette-shade,
.form-table .color-palette td {
display: table-cell;
width: 15px;
height: 30px;
padding: 0;
}

.form-table table.color-palette {
.form-table .color-palette {
margin-right: 10px;
}

Expand Down
18 changes: 8 additions & 10 deletions src/wp-admin/includes/misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1038,17 +1038,15 @@ function admin_color_scheme_picker( $user_id ) {
<input type="hidden" class="css_url" value="<?php echo esc_url( $color_info->url ); ?>" />
<input type="hidden" class="icon_colors" value="<?php echo esc_attr( wp_json_encode( array( 'icons' => $color_info->icon_colors ) ) ); ?>" />
<label for="admin_color_<?php echo esc_attr( $color ); ?>"><?php echo esc_html( $color_info->name ); ?></label>
<table class="color-palette">
<tr>
<?php
foreach ( $color_info->colors as $html_color ) {
?>
<td style="background-color: <?php echo esc_attr( $html_color ); ?>">&nbsp;</td>
<?php
}
<div class="color-palette">
<?php
foreach ( $color_info->colors as $html_color ) {
?>
</tr>
</table>
<div class="color-palette-shade" style="background-color: <?php echo esc_attr( $html_color ); ?>">&nbsp;</div>
<?php
}
?>
</div>
</div>
<?php

Expand Down