-
Notifications
You must be signed in to change notification settings - Fork 361
Conversation
club/theme.json
Outdated
"min": "1.25rem", | ||
"max": "2.5rem" | ||
}, | ||
"slug": "default-title", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a font size not explicitly defined in the mockups but still widely used there. I refer to the titles and other elements that are 20px on mobile and 40px on desktop. I implemented that as default-title.
thanks for the feedback @madhusudhand!
Yep, the list is a little bit long but I think It won't hurt the user experience.
Nope, this feature is not working yet on |
9d04916
to
34a62c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also consider adding lineHeight and letterSpacing for various blocks.
I added the letter spacing settings, I prefer to work the line height on a separate PR when we have more templates finished and we can test it better. I created an issue in the Club milestone about that: #6274 |
I think it would be interesting to try this without any min/max settings - that way we'll see how well the defaults work and if we want to tweak them... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following is the overall feedback:
Paragraphs:
✅ Small
❌ Default -> current: 15-30px
expected: 16-20px
❌ Medium -> current: 18-36px
expected: 20-24px
❌ Large -> current: 21-42px
expected: 28px
❌ Extra large -> current: 30-60px
expected: 40px
Headings:
✅ H1
✅ H2
❌ H3 -> current: 20-40px
expected: 30-40px
✅ H4
❌ H5 -> current: 15-30px
expected: 20px
✅ H6
also font-weight is not matching for the headings
❌ post title: commented inline
❌ site-title and nav menu sizes are smaller
Thanks for testing @madhusudhand, the problem with those sizes is caused by the implementation of Gutenberg Fluid typography API that doesn't seem to be working as expected. I reported it here: WordPress/gutenberg#42698 |
Let's merge #6255 to unblock the development and park this PR until issues gets fixed in gutenberg? |
I just implemented the new flag to avoid fluid sizes and recently merged to Gutenberg. |
The implementation seems to be working fine: Paragraphs:small: 14px - 16px -> 0.875rem - 1rem Headers:h1: 60px - 130px -> 3.75rem - 8.125rem Default Title: 20px - 40px -> 1.25rem - 2.5rem Tested with this markup and working as expected.
|
club/theme.json
Outdated
"min": "3.75rem", | ||
"max": "8.125rem" | ||
}, | ||
"slug": "header-one", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure its a good idea to implement these non-standard typography options. This will expose these to users in the block editor and they will be able to select them for their content. Then when they switch themes they will lose these settings and the fonts will revert to a default size. I'd recommend either moving these to custom, or simply defining them directly on the patterns and templates as needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created an enhancement request here WordPress/gutenberg#42694
There is an idea of being able to define hidden sizes. It might be a solution around this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also not sure it's a good idea to include the non-standard options. Should we move the non-standard options to where they're being used (e.g. to the heading elements, directly in the templates, etc) for now, until we have a solution like the hidden sizes? Then we can progress this PR.
Moving this one back to in-progress to resolve the conflicts and implement the non-standard sizes directly on the template. |
10a463e
to
e650612
Compare
In If WordPress/gutenberg#42694 or any other effort around supporting dynamic font sizes outside the |
Co-authored-by: madhusudhand <madhusudhan.dollu@gmail.com>
The itention is to keep in the fontSizes array just the sizes defined in the default Gutenberg theme.json file: https://github.com/WordPress/gutenberg/blob/640856bce02f37173f53ad664b3796a3eeb687e5/lib/compat/wordpress-6.1/theme.json#L282-L306
dd82b6c
to
0f1e7da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved the conflicts and verified the changes.
LGTM!
Changes proposed in this Pull Request:
Club theme: Implement the fluid type sizes API in theme.json.
ℹ️ Notes about how this new feature works in practice:
fluid.min
andfluid.max
, obviously, works as max and min font sizes.min
is applied in all the viewports below 768px wide. This value is enlarged progressively when the viewport grows. If the viewport is more that 1600px widemax
is applied as font size.size
key is used as a fallback value. So leveraging the API won't imply a broken site for users not using the Gutenberg plugin.This PR is an alternative approach to this one #6255.
Thanks, @madhusudhand for working on it!
Related issue(s):
#6213