Closed marybaum closed 1 year ago
Ready for review #1 in this Google doc!
Buehler?
π
@marybaum - Sorry for not getting to this earlier. I've been on a different project for the last month, but I'm back working on the Dev Blog now.
Can you open the Google Doc up to public comment?
Oops! Of course!
Hi @marybaum in case you were wondering why no one comments on your what I am sure is a brilliant article. You need give comment or editor access before we can review it.
The problem was between the keyboard and the chair: error ID#10T.
Opened!
Overall, the writing is excellent. No issues there.
The biggest issues seem to be with the theme.json
examples. As far as I can tell, none of them are valid. Well, they're valid JSON code, but I don't think they're valid with the most current theme.json
schema.
Edit: I'm happy to write out some code examples for this and add them here to the ticket.
That would be lovely, Justin, and good for me to know, Thanks!
Cool. I'll work on those tomorrow and share them here.
I play tennis on the pickleball court, and it would appear you've caught me writing CSS in a theoretical JSON file ... ;-D
I've added three code sections below, corresponding to the steps in your post. These are full theme.json
examples, which includes the necessary version
and usually-best-to-include $schema
. Typically, it's best to add those to theme.json
examples to clarify the structure.
Some handbook links related to your theme.json
code (these are from a new chapter just published this week):
Well, there's probably several other handbook links that might be worthwhile, so feel free to add any others you think would fit.
Basically just setting the default content width here. I haven't used ch
with theme.json
, but I'm fairly certain it's a supported unit.
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"layout": {
"contentSize": "66ch"
}
}
}
My guess is that you want to specifically set the global line-height here instead of focusing on an individual block/element (this can always be overwritten for more specific cases, like for headings). That's what I'd do anyway, but we can always just target paragraphs too.
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"layout": {
"contentSize": "66ch"
}
},
"styles": {
"typography": {
"lineHeight": "1.5"
}
}
}
A few notes on the code below:
styles.elements.heading
, but you can also target styles.elements.h2
if you only want to change <h2>
elements.styles.blocks.core/list
.blockGap
is the best way to achieve spacing between elements. I'd only touch vertical margins to fine-tune a few things (I also do this in CSS instead of theme.json
just because of some...ahem...wonkiness).{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"layout": {
"contentSize": "66ch"
}
},
"styles": {
"spacing": {
"blockGap": "2rem"
},
"typography": {
"lineHeight": "1.5"
},
"elements": {
"heading": {
"typography": {
"lineHeight": "0.9"
}
}
},
"blocks": {
"core/list": {
"spacing": {
"padding": {
"left": "2.5rem"
}
}
}
}
}
}
Thank you very much!
I was doing something a couple of days ago where I started to tumble to the fact that the order of things is important in theme.json β it was obvious that I had tried to nest some things in a way only a very large cat would attempt (I know I weigh 16 pounds! But I used to fit in that box!)
Is there anything more you need on this @marybaum . I did a review two weeks back so just checking in as see this ticket was still open and there was a link to a published post yet.
Hope to finish it right now (well in a couple of hours of focused work) I let myself get hijacked by some things here on the ground, but am coming back to the blog for regular participation. Thanks for asking!
And many many MANY thanks for the code snippets!
Ready for second review!
That's a great primer to content spacing and readability. I had minor comments...
@marybaum why don't you move it to the CMS and we'll get it ready for publishing?
And if you are already off, Happy Thanksgiving π¦ π π₯§ π
Will do!
Published, A great readβfour simple steps to your best body copy ever
Social copy:
Whether it's blog posts, documentation or sell copy, great typography can take your long copy from a hard slog to a great read. In just four steps! Find out how, in part 3 of the WordPress Developer Blog's type series.
Closing this issue as published: https://developer.wordpress.org/news/2023/12/a-great-read-four-simple-steps-to-your-best-body-copy-ever/
schedule for social media on Sat 2/23
New post title. A great read: four steps to your best body copy ever