StackExchange / Stacks

Stack Overflow’s Design System
https://stackoverflow.design
MIT License
610 stars 90 forks source link

Better `s-card` hover states #90

Closed hellohynes closed 5 years ago

hellohynes commented 6 years ago

Initially posted by Piper in the Stacks Slack room:

I have some concerns regarding .s-card. The hover state on the cards isn’t very recognizable. I’m not really sure why a card wouldn’t need an obvious hover state, to be honest. It either needs a hover state (and should be obvious) or it doesn’t.

Anywho, I ran into the cards on this page a couple weeks ago and was excited that there seemed to be some sort of alternate option for cards that needed a more obvious hover state: https://stackoverflow.com/jobs/salary/results?l=Columbus%2c+OH%2c+United+States&ed=0&ex=2&ff=1&dr%5B0%5D=DataScientist&tl%5B0%5D=

I went looking at stacks to find how I could implement the shadow on hover and the way the documentation is written, it seems like I can do such a thing

When applying a .bs-* class with a .s-card component, a :hover style is added to the base .bs-* box shadow.

If the above statement is true, then why would there be a .bs-hover class? Well, I was hoping that it would do what the class says it would do… apply a border-shadow on hover. But apparently this class is attached to the .bs-* classes, which is silly because the documentation says there already will be a shadow increase on hover.

Basically, I’m asking that you move the .bs-hover be attached to only the .s-card class. I can think of at least 3 situations where this would be useful. Including the example I sent you earlier which is currently using custom CSS to implement the shadow.

TedGoas commented 5 years ago

Addressed here