Skip to content
New issue

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

add ability to show drop cap setting in paragraph block by default #45994

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/block-library/src/paragraph/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
useBlockProps,
useSetting,
} from '@wordpress/block-editor';
import { createBlock } from '@wordpress/blocks';
import { createBlock, getBlockSupport } from '@wordpress/blocks';
import { formatLtr } from '@wordpress/icons';

/**
Expand Down Expand Up @@ -77,6 +77,11 @@ function ParagraphBlock( {
helpText = __( 'Toggle to show a large initial letter.' );
}

const defaultTypographyControls = getBlockSupport( name, [
'typography',
'__experimentalDefaultControls',
] );

return (
<>
<BlockControls group="block">
Expand Down Expand Up @@ -106,6 +111,7 @@ function ParagraphBlock( {
onDeselect={ () =>
setAttributes( { dropCap: undefined } )
}
isShownByDefault={ defaultTypographyControls?.dropCap }
resetAllFilter={ () => ( { dropCap: undefined } ) }
panelId={ clientId }
>
Expand Down
Loading