Created
August 30, 2022 07:20
-
-
Save wpgaurav/80725644a07bd49143691e5b4597986f to your computer and use it in GitHub Desktop.
Enhance WordPress Blocks with custom styles.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php add_action('init', function() { | |
register_block_style('core/pullquote', [ | |
'name' => 'smaller', | |
'label' => __('Small', 'md'), | |
'inline_style' => '.wp-block-pullquote.is-style-smaller blockquote{font-size:18px!important}' | |
]); | |
register_block_style('core/quote', [ | |
'name' => 'minimal', | |
'label' => __('Minimal', 'md'), | |
'inline_style' => '.wp-block-quote.is-style-minimal{font-size: 18px; padding: 2em; border-left:8px solid #c0392b; box-shadow: 1px 2px 9px 0px rgb(153 153 153 / 33%); line-height:1.9em}' | |
]); | |
register_block_style('core/paragraph', [ | |
'name' => 'note', | |
'label' => __('Note', 'md'), | |
'inline_style' => '.is-style-note{background: #fff6c8; border: 2px solid #333; border-radius: 10px; padding:1em}' | |
]); | |
register_block_style('core/paragraph', [ | |
'name' => 'notice', | |
'label' => __('Notice', 'md'), | |
'inline_style' => '.is-style-notice{background-color: #fff8f0; border: 1px solid #ddd!important; border-radius: 4px; padding: 15px;}' | |
]); | |
register_block_style('core/paragraph', [ | |
'name' => 'minimal', | |
'label' => __('Minimal', 'md'), | |
'inline_style' => ', .is-style-minimal, p.is-style-minimal{font-size: 18px; padding: 2em; border-left:8px solid #c0392b; box-shadow: 1px 2px 9px 0px rgb(153 153 153 / 33%);}' | |
]); | |
}); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment