From 72af3dd022b4b21ea7bcbb082267510371b1b4a5 Mon Sep 17 00:00:00 2001 From: Aadil Ayub Date: Thu, 30 May 2024 15:08:59 +0500 Subject: [PATCH] add gradient heading style --- functions.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/functions.php b/functions.php index 43b308b..20fac48 100644 --- a/functions.php +++ b/functions.php @@ -30,3 +30,21 @@ function custom_wp_theme_json_default( $theme_json ) { return $theme_json->update_with( $new_data ); } add_filter( 'wp_theme_json_data_default', 'custom_wp_theme_json_default' ); + +function jett_block_styles() { + register_block_style( + 'core/heading', + array( + 'name' => 'gradient', + 'label' => __( 'Gradient', 'jett' ), + 'inline_style' => ' + .wp-block-heading.is-style-gradient { + background: var(--wp--preset--gradient--violet-to-green); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + line-height: 1.1; + }' + ) + ); +} +add_action( 'init', 'jett_block_styles' );