Typography

Utilities for Typography.

Text Design

The utility text-[letters] provides a simple way to set various text styles and properties, such as font size, line height, font weight, letter spacing, etc...

text-
Life is magical, embrace it with open arms.

Customizing

By default, this utility sets font size and line height for different text sizes.

But you can customize it by adjusting values in the Mojo's configuration object to set other styles like font weight (fontWeight) and letter spacing (letterSpacing).


mojo({
    base: {
        -- textDesign ** : {
            sm: {
                fontSize: "0.875rem",
                lineHeight: "1.5",
            },
            md: {
                fontSize: "1rem",
                lineHeight: "1.5",
            },
            lg: {
                fontSize: "1.125rem",
                lineHeight: "1.5",
            },
            xl: {
                fontSize: "1.5rem",
                lineHeight: "1.5",
            },
            xxl: {
                fontSize: "2rem",
                lineHeight: "1.5",
            },
            -- big ** : {
                fontSize: "4rem",
                lineHeight: "1.6",
                letterSpcaing: "4px"
            },
        },
    },
})

You can access your custom utilities for text design such as big by using the syntax text-big.

Font Size

Using text-[numbers], you can control the font size of an element.

text-
Life is magical, embrace it with open arms.

The font-size utility enables you to easily adjust the size of text in your design by using a numerical value that gets converted into a multiple of 0.01rem (can be changed in config → units), allowing you to specify precise sizes like text-100 and even decimal values like text-114.4.

Arbitrary values like text-(12px) or text-12px are supported.
Learn more about Arbitrary Styling

Font Weight

Using text-w-[*], you can control the font weight of text.

text-w-
Life is magical, embrace it with open arms.

A list of available utilites for font-weight:

utilityvalue
text-w-hair100
text-w-thin200
text-w-light300
text-w-normal400
text-w-medium500
text-w-semibold600
text-w-bold700
text-w-extrabold800
text-w-black900
Numeric values can also be used, such as text-w-600.

Font Style

Using text-s-[*], you can control the style of text.

text-s-
Life is magical, embrace it with open arms.

Letter Spacing

Using text-ls-[*], you can control the letter spacing of an element.

text-ls-
Life is magical, embrace it with open arms.
You can use Arbitrary values like text-ls-(2px) as well.
Learn more about Arbitrary Styling

Line Height

Using text-lh-[*], you can control the line height of an element.

text-lh-
Looks like the magician's assistant took his disappearing act a little too seriously and poof! vanished right into thin air. Now, the poor magician is flying solo and still trying to conjure up his missing partner. Let's hope he doesn't make himself disappear in the process!
You can use Arbitrary values like text-lh-(1.4em) as well.
Learn more about Arbitrary Styling

Text Align

Using text-a-[*], you can control the alignment of text.

text-a-
Looks like the magician's assistant took his disappearing act a little too seriously and poof! vanished right into thin air. Now, the poor magician is flying solo and still trying to conjure up his missing partner. Let's hope he doesn't make himself disappear in the process!

Text Decoration

Using text-d-[*], you can control the decoration of text.

text-d-
Life is magical, embrace it with open arms.

Text Transform

Using text-t-[*], you can control the transformation of text.

text-t-
Life is magical, embrace it with open arms.

White Space

Using text-ws-[*], you can control the element's white-space property.

text-ws-
Looks like the magician's assistant took his disappearing act a little too seriously and poof! vanished right into thin air. Now, the poor magician is flying solo and still trying to conjure up his missing partner. Let's hope he doesn't make himself disappear in the process!

Word Break

Using text-wb-[*], you can control the word breaks in the element.

text-wb-
As the wizard attempted to cast a spell with the longest English word, "Pneumonoultramicroscopicsilicovolcanoconiosis", he suddenly realized he had forgotten its pronunciation and ended up turning himself into a newt instead.

Vertical Align

Using v-align-[*], you can control the vertical alignment of an inline box.

v-align-

Life is magical, embrace it with open arms.

List Style Type

Using list-style-[*], you can control the type of list-item marker in a list.

list-style-
  • Ford
  • Tesla
  • Mercedes

List Style Position

Using list-style-p-[*], you can control the position of the list-item markers.

list-style-p-
  • Ford
  • Tesla
  • Mercedes