tailwindcss-textshadow
A Utility Plugins for controlling Text Shadow of an text element.
Class | Properties |
---|---|
.text-shadow |
text-shadow: 0px 0px 1px rgb(0 0 0 / 20%), 0px 0px 1px rgb(1 0 5 / 10%); |
.text-shadow-sm |
text-shadow: 1px 1px 3px rgb(36 37 47 / 25%); |
.text-shadow-md |
text-shadow: 0px 1px 2px rgb(30 29 39 / 19%), 1px 2px 4px rgb(54 64 147 / 18%) |
.text-shadow-lg |
text-shadow: 3px 3px 6px rgb(0 0 0 / 26%), 0 0 5px rgb(15 3 86 / 22%) |
.text-shadow-xl |
text-shadow: 1px 1px 3px rgb(0 0 0 / 29%), 2px 4px 7px rgb(73 64 125 / 35%) |
.text-shadow-none |
text-shadow: none |
💡
Features
Minimal Set-up.
Ready to use out of the box.
Has default preset shadows with variants.
Users will be able to
override
andextend
defaults the same way they can with Tailwind's built-in styles.
Installation & changes in tailwind.config.js
Yarn
yarn add tailwindcss-textshadow --dev
npm
npm i --save-dev tailwindcss-textshadow
✔️
import the plugin
Add the plugin to the plugins
array in your Tailwind configuration file (tailwind.config.js)
.
plugins: [
require('tailwindcss-textshadow')
]
🍺 Congratulations! You are ready to usetext-shadow
in your project.
How to use
No text shadow
Use .text-shadow-none
to remove an existing text shadow from an element. This is most commonly used to remove a shadow that was applied at a smaller breakpoint.
<span class="text-shadow-none">span>
Responsive
To control the textshadow of an text element at a specific breakpoint, add a {screen}:
prefix to any existing text shadow utility. For example, use xl:text-shadow-lg
to apply the text-shadow-lg
utility at only large screen sizes and above.
For more information about Tailwind's responsive design features, check out the Responsive Design documentation.
<div class="text-shadow sm:text-shadow-sm md:text-shadow-md lg:text-shadow-lg xl:text-shadow-xl ..."> div>
Adds lodash dependency for Yarn v2 compatability
Unless lodash is specified as an explicit dependency, Yarn v2 gives the following error:
Error: tailwindcss-textshadow tried to access lodash, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Readme file updated to reflect valid text-shadow css property values.
Hi,
I've updated the readme file with valid text-shadow css values. The readme contained a copy of box-shadow css properties from the Tailwindcss site, which is not compatible with the text-shadow property. I actually changed the values to something bit more sensible but I've kept the rgba example.
I think the keys should make a bit more sense but that's just a technicality in my opinion.
Cizza
Wondering if the dependencies will be upgraded for this plugin?
Hi there,
Though this is not a critical concern, I am just wondering whether there will be updates to the dependencies libraries for this plugin since Tailwindcss has successfully moved to v3 with updates to dependencies such as autoprefixer, postcss, purgecss, etc.
Looking forward to the potential update if it is in the pipeline.
Cheers!
idea: extending with colour too?
Hiya. I've Just stumbled upon this ty.
would there be any interest in extendign this plugin to include colours too?
maybe something like
text-shadow-md text-shadow-red-500
to override the default colours with those of the red-500 pallete?