Skip to content

Commit

Permalink
Enable back dropCap for paragraph (#24932)
Browse files Browse the repository at this point in the history
  • Loading branch information
nosolosw authored Aug 31, 2020
1 parent 0de26c5 commit d37120d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/experimental-default-theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
},
"features": {
"typography": {
"dropCap": false
"dropCap": true
},
"colors": {
"custom": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@ export default function useEditorFeature( featurePath ) {
const setting = useSelect(
( select ) => {
const path = `__experimentalFeatures.${ featurePath }`;
const { getSettings } = select( 'core/block-editor' );
const settings = getSettings();

// 1 - Use deprecated settings, if available.
const settings = select( 'core/block-editor' ).getSettings();
const deprecatedSettingsValue = deprecatedFlags[ featurePath ]
? deprecatedFlags[ featurePath ]( settings )
: undefined;

if ( deprecatedSettingsValue !== undefined ) {
return deprecatedSettingsValue;
}

// 2 - Use global __experimentalFeatures otherwise.
return get( settings, path );
},
[ blockName, featurePath ]
Expand Down
5 changes: 0 additions & 5 deletions packages/block-library/src/paragraph/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
},
"__experimentalFontSize": true,
"__experimentalLineHeight": true,
"__experimentalFeatures": {
"typography": {
"dropCap": true
}
},
"__experimentalSelector": "p",
"__unstablePasteTextInline": true
}
Expand Down

0 comments on commit d37120d

Please sign in to comment.