Skip to content
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

Typography block support: add typography support and defaults #34064

Merged
merged 6 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/block-library/src/button/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@
},
"typography": {
"fontSize": true,
"__experimentalFontFamily": true
"__experimentalFontFamily": true,
ramonjd marked this conversation as resolved.
Show resolved Hide resolved
"__experimentalDefaultControls": {
"fontSize": true
}
},
"reusable": false,
"spacing": {
Expand Down
10 changes: 9 additions & 1 deletion packages/block-library/src/code/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@
"anchor": true,
"__experimentalSelector": ".wp-block-code > code",
"typography": {
"fontSize": true
"fontSize": true,
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
},
"spacing": {
"margin": [ "top", "bottom" ],
Expand Down
10 changes: 9 additions & 1 deletion packages/block-library/src/heading/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalFontWeight": true
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true,
"fontAppearance": true,
"textTransform": true
}
},
"__experimentalSelector": "h1,h2,h3,h4,h5,h6",
"__unstablePasteTextInline": true,
Expand Down
10 changes: 9 additions & 1 deletion packages/block-library/src/list/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@
"className": false,
"typography": {
"fontSize": true,
"__experimentalFontFamily": true
"__experimentalFontFamily": true,
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
},
"color": {
"gradients": true,
Expand Down
5 changes: 4 additions & 1 deletion packages/block-library/src/navigation/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@
"__experimentalFontWeight": true,
"__experimentalTextTransform": true,
"__experimentalFontFamily": true,
"__experimentalTextDecoration": true
"__experimentalTextDecoration": true,
"__experimentalDefaultControls": {
"fontSize": true
}
},
"spacing": {
"blockGap": true,
Expand Down
7 changes: 5 additions & 2 deletions packages/block-library/src/paragraph/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true,
"lineHeight": true
"fontSize": true
}
},
"__experimentalSelector": "p",
Expand Down
9 changes: 8 additions & 1 deletion packages/block-library/src/post-author/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@
},
"typography": {
"fontSize": true,
"lineHeight": true
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
},
"color": {
"gradients": true,
Expand Down
5 changes: 4 additions & 1 deletion packages/block-library/src/post-comment-date/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
"__experimentalTextTransform": true,
"__experimentalLetterSpacing": true
"__experimentalLetterSpacing": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
}
}
8 changes: 7 additions & 1 deletion packages/block-library/src/post-comments-count/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
},
"typography": {
"fontSize": true,
"lineHeight": true
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
}
}
9 changes: 8 additions & 1 deletion packages/block-library/src/post-comments-form/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
},
"typography": {
"fontSize": true,
"lineHeight": true
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found font weight and font size, etc, didn't quite work as I expected with this block, because it's a more complex block. E.g. the font weight gets applied at the container, but there is a nested h3 that doesn't wind up being affected by this:

image

Because this is a server-rendered block, I wouldn't consider these details a blocker — I think personally it's fine to opt-in to these Typography supports and defer fine-tuning the behaviour to follow-ups further down the track.

"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
},
"style": [ "wp-block-post-comments-form", "wp-block-buttons", "wp-block-button" ]
Expand Down
9 changes: 8 additions & 1 deletion packages/block-library/src/post-comments-link/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
},
"typography": {
"fontSize": true,
"lineHeight": true
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
}
}
9 changes: 8 additions & 1 deletion packages/block-library/src/post-comments/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
"align": [ "wide", "full" ],
"typography": {
"fontSize": true,
"lineHeight": true
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
},
"color": {
"gradients": true,
Expand Down
5 changes: 4 additions & 1 deletion packages/block-library/src/post-date/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
"__experimentalTextTransform": true,
"__experimentalLetterSpacing": true
"__experimentalLetterSpacing": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
}
}
9 changes: 8 additions & 1 deletion packages/block-library/src/post-excerpt/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@
},
"typography": {
"fontSize": true,
"lineHeight": true
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
},
"editorStyle": "wp-block-post-excerpt-editor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@
"html": false,
"typography": {
"fontSize": true,
"lineHeight": true
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
}
}
8 changes: 7 additions & 1 deletion packages/block-library/src/post-terms/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@
"typography": {
"lineHeight": true,
"fontSize": true,
"__experimentalFontWeight": true
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
ramonjd marked this conversation as resolved.
Show resolved Hide resolved
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
},
"style": "wp-block-post-terms"
Expand Down
8 changes: 7 additions & 1 deletion packages/block-library/src/post-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@
"__experimentalFontFamily": true,
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
"__experimentalTextTransform": true
"__experimentalTextTransform": true,
"__experimentalLetterSpacing": true,
"__experimentalDefaultControls": {
"fontSize": true,
"fontAppearance": true,
"textTransform": true
}
}
},
"style": "wp-block-post-title"
Expand Down
10 changes: 9 additions & 1 deletion packages/block-library/src/preformatted/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@
"gradients": true
},
"typography": {
"fontSize": true
"fontSize": true,
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
},
"style": "wp-block-preformatted"
Expand Down
12 changes: 12 additions & 0 deletions packages/block-library/src/pullquote/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@
"background": true,
"link": true
},
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true,
"fontAppearance": true
}
},
"__experimentalBorder": {
"color": true,
"radius": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@
},
"typography": {
"fontSize": true,
"lineHeight": true
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@
},
"typography": {
"fontSize": true,
"lineHeight": true
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
}
}
11 changes: 10 additions & 1 deletion packages/block-library/src/query-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalFontFamily": true
"__experimentalFontFamily": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true,
"fontAppearance": true,
"textTransform": true
}
}
},
"editorStyle": "wp-block-query-title-editor"
Expand Down
14 changes: 13 additions & 1 deletion packages/block-library/src/quote/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@
},
"supports": {
"anchor": true,
"__experimentalSlashInserter": true
"__experimentalSlashInserter": true,
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true,
"fontAppearance": true
}
}
},
"styles": [
{
Expand Down
5 changes: 4 additions & 1 deletion packages/block-library/src/site-tagline/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
"__experimentalTextTransform": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true
"__experimentalLetterSpacing": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
},
"editorStyle": "wp-block-site-tagline-editor"
Expand Down
9 changes: 8 additions & 1 deletion packages/block-library/src/site-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@
"__experimentalTextTransform": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true
"__experimentalLetterSpacing": true,
"__experimentalDefaultControls": {
"fontSize": true,
"lineHeight": true,
"fontAppearance": true,
"letterSpacing": true,
"textTransform": true
}
}
},
"editorStyle": "wp-block-site-title-editor"
Expand Down
Loading