-
Notifications
You must be signed in to change notification settings - Fork 108
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
[Related Course: Create a Custom Block Theme #1] The Basics of theme.json for New Developers - COURSE Lesson Plan #842
Comments
Updating lesson objectives to better fit the flow of the course. |
Needs For Visuals: Note to self: I'm starting to understand why people use theme.json instead of the site editor. It's a matter of speed. We might want to consider at the end of this, creating a module called "developer shortcuts" that dive into why using settings and styles saves developers time overall, to help that click into place. |
Essential questions for a video:
|
Script/Text for Potential Tutorial: "An Overview of theme.json for Beginners" Mini-Lesson / Workshop: Hook (Attention Grabber / Background Activator) Have you ever noticed that some themes have more options available to you than others? Have you ever wondered why some block themes come with pre-selected colors, and others do not? When you compare new-to-you, uncustomized themes that you just installed from the WordPress repository, you may have noticed differences in all sort of things, such as colors, font sizes, gradients, duotones, default widths for general vs. wide content, and more. You can see in this example that the colors blue and yellow have been pre-selected for this cover block (example) Where do these defaults come from, and how are they set? (example video here) The short answer can be found in one of a block theme's configuration files, called the "theme.json". This file is one way developers efficiently set defaults, such as which colors exist when a user first installs a theme, how big, small, or capitalized a theme's text starts out as, or even how much space or padding exists around different elements of the site. (Video Resource for this section) The good new for non-coders is that the site editor allows you to select many of these options with a few clicks of a button, no code required. (Video example of point and click site editor) The bad news is that not every option you can utilize in a theme.json file currently exists in the site editor -- for example, specific customization options over header sizes, capitalization, or line spacing is not available yet in the site editor and must be coded in your theme's theme.json. (Example of option that doesn't exist in site editor) This theme.json file also helps developers centralize their choices in one place, so if they wanted to make a big, sweeping change to their theme, they can head to their theme.json file . For example, in the twenty-twenty-two theme, you can see that this color palette has been pre-set with specific colors (NAME THE COLORS AND FIND THEM). The 'styles' section of a theme.json allows developers to apply a previously selected color, size, or ELEMENTWHATARETHESECALLED and apply it to another part of the site, or a specific block. To see this in action, watch me change this one color from black (which has the hexadecimal color code #000000) to white, which uses the code #ff0000 to tell WordPress what color to display on your screen. You'll see that not only did this change the color in the palette, but it also rippled through the website; any time the developer wanted this primary color used, by changing it in this one centralized place in the theme.json, the color is automatically applied everywhere else. You'll notice that this option is in the site editor. You can also change the color using this color picker, and the changes will ripple throughout your site, wherever this has been specific in the theme's theme.json. It's a great shortcut to being able to rebrand a website fast! This following portion should probably be moved to another section to keep this 'chunked' Maybe this would make for a good exercise perhaps? First, we always recommend using the theme.json schema to help you code in theme.json. (FYI here's a handy site that explains what json schema is, and how it works https://json-schema.org/) -- please see the "Using Schema with WordPress theme.json" tutorial for more. Second, you might start with turning some basic settings off and on, such as AppearanceTools. Other beginning-level theme.json codes you might explore are:
To learn more advanced material about theme.json, please visit the WordPress developer handbook here: https://developer.wordpress.org/themes/advanced-topics/theme-json/ |
Update: Still gathering visuals. I think I need to add some course-specific information in here as well, so it's not exactly a stand-alone lesson plan, but I suppose I could put that in the course module itself rather than here in order to make this a lesson plan all on its own maybe? Either way, Module 3, Lesson 1 is in progress; I anticipate starting on Lesson 2 (which is turning on appearance tools, setting appearance width, and MAYBE setting a color palette ahead of time) tomorrow, but we'll see. |
@wparasae looks good, I just have a few suggestions.
|
Change has been made. Thank you for that review and insight, Jonathan! |
The following lesson is ready for review:
Specific Questions For Feedback (Leave all feedback for this lesson in a comment on this issue) Please leave any feedback for this module in a comment on this post. |
Review:
|
Changes made; I also removed (some, but not all) extra bolding and added "Important!" per the guide you linked. Excellent resource, Wes! |
Closing in favor of prioritizing Learning Pathways content. |
IMPORTANT:
** This lesson plan belongs to part of a greater course, Create a Custom Block Theme #1 **
Please reach out to @arasae (Sarah Snow) in the #training team Slack if you would like to help with this lesson plan.
Topic Description
This lesson provides a very high-level overview of theme.json and prepares users to begin writing theme.json code.
It prepares them to write their first line of code.
Objectives
After completing this lesson, participants will be able to:
Updated Objectives: 10/20/22
Guidelines
Review the [team guidelines] (https://make.wordpress.org/training/handbook/guidelines/)
Development Checklist:
Repo Structure and Lesson Plan Template
Description
Target Audience
Who is this lesson intended for? What interests/skills would they bring? Put an "x" in the brackets for all that apply.
Experience Level
How much experience would a participant need to get the most from this lesson? Put an "x" in the brackets for all that apply.
Type of Instruction
Which strategies will be used for this lesson plan? Put an "x" in the brackets for all that apply.
Time Estimate (Duration)
How long will it take to present this lesson? Put an "x" in the brackets for the one that applies.
Prerequisite Skills
Participants will get the most from this lesson if they have familiarity with:
Readiness Questions
These are important to include in case someone wants to use this lesson plan in-person as a stand-alone lesson.
Slides
If someone wanted to run this lesson as a stand-alone Online Live Workshop or at an in-person WordCamp, you could create slides for this here; if you run a Live Online Workshop on one of these topics or find someone else has, related slides would be welcome!
None Exist Yet
Materials Needed
Notes for the Presenter
/Include any tips needed to present this topic for a Live Online Workshop or in an in-person classroom setting.
Lesson Outline
Exercises
What someone will DO with what they learn in each lesson; most lessons have at least one related exercise.
Exercise name
These help students see the effects of theme.json on their own installation of WordPress, to see the power of how things change.
Appearance Tools:
Assessment
These assessments will be autograded on Learn.WordPress.org.
There should be one assessment item (or more) for each objective listed above. Each assessment item should support an objective; there should be none that don't.
**1. Which option appears immediately in 'global styles' when you set the appearanceTools to true in your site editor?"
**Double-check this, this whole section needs to be edited -- **
A. Color
B. Typography
C. Layout
D. Headings
Answer: C. Correct answer
**2. A question about what happens under a certain section when you add colors
**3. A question about what happens under another section when you add layout settings
Additional Resources
Example Lesson [See Script Below]
Section Heading for Example Lesson
Lesson Wrap Up
Follow with the Exercises and Assessment outlined above.
The text was updated successfully, but these errors were encountered: