Font Weight
Work in progress!
More detailed documentation is coming soon, but in the meantime here's a quick class reference.
Class reference
Class | Properties |
---|---|
.font-hairline | font-weight: 100; |
.font-thin | font-weight: 200; |
.font-light | font-weight: 300; |
.font-normal | font-weight: 400; |
.font-medium | font-weight: 500; |
.font-semibold | font-weight: 600; |
.font-bold | font-weight: 700; |
.font-extrabold | font-weight: 800; |
.font-black | font-weight: 900; |
Hover
In addition to the standard responsive variations, font weight utilities also come in hover:
variations that apply the given font weight on hover.
<div class="text-center text-blue-dark">
<a href="#" class="font-normal hover:font-bold">Hover over this link</a>
</div>
Hover utilities can also be combined with responsive utilities by adding the responsive {screen}:
prefix before the hover:
prefix.
<a href="#" class="... md:font-normal md:hover:font-bold ...">Link</a>
Customizing
Responsive and State Variants
By default, only responsive and hover variants are generated for font weight utilities.
You can control which variants are generated for the font weight utilities by modifying the fontWeights
property in the modules
section of your Tailwind config file.
For example, this config will also generate focus variants:
Disabling
If you don't plan to use the font weight utilities in your project, you can disable them entirely by setting the fontWeights
property to false
in the modules
section of your config file: