Make WordPress Core

Opened 11 months ago

Last modified 4 weeks ago

#50249 new defect (bug)

color-picker dashicon not showing

Reported by: Lwangaman Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.4.1
Component: Editor Keywords:
Focuses: ui Cc:


When creating a PanelBody in the InspectorControls for Gutenberg block, and using 'color-picker' from Dashicons, no icon is rendered. Other dashicons are working, but 'color-picker' is not.

Sample code:

createElement(PanelBody, { title: __('Border color','textdomain'), initialOpen: false, icon: 'color-picker' },
        createElement(ColorPicker, {
                color: attributes.PARAGRAPHSTYLES_BORDERCOLOR,
                disableAlpha: false,
                onChangeComplete: changeParagraphStyleBorderColor

Change History (3)

#2 @Lwangaman
11 months ago

Using the 'color-picker' icon in an html element using css classes works fine:

<h2 class="dashicons-before dashicons-color-picker">A Colorful Headline</h2>
<h2><span class="dashicons dashicons-color-picker"></span> A Colorful Headline</h2>

It is only when using the string 'color-picker' to indicate the icon when creating a Gutenberg PanelBody that the icon is not shown:

createElement(PanelBody, { title: __('Background color','textdomain'), initialOpen: false, icon: 'color-picker' }

Icon not shown. Other icons work fine:

createElement(PanelBody, { title: __('Layout options','textdomain'), initialOpen: false, icon: 'admin-appearance' }
Last edited 11 months ago by Lwangaman (previous) (diff)

#3 @sabernhardt
4 weeks ago

  • Component changed from Administration to Editor
  • Keywords reporter-feedback removed
Note: See TracTickets for help on using tickets.