-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Create Block Gutenpride Tutorial is out of Sync with Create Block Starter Template #27565
Comments
@gziolo, I would appreciate any feedback you might have on this issue. |
@jessynd, thank you for the report. I don't think we ever aligned Regarding fonts, let's figure out first what type and format of fonts we can use instead, that are both accessible and work with all browsers supported by WordPress Core. The remaining question is whether this font was added to show how to extend webpack config or because handling in |
@gziolo thanks for your feedback! I think creating a 3rd party template that works specifically for this tutorial would be a good solution. That said, since this tutorial is currently the first introduction to the create-block package in the Block Editor Handbook, I wonder whether it would be more beginner-friendly for the default create-block template to contain Regarding the |
Regarding fonts, it feels like we should consider adding native support regardless of the tutorial changes. We discussed it during the weekly Core JS chat and it's now tracked in #27581. This would greatly simplify the tutorial as well 😄 Regarding the |
The color font was picked for pride and it was a bit of fun. Yes, it doesn't work in all browsers, but the point of the tutorial is to learn how to build a block in Gutenberg, not necessarily to ship something as a plugin. With that set, the examples should adhere to or at least call out to any usability issues. So I agree, at the least, I think mentioning color contrast consideration. As far as SCSS first, that probably is best because it is intended as an introductory block. I think submitting as a PR and commenting there is probably easiest all around. Thanks for the thoughtful reply and keeping the tutorial up to date 👍 |
I added all necessary changes to close this issue in #39049. |
Describe the bug
The Create Block tutorial walks users through how to create the Gutenpride block using the create-block package starter block template (
npx @wordpress/create-block starter-block
). The tutorial takes a CSS-first approach to styling a block and provides further instruction for users wanting to integrate Sass into their block. However, the starter template does not contain the CSS files the tutorial refers to. The template is SCSS-first. This is confusing to people following the tutorial since the files the tutorial refers to, do not match the template the tutorial starts with. This inconsistency might cause people to give up on completing the tutorial.Furthermore, if the user ignores the mismatched files and continues on to complete the block using SCSS, when including the custom font's
.otf
file, webpack fails to compile the files correctly. The user has to extend thewebpack.config.js
file from@wordpress/scripts
by creating their own file in the block and adding loading rules to compile the font. The process for making the SCSS method work is explained in the edits to the original tutorial suggested here. The edits show one method to extend the webpack config in order for the custom font to work.An additional issue with the Gutenpride Create Block tutorial is that the colour font used is not accessible in Twenty Twenty or Twenty Twenty One themes due to the varying colour contrasts of the multi-coloured font.
To reproduce
Steps to reproduce the behavior:
npx @wordpress/create-block starter-block
is run, the resulting template is set up to run with SCSS, and not plain CSS from the start.Expected behavior
npx @wordpress/create-block
generates should be CSS-first.otf
files or files with other possible formats. Suggested edits here.Editor version :
Desktop :
The text was updated successfully, but these errors were encountered: