Make WordPress Core

Changeset 40471


Ignore:
Timestamp:
04/18/2017 12:30:07 AM (7 years ago)
Author:
westonruter
Message:

Customize: Use fixed-width illustrative placeholder for hex field in color picker to prevent truncation.

Props stormrockwell, sagarprajapati, Presskopp, afercia, tejas5989, westonruter, mayurk for testing.
Fixes #39096.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r38931 r40471  
    135135        0 0 2px 1px rgba(30, 140, 190, .8);
    136136}
     137
     138@media screen and ( max-width: 782px ) {
     139    .wp-picker-container input[type="text"].wp-color-picker {
     140        margin-right: 6px;
     141        padding: 3px 5px;
     142    }
     143}
  • trunk/src/wp-includes/customize/class-wp-customize-color-control.php

    r39345 r40471  
    9393    public function content_template() {
    9494        ?>
    95         <# var defaultValue = '',
     95        <# var defaultValue = '#RRGGBB', defaultValueAttr = '',
    9696            isHueSlider = data.mode === 'hue';
    9797
     
    102102                defaultValue = data.defaultValue;
    103103            }
    104             defaultValue = ' data-default-color=' + defaultValue; // Quotes added automatically.
     104            defaultValueAttr = ' data-default-color=' + defaultValue; // Quotes added automatically.
    105105        } #>
    106106        <label>
     
    115115                    <input class="color-picker-hue" type="text" data-type="hue" />
    116116                <# } else { #>
    117                     <input class="color-picker-hex" type="text" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value' ); ?>" {{ defaultValue }} />
     117                    <input class="color-picker-hex" type="text" maxlength="7" placeholder="{{ defaultValue }}" {{ defaultValueAttr }} />
    118118                <# } #>
    119119            </div>
Note: See TracChangeset for help on using the changeset viewer.