We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Over 20 core blocks have attributes and UI implemented for each block to control the text-align style. For example, it looks like the following.
text-align
{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "core/heading", "title": "Heading", "attributes": { "textAlign": { "type": "string" } } }
import { AlignmentControl, BlockControls, useBlockProps, } from '@wordpress/block-editor'; function Edit( { attributes, setAttributes } ) { const { textAlign } = attributes; return ( <> <BlockControls group="block"> <AlignmentControl value={ textAlign } onChange={ ( nextAlign ) => { setAttributes( { textAlign: nextAlign } ); } } /> </BlockControls> <div { ...useBlockProps() } /> </> ); }
These are all almost the same implementations and feel redundant.
In #59531, textAlign is added as block support. I believe that we can gradually migrate to this block support.
textAlign
Below is a list of blocks that provide attributes and UI to control text-aligin.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What problem does this address?
Over 20 core blocks have attributes and UI implemented for each block to control the
text-align
style. For example, it looks like the following.block.json
edit.js
These are all almost the same implementations and feel redundant.
What is your proposed solution?
In #59531,
textAlign
is added as block support. I believe that we can gradually migrate to this block support.Below is a list of blocks that provide attributes and UI to control text-aligin.
The text was updated successfully, but these errors were encountered: