Font Size Inherit - Tailwind CSS

Asked 5 days ago Viewed 15 times

I would like to apply inherited font size to an element with Tailwind.

I know that this can be achieved in regular CSS like so:

.element {
    font-size: inherit;
}

But how would I accomplish this using purely Tailwind class syntax? text-inherit seems to apply color: inherit not font-size: inherit like I desire.

1
w
44
1 Answer
Sort by
Accepted by Author Posted 5 days ago

You can achieve this through an arbitrary value with the length type-cast as specified by the relevant Tailwind Documentation.

In Use:

<div class="text-[length:inherit]"></div>
2
J
J
99

Your Answer

You Must Log In or Sign Up to Answer Questions