2024-05-21 11:04:04 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/* Remove default CSS variables that come with Wordpress
|
|
|
|
https://github.com/WordPress/gutenberg/issues/56180#issuecomment-1819222376
|
|
|
|
*/
|
|
|
|
function custom_wp_theme_json_default( $theme_json ) {
|
|
|
|
$new_data = array(
|
|
|
|
'version' => 2,
|
|
|
|
'settings' => array(
|
|
|
|
'color' => array(
|
|
|
|
'palette' => array(),
|
2024-05-30 08:11:24 +00:00
|
|
|
'gradients' => array(),
|
|
|
|
),
|
|
|
|
'shadow' => array(
|
|
|
|
'presets' => array(),
|
|
|
|
),
|
|
|
|
'typography' => array(
|
|
|
|
'fontSizes' => array(),
|
|
|
|
),
|
|
|
|
'dimensions' => array(
|
|
|
|
'aspectRatios' => array(),
|
|
|
|
),
|
|
|
|
'spacing' => array(
|
|
|
|
'spacingScale' => array(
|
|
|
|
'steps' => 0,
|
|
|
|
),
|
|
|
|
),
|
2024-05-21 11:04:04 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
return $theme_json->update_with( $new_data );
|
|
|
|
}
|
|
|
|
add_filter( 'wp_theme_json_data_default', 'custom_wp_theme_json_default' );
|
2024-05-30 10:08:59 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}'
|
|
|
|
)
|
2024-05-30 10:12:14 +00:00
|
|
|
);
|
|
|
|
register_block_style(
|
|
|
|
'core/paragraph',
|
|
|
|
array(
|
|
|
|
'name' => 'gradient',
|
|
|
|
'label' => __( 'Gradient', 'jett' ),
|
|
|
|
'inline_style' => '
|
|
|
|
p.is-style-gradient {
|
|
|
|
background: var(--wp--preset--gradient--violet-to-green);
|
|
|
|
-webkit-background-clip: text;
|
|
|
|
-webkit-text-fill-color: transparent;
|
|
|
|
line-height: 1.1;
|
|
|
|
}'
|
|
|
|
)
|
|
|
|
);
|
2024-05-30 10:08:59 +00:00
|
|
|
}
|
|
|
|
add_action( 'init', 'jett_block_styles' );
|