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

Block Editor: Allow a theme to override settings per block for editor features #22657

Closed
gziolo opened this issue May 27, 2020 · 2 comments · Fixed by #24416
Closed

Block Editor: Allow a theme to override settings per block for editor features #22657

gziolo opened this issue May 27, 2020 · 2 comments · Fixed by #24416
Assignees
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] New API New API to be used by plugin developers or package users.

Comments

@gziolo
Copy link
Member

gziolo commented May 27, 2020

Description

Related to #22622.

Follow up for #22291 where initial handling for block editor features were introduced.

Usage:

// edit.js

const Edit = ( props ) => {
    const isDisabled = ! useEditorFeature( 'typography.dropCap' );
    // ...
};

Based on that idea, it included block level overrides for features using the following definition of the block:

registerBlockType( 'my/block', {
    supports: {
        __experimentalFeatures: {
            typography: {
                dropCap: true,
            }
        },
    },
    // ... everything else
} );

The idea is to take it to the next level – a theme should be able to disable any editor feature for the selected block using experimental-theme.json config file specific for the theme.

The full proposal from @nosolosw in #22291 (review).

@gziolo gziolo added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Package] Block editor /packages/block-editor [Type] New API New API to be used by plugin developers or package users. labels May 27, 2020
@youknowriad
Copy link
Contributor

how is this different from #22655

@gziolo
Copy link
Member Author

gziolo commented Jun 19, 2020

We can consolidate into one if your prefer. The difference is that:

@gziolo gziolo changed the title Block Editor: Allow a theme to override block settings for editor features Block Editor: Allow a theme to override settings per block for editor features Jul 9, 2020
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] New API New API to be used by plugin developers or package users.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants