--- title: Typography helpers layout: documentation doc-tab: helpers doc-subtab: helpers-typography breadcrumb: - home - documentation - helpers - 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 %} 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 %} {% endfor %} {% endcapture %} {% capture size1 %} {{ initial_vars['$size-1'].value }} {% endcapture %} {% capture unchanged %} unchanged {% endcapture %} {% capture left %} left-aligned {% endcapture %} {% include elements/anchor.html name="Size" %}

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

{% for size in sizes %} {% assign key = '$size-' | append: forloop.index %} {% endfor %}
Class Font-size Size
is-size-{{ forloop.index }} {{ initial_vars[key].value }} Example
{% include elements/anchor.html name="Responsive size" %}

You can choose a specific size for each viewport width. You simply need to append the viewport width to the size modifier.

For example, here are the modifiers for $size-1:

{{ thead }} {{ size1 }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ size1 }} {{ size1 }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ size1 }} {{ size1 }} {{ size1 }} {{ size1 }} {{ unchanged }} {{ unchanged }} {{ size1 }} {{ size1 }} {{ size1 }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ size1 }} {{ size1 }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ size1 }}
is-size-1-mobile
is-size-1-touch
is-size-1-tablet
is-size-1-desktop
is-size-1-widescreen
is-size-1-fullhd

You can use the same logic for each of the 7 sizes.

{% include elements/anchor.html name="Alignment" %}

You can align the text with the use of one of 4 alignment helpers:

Class Alignment
has-text-centered Makes the text centered
has-text-justified Makes the text justified
has-text-left Makes the text aligned to the left
has-text-right Makes the text aligned to the right
{% include elements/anchor.html name="Responsive Alignment" %}

You can align text differently for each viewport width. Simply append the viewport width to the alignment modifier.

For example, here are the modifiers for has-text-left:

{{ thead }} {{ left }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ left }} {{ left }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ left }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ left }} {{ left }} {{ left }} {{ left }} {{ unchanged }} {{ unchanged }} {{ left }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ left }} {{ left }} {{ left }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ left }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ left }} {{ left }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ left }}
has-text-left-mobile
has-text-left-touch
has-text-left-tablet-only
has-text-left-tablet
has-text-left-desktop-only
has-text-left-desktop
has-text-left-widescreen-only
has-text-left-widescreen
has-text-left-fullhd

You can use the same logic for each of the 4 alignments.

{% include elements/anchor.html name="Text transformation" %}

You can transform the text with the use of one of 4 text transformation helpers:

Class Transformation
is-capitalized Transforms the first character of each word to uppercase
is-lowercase Transforms all characters to lowercase
is-uppercase Transforms all characters to uppercase
is-italic Transforms all characters to italic
{% include elements/anchor.html name="Text weight" %}

You can transform the text weight with the use of one of 5 text weight helpers:

Class Weight
has-text-weight-light Transforms text weight to light
has-text-weight-normal Transforms text weight to normal
has-text-weight-medium Transforms text weight to medium
has-text-weight-semibold Transforms text weight to semi-bold
has-text-weight-bold Transforms text weight to bold
{% include elements/anchor.html name="Font family" %}

You can change the font family with the use of one of 5 font family helpers:

{% assign font_families = "sans-serif,monospace,primary,secondary,code" | split: ',' %} {% for family in font_families %} {% endfor %}
Class Family
is-family-{{ family }} Sets font family to $family-{{ family }}