WordPress / Learn

WordPress.org Learn - The canonical source for the code and content behind https://learn.WordPress.org
266 stars 94 forks source link

Block Stylesheets #2275

Closed cynthianorman closed 2 months ago

cynthianorman commented 7 months ago

Details

Learning Objectives

Related Resources and Other Notes

github-actions[bot] commented 6 months ago

Lesson Development Checklist

cynthianorman commented 2 months ago

https://youtu.be/pG_RdfUZxFQ

This Intermediate Theme Developer Learning Pathway Lesson is ready to be reviewed. Please follow the steps listed under Guidelines for reviewing content. Thank you for your contribution! ✨

jonathanbossenger commented 2 months ago

Tutorial/Lessons Review Checklist

Please tick all items you've confirmed:

Great lesson Cynthia.

The only piece of feedback I have is that I might be useful to either somehow highlight, or mention, that registering custom block stylesheets is done by using the wp_enqueue_block_style function, with the block name as the first parameter.

The whole time I was watching this was interested to know how this is done, and then you show an example, but don't mention the function reference for wp_enqueue_block_style, which I think will be useful.

So my suggestion would be, at 2:35, just after you mention the naming conventions and before the example, to include a short sentence along the lines of

To register block stylesheets you use the wp_enqueue_block_style function (screen shows function reference page), passing the block name as the first parameter and an array of arguments as the second parameter.

And then that flows perfectly into the example code.

cynthianorman commented 2 months ago

@jonathanbossenger thanks so much - done

ironnysh commented 2 months ago

Tutorial/Lessons Review Checklist

Please tick all items you've confirmed:

Great tutorial, @cynthianorman.

My favorite part is at 0:54, with the best named theme in the directory ;-)

jonathanbossenger commented 2 months ago

https://youtu.be/_LFPvFi5Xcc

cynthianorman commented 2 months ago

@jonathanbossenger

YouTube chapters

(0:05) Learning objectives (0:17) Describe a block stylesheet (2:07) Create a custom block stylesheet (3:17) Next steps

cynthianorman commented 2 months ago

//publish