Text Transform

    Normal Case

    Use the utility to preserve the original casing. This is typically used to reset capitalization at different breakpoints.

    Use the .uppercase utility to uppercase text.

    Text Transform - 图2

    1. <p class="uppercase ...">The quick brown fox ...</p>

    Lowercase

    Use the .lowercase utility to lowercase text.

    Use the .capitalize utility to capitalize text.

    Text Transform - 图4

    1. <p class="capitalize ...">The quick brown fox ...</p>

    Responsive

    For more information about Tailwind’s responsive design features, check out the documentation.

    all

    Text Transform - 图6

    sm

    md

    Text Transform - 图8

    xl

    The quick brown fox jumped over the lazy dog.

    By default, only responsive variants are generated for text transformation utilities.

    You can control which variants are generated for the text transformation utilities by modifying the textTransform property in the variants section of your tailwind.config.js file.

    For example, this config will also generate hover and focus variants:

    1. module.exports = {
    2. // ...
    3. - textTransform: ['responsive'],
    4. + textTransform: ['responsive', 'hover', 'focus'],
    5. }

    Disabling

    If you don’t plan to use the text transformation utilities in your project, you can disable them entirely by setting the textTransform property to in the corePlugins section of your config file:


      Vertical Align →