Automattic / Automattic/Iris

Allways display `label` and `description` text above color-picker button

Open
#66 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
259
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Hi there,
When I use the default `WP_Customize_Color_Control` Class the `label`and `descirption` are displayed above the color-picker, but when I use the `WP_Customize_Color_Control `Class the `label`and `description`text is shown after clicking on the color picker button, so the text is hidden.

See on the picture. The first picker is the WP_Customize_Color_Control, the rest is the WP_Customize_Color_Control Class.
![bildschirmfoto 2018-04-17 um 11 52 19](https://user-images.githubusercontent.com/17706724/38862681-d2f79534-4235-11e8-83a3-f4b62165489c.png)

The Code looks like that:
```php
add_setting( 'nav_text_color', array(
'default' => '',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_text_color', array(
'label' => esc_html__( 'Custom Style Options', 'onedrop_template' ),
'description' => esc_html__( 'Text Color', 'onedropTemplate' ),
'section' => 'header_menulayout_section',
'settings' => 'nav_text_color',
'show_opacity' => true, // Optional.
'priority' => 10
) ) );

// Background Nav Color
$wp_customize->add_setting( 'nav_background_color', array(
'default' => '',
) );
$wp_customize->add_control( new Customize_Alpha_Color_Control( $wp_customize, 'nav_background_color', array(
'description' => esc_html__( 'Background Color', 'onedropTemplate' ),
'section' => 'header_menulayout_section',
'settings' => 'nav_background_color',
'priority' => 10
) ) );
?>
```

Any Ideas? Thanks :))

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the provided WP_Customize_Color_Control and Customize_Alpha_Color_Control examples in the WordPress Customizer, comparing where each control renders its label and description. The issue is done when both texts remain visible above the color-picker button without requiring it to be clicked.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php, wordpress
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.