Skip to content

Commit

Permalink
Add heading setting in Rich text
Browse files Browse the repository at this point in the history
  • Loading branch information
tauthomas01 committed Jul 21, 2021
1 parent 1cda1dc commit cf9b9a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions locales/en.default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,9 @@
"options__2": {
"label": "Medium"
},
"options__3": {
"label": "Large"
},
"label": "Heading font size"
}
}
Expand Down
6 changes: 5 additions & 1 deletion sections/rich-text.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -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>
{%- when 'text' -%}
<div class="rich-text__text rte" {{ block.shopify_attributes }}>{{ block.settings.text }}</div>
{%- when 'button' -%}
Expand Down Expand Up @@ -85,6 +85,10 @@
{
"value": "medium",
"label": "t:sections.rich-text.blocks.heading.settings.heading_size.options__2.label"
},
{
"value": "large",
"label": "t:sections.rich-text.blocks.heading.settings.heading_size.options__3.label"
}
],
"default": "medium",
Expand Down

0 comments on commit cf9b9a3

Please sign in to comment.