tailwind utility to capitalize only first letter of string
Install the plugin from npm:
$ npm install tailwind-capitalize-first-letter
Then add the plugin to your tailwind.config.js
file:
// tailwind.config.js
module.exports = {
// ...
plugins: [
// ...
require('tailwind-capitalize-first-letter'),
// ...
],
};
This plugin will generate following CSS:
/* ... */
.capitalize-first:first-letter {
texttransform: uppercase;
}
/* ... */
<p class="capitalize-first">the first letter will always be uppercased!</p>
<p class="md:capitalize-first">
the first letter will be uppercased on <code>md</code> screens and up.
</p>
<p class="hover:capitalize-first">
the first letter will be uppercased on hover.
</p>
Capitalize first letter is licensed under the MIT License.
Created with create-tailwind-plugin. Inspired by simonswiss