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

Add heading font size setting in Rich text section #188

Merged
merged 3 commits into from
Jul 29, 2021

Conversation

tauthomas01
Copy link
Contributor

Why are these changes introduced?

Fixes #186

The goal of this PR is to add an additional heading setting in the Rich text section.

image

What approach did you take?

  • Add extra setting and Liquid logic.

Design notes
Small: h3 (did not see in the issue which style it was using, so I assume it's h3)
Medium: h2
Large: h3

Demo links

Checklist

@@ -9,7 +9,7 @@
{%- for block in section.blocks -%}
{%- case block.type -%}
{%- when 'heading' -%}
<h2 class="{% if block.settings.heading_size == 'small' %}h2{% else %}h1{% endif %}" {{ block.shopify_attributes }}>{{ block.settings.heading | escape }}</h2>
<h2 class="{% if block.settings.heading_size == 'large' %}h1{% elsif block.settings.heading_size == 'medium' %}h2{% else %}h3{% endif %}" {{ block.shopify_attributes }}>{{ block.settings.heading | escape }}</h2>
Copy link
Contributor

@melissaperreault melissaperreault Jul 15, 2021

Choose a reason for hiding this comment

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

I don't know why but the option doesn't output the right heading size, they look too small now. After investigating it seems like the options before were already perfect and using respectively H1 and H2, I am sorry for this confusion! Large should be using the H0. It was planned to offer a taller heading size but I don't recall what happened to this exploration. It would be key for the theme to have this option.

Keep the size like before for Small and Medium but please add a new heading style H0 for large heading to apply to the Large option:

  • Desktop is 52px
  • Mobile is 40px

Recap:

  • Small = H2
  • Medium = H1
  • Large = H0

cc. @nicklepine @Oliviammarcello @wiktoriaswiecicka, I couldn't find the updated version of the new Typography changes like it was supposed to be done to reference in those circumstances. We'll need this to inform and support our reviews please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made the changes 👍

@tauthomas01 tauthomas01 force-pushed the feature-rich-text-heading branch from 13db0ff to cf9b9a3 Compare July 21, 2021 18:16
@tyleralsbury tyleralsbury self-requested a review July 26, 2021 19:58
@tyleralsbury tyleralsbury self-assigned this Jul 26, 2021
@tyleralsbury tyleralsbury removed their request for review July 26, 2021 19:58
Copy link
Contributor

@sofiamatulis sofiamatulis left a comment

Choose a reason for hiding this comment

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

Tested it and it looks good. Nice - I like the approach 👍 🚢

@sofiamatulis sofiamatulis self-assigned this Jul 27, 2021
Copy link
Contributor

@melissaperreault melissaperreault left a comment

Choose a reason for hiding this comment

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

Thank you Thomas! LGTM! 🎉

@tyleralsbury tyleralsbury merged commit 1177f84 into main Jul 29, 2021
@tyleralsbury tyleralsbury deleted the feature-rich-text-heading branch July 29, 2021 17:31
maplerock added a commit to fellowsmedia/nsra_shopify_2021 that referenced this pull request Jul 30, 2021
* main:
  Adjust announcement bar arrow icon (Shopify#253)
  Add heading font size setting in Rich text section (Shopify#188)
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
* Add heading setting in Rich text

* adjust style class

* Changed the approach to not require a large set of if/elsif

Co-authored-by: tyleralsbury <tyler.alsbury@shopify.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Rich text] Add an additional heading font size
4 participants