Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Support className and style blockProps on block wrapper #41

Merged

Conversation

ockham
Copy link
Collaborator

@ockham ockham commented Jul 4, 2022

Fixes #36.

This is the result from a pair-programming session with @luisherranz.

Use the server-side implementation of the block-supports mechanism to communicate block props as data- HTML attributes to the interactive Gutenberg block (custom element) on the frontend.

For an alternative approach we tried earlier (but that didn't work), see #36 (comment).

TODO:

  • Make sure style blockProps also work.

block-props-hydration-working

@luisherranz
Copy link
Member

I'm resolving the conflicts with my refactor on d61391c.

@luisherranz
Copy link
Member

I think everything should be fine again.

@ockham
Copy link
Collaborator Author

ockham commented Jul 25, 2022

Okay, I think I managed to figure out dynamic setting of style.

(It's pretty much like we thought it should work during our pairing. I think that we'd gotten stuck due to poor choice of values for fontWeight; turns out that those can't be > 1000, and it seems that React is smart enough to ignore any such values, instead keeping the previous one 😅 )

@ockham ockham marked this pull request as ready for review July 25, 2022 13:39
Copy link
Member

@luisherranz luisherranz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @ockham!! 🙂👏

@luisherranz luisherranz merged commit a9b4839 into main Jul 25, 2022
@luisherranz luisherranz deleted the add/block-supports-classes-and-styles-on-block-wrapper branch July 25, 2022 15:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support block support class names and inline styles on the block wrapper and make blockProps optional
2 participants