Utilities for Typography.
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...
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
.
Using text-[numbers]
, you can control the font size of an element.
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.
Using text-w-[*]
, you can control the font weight of text.
A list of available utilites for font-weight:
utility | value |
---|---|
text-w-hair | 100 |
text-w-thin | 200 |
text-w-light | 300 |
text-w-normal | 400 |
text-w-medium | 500 |
text-w-semibold | 600 |
text-w-bold | 700 |
text-w-extrabold | 800 |
text-w-black | 900 |
Using text-s-[*]
, you can control the style of text.
Using text-ls-[*]
, you can control the letter spacing of an element.
Using text-lh-[*]
, you can control the line height of an element.
Using text-a-[*]
, you can control the alignment of text.
Using text-d-[*]
, you can control the decoration of text.
Using text-t-[*]
, you can control the transformation of text.
Using text-ws-[*]
, you can control the element's white-space property.
Using text-wb-[*]
, you can control the word breaks in the element.
Using v-align-[*]
, you can control the vertical alignment of an inline box.
Life is magical, embrace it with open arms.
Using list-style-[*]
, you can control the type of list-item marker in a list.
Using list-style-p-[*]
, you can control the position of the list-item markers.