Adding it the way you’ve suggested is not possible, and adding inline style
attributes would be bad practice.
However, what you want is possible by adding CSS classes, e.g.
array( 'core/heading', array(
'level' => 3,
'className' => 'biggerh3',
'placeholder' => 'Bigger Heading Placeholder'
) ),
Then this CSS:
.biggerh3 { font-size: 1.34em; }
Or by adding a custom block that’s naturally bigger.
Other solutions include:
CSS selectors! You could use a rule to target the first h3
, e.g.
h3:first-of-type {
font-size: 1.34em;
}
Or the 3rd h3:
h3:nth-child(3) {
font-size: 1.34em;
}
The most gutenberg method would be to use block styles, which would even let you reuse this on other blocks, or change your mind at a later date about how it should be styled without having to go back and change all your posts
Related Posts:
- Proper, exhaustive documentation for wp.editor etc
- Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks
- Add colors to existing color palette without replacing it
- Can you filter posts by meta key with the getEntitityRecords selector?
- WP Gutenberg custom block – generate theme colors from SASS and use them in the inspector and php callback
- create blocks programmtically on theme activation
- Can I customize any WordPress parent block-based theme template files by child theme like a parent classic theme?
- How to support Lazy Loading Assets in a WordPress Theme?
- WordPress Gutenberg Theme: Structure, Hierarchy and Custom Templates
- Gutenberg Reusable Block as part of WordPress Theme page
- Custom button block doesn’t work
- How to float an image in Gutenberg
- Gutenberg – editor-font-sizes in functions not working
- Can’t select my block by clicking on it
- Which file handles the block latest posts, I want to examine excerpt handling
- create-guten-block in wordpress theme?
- What VSCode extensions are there for working with block themes? [closed]
- What is the “correct” way to add hooks or similar PHP behavior to a blocktheme?
- Not able to select width of blocks inside of cover block
- How to check if a WordPress core block is active in sidebar
- gutenberg add classes to list items
- How do you replace content generated by custom fields with custom blocks in Block Editor?
- Custom Blocks as part of a theme
- How to wrap all titles generated by Gutenberg “Heading” block with tag
- How to add InnerBlock multiple times in the same block
- Moving post title down the page / Removing a block from a post
- Gutenberg theme development: how to add “headers” option under styles > colors > elements?
- Change default rel attributes for Image Block & Button Block
- How to update mark-up of a gallery block in a custom theme?
- Auto focus RichText field
- How to create nested array attribute
- Show popover with url and option to open in new window
- How to Modify WP_Includes/blocks/latest_posts.php
- How to render block editor in wp-admin custom pages programmatically
- Social-Link block not loading html on page with custom theme
- How to diagnose wp-env environment problem
- Attribute form NumberControl doesn’t update when I update page before it lose its focus
- WP Gutenberg custom block – generate theme colors from SASS and use them in the inspector and php callback
- Posts Page shows Classic Editor interface not Gutenberg
- How can I include custom Gutenberg Blocks in a theme?
- Block validation failed for `core/pullquote` after adding theme support for editor-color-palette
- Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?
- Correct way to make a custom block theme responsive
- Multiple content areas with Gutenberg – Transparent areas mid content
- Insert gutenberg blocks into template
- Template for posts of category in block theme?
- Can’t select my block by clicking on it on apiVersion – but using blockProps
- How can I use pre declared blocks in a php file?
- Is there any filter or action hook to remove layout classes from appearing in my templates?
- Full site editing templates folder vs block-templates
- How to set the margin on an innerBlock in a block variation?
- Align images to the left of the content
- Image and font support missing in editor when deploying theme remotely
- Why is my Toggle field not showing in Gutenberg?
- When trying to run build script with gutenberg (with SVG import) – Error: Plugin name should be specified
- Block to show posts from same category
- how to create a conditional content_width for a wordpress theme?
- How To Add New Option Types To Option Tree?
- Modular theme settings
- How to determine the current widget’s parent container (sidebar widget id)
- Comment form not display properly?
- How to add menu support to a theme?
- Setting up partial Right-to-Left admin interface
- Moving functionality from functions.php to classes?
- Custom nav menu is created with default pages, but not hooked to theme’s custom menu location
- How to pass code from header.php to footer.php
- Move my theme style.css into a folder
- Is it a good idea to make whole theme widgetized?
- Prevent theme from activating [duplicate]
- Inheritance of parent theme plugin files in a child theme
- Display a list of certain categories by ID
- Implementing FancyBox
- Single Page Design, Storing in Theme Options
- Child theme enqueue scripts using new functions
- Should I change text-domain of TGM library inside theme?
- Show woocommerce categories on my theme menu styling
- “Bad element for masonry: undefined” why this error us occuring? [closed]
- Scroll to position on page for category pages only — woocommerce
- Call to require(‘../../../wp-blog-header.php’) results in 404 error?
- Do I need to escape get_the_post_thumbnail function?
- Why is switching between themes breaking my child theme?
- How to disable WordPress to put P tags?
- CSS preprocessor file messed up after compiled
- Get video from the post on homepage
- WordPress Themes Directory: Template which hits the standards?
- How to change a local wordpress installation xml export file urls? and change them to what if you don’t have a live website?
- How to get URL of category of a custom post?
- Is there a plugin for versioning files in the theme (style , .js and .php files)?
- Getting post URL within custom content template
- Getting unexpected warnings from theme options code
- Different templates for each category level
- wp_nav_menu custom walker class
- Using Customizer value in an external PHP file inside a theme
- Changes to template not showing up unless ?reset=1 added to URL
- How to add drop symbol to parent nav items which have child
- Enqueue Stylesheets After Theme’s “rtl.css”
- WordPress 3.5 + Foundation 5 not working on IE9
- Using wp_enqueue_script with social media buttons?
- How can disable function wp_link_dialog()
- How to create full header but keep content narrow