Comments (5)
Yeah correct, shadow-xl
sets the color so you need to add any color override explicitly with the same conditions you use to apply a different shadow size.
This is similar to how text-sm leading-9 md:text-lg
doesn't preserve leading-9
because md:text-lg
overrides the line-height back to the default line-height for that font size utility.
Going to close this one since this is by design π
from tailwindcss.
I can confirm this applies to other variants as well. sm:shadow-lg
isn't applying either.
from tailwindcss.
Just opened the Play and when I hover the shadow appears:
Untitled.mov
It's not red, maybe that's what you mean? That's because the shadow size classes all reset the shadow back to their default color, by design at least at the moment because otherwise there's no way to get the default color back once you change it.
from tailwindcss.
Interesting. I'm surprised I've never run into that before. I work with shadows a bunch π
@adamwathan Would the best practice then be to apply both the size and color to every state you want to affect, so in this case, hover:shadow-red-500 hover:shadow-xl
?
This works, I just want to make sure there's no better work around to having the shadow color pre-applied so we can trigger the size when needed.
For example, this would be my naturally expected API (before today), if I needed to cover a lot of states:
<div class="
hover:shadow-xl
active:shadow-xl
focus:shadow-xl
shadow-red-500
"></div>
But it looks like we would need to cover both properties for eachβ is that right? (https://play.tailwindcss.com/P5s42RqtPS)
<div class="
hover:shadow-xl hover:shadow-red-500
active:shadow-xl active:shadow-red-500
focus:shadow-xl focus:shadow-red-500
"></div>
I can work with this. I just want to make sure that I'm getting this right before committing that to memory lol
from tailwindcss.
@adamwathan Sweet, thanks for clarifying that
from tailwindcss.
Related Issues (20)
- `contain-layout` does not seem to work v4 HOT 2
- Arbitrary variant nesting selector doesn't work with data attribute selector HOT 2
- [V4] @tailwindcss-vite: Cannot read properties of undefined (reading 'send') HOT 1
- Missing `exports` field in the package.json file HOT 2
- Tailwind HMR does not work with Next.js with symlinks HOT 1
- Tailwind generates inappropriate class names for custom colors HOT 1
- Tailwindcss can't be able to capitalize UPERCASE default text HOT 2
- Tailwind Css Grid Image Sizing
- How add Tailwind in Vue js SFC playground
- Grid and divide utility not working HOT 1
- Tailwind CSS or CSS classes does not working properly while creating elements using vanilla js HOT 1
- Whatever
- [v4] Pseudo selector scale doesn't work on Firefox HOT 3
- Cannot read properties of null (reading '__isOptionsFunction') HOT 2
- [Prettier Plugin] support placeholder (generic class attribute) for tailwindAttributes
- [email protected] build time significantly exceeds previous versions for monorepo
- Tailwind Standalone Throwing Caniuse Browserlist Error When Running Without Tailwind CLI HOT 2
- PostCSS warning for custom utility used with before:/after: HOT 2
- [v4] "ring" doesn't show in Firefox HOT 1
- `supports` variant compiles function syntax incorrectly HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tailwindcss.