WordPress.org

Making WordPress.org

Opened 11 months ago

Last modified 5 months ago

#4949 new defect

Add further Examples on Dashicons Page

Reported by: derweili Owned by:
Milestone: Priority: low
Component: Developer Hub Keywords:
Cc:

Description

The Dashicons Documentation https://developer.wordpress.org/resource/dashicons/#art shows code examples for using Dashicons in a custom post type and in HTML/CSS.

Dashicons are also used for Blocks in Gutenberg Editor and Taxonomies.

Maybe we should also add examples for these use cases.

Change History (2)

#1 @desrosj
5 months ago

Thanks for this, @derweili! These examples should definitely be added to the bottom of the page.

Pinging @joen as this will be of interest to him as well.

#2 @Joen
5 months ago

Thanks for the ticket! Dashicons are not as widely used in the block editor any more, and the preferred syntax for block icons leverages the new icon syntax. This syntax:

icon={help}

This leverages the actual markup served in that constant, rather than being the name of an icon in a sprite. That also enables custom SVGs in an easier way.

I don't think the Dashicons component bundled with the block editor is deprecated, or will be any time soon. But it's a little bit a legacy way of doing it.

Note: See TracTickets for help on using tickets.