Make heading styling distinguishable from paragraph#1127
Make heading styling distinguishable from paragraph#1127diegoreymendez merged 3 commits intodevelopfrom
Conversation
1. Heading font sizes are updated 2. Headings made bold by default 3. ShadowBoldFormatter is added to allow Bolding effect on headings by making use of shadow effect
|
hey @diegoreymendez 👋 @iamthomasbishop will review the new style on the device and will provide some style feedbacks but I think technical side of the PR is ready to review. |
| // Creates a no blur NSShadow instance with given offset values | ||
| static func shadow(width: CGFloat = DefaultOffset.width, | ||
| height: CGFloat = DefaultOffset.height, | ||
| color: UIColor = UIColor.black) -> NSShadow { |
There was a problem hiding this comment.
@diegoreymendez 👋 The color choice is sth I want to ask, I couldn't find where to look for to see the what determines the color of headings. So I am thinking choosing black can be problematic in the future, shadow should actually be same as the font color, but not sure how to do it ? any help is appreciated
There was a problem hiding this comment.
I'd stick to the font color... and I'd probably avoid a default (in the method definition) if we can.
Considering both calls to this method have access to the string attributes, I'd pick up the color from there (and default there to black if the color is missing).
| private extension Header { | ||
| struct Constants { | ||
| static let defaultFontSize = Float(14) | ||
| static let defaultFontSize = Float(16) |
There was a problem hiding this comment.
the old value of default font size corresponded to h5 so I updated this as h5's new value also
|
hey @diegoreymendez 👋 I have updated the color issue. |
diegoreymendez
left a comment
There was a problem hiding this comment.
Nice work @pinarol !
Fixes: wordpress-mobile/gutenberg-mobile#351
This PR updates the style of Heading block based on wordpress-mobile/gutenberg-mobile#351 (comment)
WPiOS PR: wordpress-mobile/WordPress-iOS#10912
mobile-gutenberg PR: wordpress-mobile/gutenberg-mobile#525
Changes Made
The Problem
We want to use bold font with Heading blocks by default. However, we don't want to generate bold output in the html unless user intentionally selects B option from toolbar. That makes it a bit challenging for us to decide how to make this happen. This PR proposes a solution that mimics bolding behavior by giving extra shadow and letter spacing.
To Test
1.1. Test Heading
1.2 Test paragraph
Test that paragraph is not effected:
Post Editor - Make heading style distinguishable from paragraph WordPress-iOS#10912