Skip to content

Instantly share code, notes, and snippets.

@gydoar
Created May 24, 2022 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gydoar/0ae0286c05f9c3910c77bfabbce404c7 to your computer and use it in GitHub Desktop.
Save gydoar/0ae0286c05f9c3910c77bfabbce404c7 to your computer and use it in GitHub Desktop.
<?php
/**
* Theme support Blocks
* @link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/
*/
function andres_gutenberg_default_colors()
{
// Color Palette Support
add_theme_support(
'editor-color-palette',
array(
array(
'name' => 'White',
'slug' => 'white',
'color' => '#ffffff'
),
array(
'name' => 'Black',
'slug' => 'black',
'color' => '#000000'
), array(
'name' => 'Pink',
'slug' => 'pink',
'color' => '#ff4444'
)
)
);
// Font Size Support
add_theme_support(
'editor-font-sizes',
array(
array(
'name' => 'Normal',
'slug' => 'normal',
'size' => '1rem'
),
array(
'name' => 'Medium',
'slug' => 'medium',
'size' => '1.5rem'
),
array(
'name' => 'Large',
'slug' => 'large',
'size' => '2rem'
),
array(
'name' => 'Extra Large',
'slug' => 'extra-large',
'size' => '2.5rem'
)
)
);
// Gradiente Color Support
add_theme_support(
'editor-gradient-presets',
array(
array(
'name' => esc_attr__('Vivid cyan blue to vivid purple', 'themeLangDomain'),
'gradient' => 'linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)',
'slug' => 'vivid-cyan-blue-to-vivid-purple'
)
)
);
}
add_action('init', 'andres_gutenberg_default_colors');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment