XWIKI-21333: Update the weight and font size of headings #2360
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.
Jira: https://jira.xwiki.org/browse/XWIKI-21333
I agree the code is complex, I'm looking for ways to simply.
Also, if we drop the viewport scale improvement, the code gets muuuch simpler.
TODO
How are headings size computed
Inspired from https://www.smashingmagazine.com/2016/05/fluid-typography/#controlling-the-rate-of-scale
You can find below the actual
font-size
used forh1
headings with the default values.23px
= the minimal font size ah1
heading can have (on 768px or smaller screens), computed following the formula14px * pow(1.125, 4)
35px
= the maximal font size ah1
heading can have (on 1200px or lager screens), , computed following the formula14px * pow(1.250, 4)
The same goes for the other headings, but the power applies to the ratio is decremented for each sub-level (ranging from 4 for h1 to -1 for h6).
Home page
Before
1200
768
After
1200
768
Sandbox
Before
1200
768
After
1200
768