Open fabiankaegy opened 1 year ago
@fabiankaegy Hii, I was looking through your code and I am interested in contributing. I have a basic understanding of js but I have no prior knowledge of php so I am unable to understand the entire codebase . Please help me out here
For static blocks we can use the
registerBlockExtension
to easily add additional classnames. Technically it also works for adding inline styles but we should use that sparingly because it may introduce block validation issues and deprecations.Another issue is that the block extensions only apply to static blocks. When the rendering happens on the server in PHP it doesn't do anything.
To solve for all these usecases we can use the
HTMLTagProcessor
and the block render callbacks.Here is a quick example for adding an animation extension:
JS that deals with the editor:
PHP to register the additional attribute for all blocks
PHP to add the actual output to the block on the server: