點燈坊

失くすものさえない今が強くなるチャンスよ

Using normal-case to Preserve the Original Casing

Sam Xiao's Avatar 2022-01-24

We can use normal-case to reset capitalization at different breakpoints.

Version

TailwindCSS 3.0

normal-case

normal000

There is no text transformation in the paragraph.

<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="https://cdn.tailwindcss.com"></script>
  <title>TailwindCSS</title>
</head>
<body>
  <p class="normal-case">sam</p>
</body>

Line 10

<p class="normal-case">sam</p>
  • normal-case : preserve text to the original casing. This is the default utility for text, so we often omit this utility

Reset at Breakpoint

normal001

The casing is changed at different breakpoints.

<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="https://cdn.tailwindcss.com"></script>
  <title>TailwindCSS</title>
</head>
<body>
  <p class="uppercase sm:normal-case">sam</p>
</body>

Line 10

<p class="uppercase sm:normal-case">sam</p>
  • uppercase : convert text to uppercase
  • normal-case : preserve text to the original casing

Conclusion

  • We often omit normal-case for text. But it may be useful on responsive design

Reference

TailwindCSS, Text Transform