From 62f021fc5cefbc5a73cf2a62a41c200704370ba1 Mon Sep 17 00:00:00 2001 From: Jeremy Thomas Date: Fri, 22 Mar 2024 10:28:14 +0000 Subject: [PATCH] Fix #3720 --- docs/_data/sizes-list.json | 30 +++++++++++ .../helpers/typography-helpers.html | 54 ++++++++++--------- 2 files changed, 60 insertions(+), 24 deletions(-) create mode 100644 docs/_data/sizes-list.json diff --git a/docs/_data/sizes-list.json b/docs/_data/sizes-list.json new file mode 100644 index 00000000..e28dea24 --- /dev/null +++ b/docs/_data/sizes-list.json @@ -0,0 +1,30 @@ +[ + { + "name": "size-1", + "value": "3rem" + }, + { + "name": "size-2", + "value": "2.5rem" + }, + { + "name": "size-3", + "value": "2rem" + }, + { + "name": "size-4", + "value": "1.5rem" + }, + { + "name": "size-5", + "value": "1.25rem" + }, + { + "name": "size-6", + "value": "1rem" + }, + { + "name": "size-7", + "value": "0.75rem" + } +] diff --git a/docs/documentation/helpers/typography-helpers.html b/docs/documentation/helpers/typography-helpers.html index c8a0aca5..e4beffb7 100644 --- a/docs/documentation/helpers/typography-helpers.html +++ b/docs/documentation/helpers/typography-helpers.html @@ -11,41 +11,48 @@ breadcrumb: - helpers-typography --- -{% assign initial_vars = -site.data.variables.utilities['initial-variables'].by_name %} {% assign sizes = -site.data.variables.utilities['derived-variables'].by_name['$sizes'].value | -split: ' ' %} {% capture thead %} +{% assign sizes = site.data['sizes-list'] %} + +{% capture thead %} Class - {% for breakpoint_hash in site.data.breakpoints %} {% assign breakpoint = - breakpoint_hash[1] %} - - {{ breakpoint.name }}
- {% if breakpoint.id == 'mobile' %} Up to - {{ breakpoint.to }}px - {% elsif breakpoint.id == 'fullhd' %} - {{ breakpoint.from }}px and above {% else %} Between - {{ breakpoint.from }}px and - {{ breakpoint.to }}px - {% endif %} - + {% for breakpoint_hash in site.data.breakpoints %} + {% assign breakpoint = breakpoint_hash[1] %} + + {{ breakpoint.name }}
+ {% if breakpoint.id == 'mobile' %} Up to + {{ breakpoint.to }}px + {% elsif breakpoint.id == 'fullhd' %} + {{ breakpoint.from }}px and above {% else %} Between + {{ breakpoint.from }}px and + {{ breakpoint.to }}px + {% endif %} + {% endfor %} -{% endcapture %} {% capture size1 %} +{% endcapture %} + +{% capture size1 %} {{ initial_vars['$size-1'].value }} -{% endcapture %} {% capture unchanged %} +{% endcapture %} + +{% capture unchanged %} unchanged -{% endcapture %} {% capture left %} +{% endcapture %} + +{% capture left %} left-aligned -{% endcapture %} {% include docs/elements/anchor.html name="Size" %} +{% endcapture %} + +{% include docs/elements/anchor.html name="Size" %}

There are {{ sizes | size }} sizes to choose from:

@@ -62,14 +69,13 @@ split: ' ' %} {% capture thead %} {% for size in sizes %} - {% assign key = '$size-' | append: forloop.index %} - is-size-{{ forloop.index }} + is-{{ size.name }} - {{ initial_vars[key].value }} + {{ size.value }} - Example + Example {% endfor %}