0
0
Tailwindmarkup~5 mins

Custom font integration in Tailwind - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the first step to use a custom font in Tailwind CSS?
You need to import the custom font files (like .woff or .ttf) into your project and define them in your CSS using <code>@font-face</code>.
Click to reveal answer
beginner
How do you add a custom font family to Tailwind's configuration?
In tailwind.config.js, extend the theme.fontFamily object by adding your custom font name and fallback fonts.
Click to reveal answer
beginner
Why should you include fallback fonts when defining a custom font in Tailwind?
Fallback fonts ensure text is still readable if the custom font fails to load or is unsupported on some devices.
Click to reveal answer
beginner
How do you apply your custom font to an element using Tailwind classes?
Use the class name you defined in <code>tailwind.config.js</code> for your font family, for example <code>class="font-customName"</code>.
Click to reveal answer
intermediate
What is a good practice to ensure your custom font works well on different screen sizes?
Use responsive design with Tailwind’s utility classes and test font appearance on various devices to maintain readability.
Click to reveal answer
Which file do you modify to add a custom font family in Tailwind CSS?
Atailwind.config.js
Bindex.html
Cpackage.json
Dpostcss.config.js
What CSS rule is used to load a custom font file?
A@import-font
B@font-load
C@font-face
D@font-style
Why include fallback fonts when defining a custom font?
ATo add animations
BTo improve loading speed
CTo reduce file size
DTo ensure text displays if custom font fails
How do you apply a custom font named 'myFont' in Tailwind CSS classes?
Aclass="font-family-myFont"
Bclass="font-myFont"
Cclass="myFont"
Dclass="text-myFont"
Which unit is recommended for font sizes in Tailwind for better accessibility?
Arem
Bpt
Cpx
Dcm
Explain the steps to add and use a custom font in a Tailwind CSS project.
Think about loading the font, telling Tailwind about it, then using it.
You got /3 concepts.
    Why is it important to include fallback fonts and test your custom font on different devices?
    Consider what happens if the font doesn’t load or looks different.
    You got /3 concepts.