DEV Community

Cover image for Tailwind CSS tutorial #28: Text Transform
Shubhi✨
Shubhi✨

Posted on

3

Tailwind CSS tutorial #28: Text Transform

In the article, we will go into detail on how to use Text Transform.

Text Transform

Format

text-transform-{uppercase|lowercase|capitalize|none}

Tailwind Class CSS Property
uppercase text-transform: uppercase;
lowercase text-transform: lowercase;
capitalize text-transform: capitalize;
none text-transform: none;

Transforming text

The uppercaseand lowercasewill uppercase and lowercase text respectively, whereas capitalizeutility will convert text to title-case. The normal-case utility can be used to preserve the original casing — typically to reset capitalization at different breakpoints.

Code

 <ul class="container mx-auto divide-y divide-gray-400 divide-dotted" style="font-family: Raleway">
  <li class="flex items-center justify-between px-4 py-2">
    <ul class=" uppercase">
    <li>Now this is a story all about how, my life got flipped-turned upside down</li>
    </ul>
    <div class="text-xs font-semibold font-mono whitespace-nowrap px-2 py-1 ml-5 rounded text-white bg-pink-500 rounded-2"> text-transform: uppercase;  </div>
  </li>
  <li class="flex items-center justify-between px-4 py-2">
    <ul class="lowercase    ">
    <li>Now this is a story all about how, my life got flipped-turned upside down</li>
    </ul>
    <div class="text-xs font-semibold font-mono whitespace-nowrap px-2 py-1 ml-5 rounded text-white bg-pink-500 rounded-2"> text-transform: lowercase;  </div>
  </li>
    <li class="flex items-center justify-between px-4 py-2">
    <ul class=" capitalize      ">
    <li>Now this is a story all about how, my life got flipped-turned upside down</li>
    </ul>
    <div class="text-xs font-semibold font-mono whitespace-nowrap px-2 py-1 ml-5 rounded text-white bg-pink-500 rounded-2"> text-transform: capitalize; </div>
  </li>
    <li class="flex items-center justify-between px-4 py-2">
    <ul class=" none    ">
    <li>Now this is a story all about how, my life got flipped-turned upside down</li>
    </ul>
    <div class="text-xs font-semibold font-mono whitespace-nowrap px-2 py-1 ml-5 rounded text-white bg-pink-500 rounded-2">text-transform: none;    </div>
  </li>
</ul> 
Enter fullscreen mode Exit fullscreen mode

Full code:
The overall code will be attached to repo link.

Overall Output

Image description

Resources:
tailwind.css

Thank you for reading :), To learn more, check out my blogs on Flex Direction, Hackathons and Flex Wrap.
If you liked this article, consider following me on Dev.to for my latest publications. You can reach me on Twitter.

Keep learning! Keep coding!! 💛

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

👋 Kindness is contagious

DEV works best when you're signed in—unlocking a more customized experience with features like dark mode and personalized reading settings!

Okay