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

Gutenberg: Binding G2 Component controls to Block Editor Hook #150

Open
ItsJonQ opened this issue Nov 19, 2020 · 0 comments
Open

Gutenberg: Binding G2 Component controls to Block Editor Hook #150

ItsJonQ opened this issue Nov 19, 2020 · 0 comments

Comments

@ItsJonQ
Copy link
Owner

ItsJonQ commented Nov 19, 2020

(This is something we'll need for Phase 3: Build)

It would be great to refine how the controls are rigged up with Gutenberg via the block-editor/hooks system.

At the moment, the process is very tedious, verbose, and finicky.
https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/hooks/typography.js


Some things to think about.

  • Any typography attribute (e.g. lineHeight) can be enabled/disabled via the theme.json.
  • The TypographyPanel can only show if at least one of the typography attributes is enabled.
  • Style attribute data is accessed/updated in the attributes.styles object
  • attribute.styles data is stored as unique keys
  • These keys have to be translated so the style rendering mechanism can work with it (currently PHP, I believe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant