Giter VIP home page Giter VIP logo

Comments (5)

adamwathan avatar adamwathan commented on June 9, 2024 1

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.

brandonmcconnell avatar brandonmcconnell commented on June 9, 2024

I can confirm this applies to other variants as well. sm:shadow-lg isn't applying either.

from tailwindcss.

adamwathan avatar adamwathan commented on June 9, 2024

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.

brandonmcconnell avatar brandonmcconnell commented on June 9, 2024

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.

brandonmcconnell avatar brandonmcconnell commented on June 9, 2024

@adamwathan Sweet, thanks for clarifying that

from tailwindcss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.