-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add the colophon block #29
base: trunk
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple passing thoughts -- some aren't really necessary, but more for code clarity and simplification. Let's remove some stock boilerplate files if we're not actually using them.
block/block.json
Outdated
"fontSize": true, | ||
"lineHeight": true, | ||
"__experimentalFontFamily": true, | ||
"__experimentalFontStyle": true, | ||
"__experimentalFontWeight": true, | ||
"__experimentalLetterSpacing": true, | ||
"__experimentalTextTransform": true, | ||
"__experimentalDefaultControls": { | ||
"fontSize": true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume these are all managed via the block attributes, which is why we don't have styles implementing them. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should keep them because it helps user to customize the styling without having to write any CSS. So, should we keep or remove them?
"editorStyle": "file:./index.css", | ||
"style": "file:./style-index.css", | ||
"render": "file:./render.php" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know block context can be used to set a block where it can only be used in a post context or the like --
https://developer.wordpress.org/block-editor/reference-guides/block-api/block-context/
Is there an option we can set so that the block is only usable in a FSE / page template context, so we're not cluttering up the block options when someone's writing a post?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocks meant for use in FSE themes are called Theme Blocks, and I think this would be the way to do it:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, even if using theme
as the category for the theme block. It is still visible in the post editor. The only option I can think of now is to remove the block programatically on the post editor. Should we go that route?
@@ -0,0 +1,3 @@ | |||
<div <?php echo wp_kses_data( get_block_wrapper_attributes() ); ?>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this wp_kses_data()
call is necessary here -- as it is designed to be sanitizing not escaping, (so focused on content not context), and doesn't seem to be used by the Gutenberg team when doing similar tasks:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use it because it is there in the example for dynamic block.
Changes proposed in this Pull Request
Testing instructions
Colophon
block.Mentions #8