-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.[Package] Block editor/packages/block-editor/packages/block-editor[Package] Components/packages/components/packages/components[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Description
As originally discussed in #17169 (comment) and with work continue #17603 .
In #17169 gradient presents were added to buttons. This function similar to the present colors already found in gutenberg. The present colours allow for register of list of colours in PHP using theme supports. Example.
add_theme_support( 'editor-color-palette',
array(
array(
'name' => __( 'Primary', 'twentynineteen' ),
'slug' => 'primary',
'color' => twentynineteen_hsl_hex( 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod( 'primary_color_hue', 199 ), 100, 33 ),
),
array(
'name' => __( 'Secondary', 'twentynineteen' ),
'slug' => 'secondary',
'color' => twentynineteen_hsl_hex( 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod( 'primary_color_hue', 199 ), 100, 23 ),
),
array(
'name' => __( 'Dark Gray', 'twentynineteen' ),
'slug' => 'dark-gray',
'color' => '#111',
),
array(
'name' => __( 'Light Gray', 'twentynineteen' ),
'slug' => 'light-gray',
'color' => '#767676',
),
array(
'name' => __( 'White', 'twentynineteen' ),
'slug' => 'white',
'color' => '#FFF',
),
)
);
A similar api should be added for gradient presents. I would recommend the name editor-gradient-presets
.
Metadata
Metadata
Assignees
Labels
[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.[Package] Block editor/packages/block-editor/packages/block-editor[Package] Components/packages/components/packages/components[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.A suggestion for improvement.