-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: add explicit bypass for fluid font size calculation #42757
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ramonjd
added
[Type] Enhancement
A suggestion for improvement.
[Feature] Typography
Font and typography-related issues and PRs
labels
Jul 28, 2022
Size Change: +7 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
scruffian
reviewed
Jul 28, 2022
scruffian
approved these changes
Jul 28, 2022
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.
LGTM
…y to bypass fluid calculations for a specific font.
ramonjd
force-pushed
the
update/fluid-font-size-bypass-flag
branch
from
July 28, 2022 21:56
12ceb4f
to
e3ac832
Compare
matiasbenedetto
added a commit
to Automattic/themes
that referenced
this pull request
Jul 29, 2022
madhusudhand
pushed a commit
to Automattic/themes
that referenced
this pull request
Aug 5, 2022
madhusudhand
added a commit
to Automattic/themes
that referenced
this pull request
Aug 5, 2022
* Club: implementing fluid typography * fixing name mistake * Club: adding link styles. Co-authored-by: madhusudhand <madhusudhan.dollu@gmail.com> * Club: line-heigth change * Club: theme.json workaround to stylize link inside post-date block * Club: adding letter spacing * Club: implemeting explicit bypass for fluid font size calculation WordPress/gutenberg#42757 * Club: tweaking font sizes * Club: headings font weight * Club: font size tweaks * Club: moving font sizes definition away from default font sizes array. 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 * move letter spacing to heading Co-authored-by: madhusudhand <madhusudhan.dollu@gmail.com>
oandregal
added
the
[Feature] Design Tools
Tools that impact the appearance of blocks both to expand the number of tools and improve the experi
label
Aug 10, 2022
Added label for changelog. |
37 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Design Tools
Tools that impact the appearance of blocks both to expand the number of tools and improve the experi
[Feature] Typography
Font and typography-related issues and PRs
Needs User Documentation
Needs new user documentation
[Type] Enhancement
A suggestion for improvement.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #42698
Related to:
What?
Allowing for an explicit
false
value in the fluid font size property to bypass fluid calculations for a specific font.Why?
So that theme authors can select which font sizes receive fluid treatment when
settings.typography.fluid
is set totrue
.How?
Checking for
"fluid" === false
before performing fluid font size calculations and, if found, returning the static font size.Testing Instructions
Enable fluid typography.
Add some font sizes to your theme.json (see example theme.json below)
For one or two sizes, set
fluid
tofalse
. E.g.,Add some text to a post and set your font sizes (see example HTML below)
For all sizes with
"fluid": false,
, the font size should be static and reflect the size value regardless of viewport width.Here, the
Extra large
heading is static:Example HTML block code
Example theme.json
Check that things work in the site editor too (See #42688)
Unit tests