tachyons-components icon indicating copy to clipboard operation
tachyons-components copied to clipboard

Hover classes don't seem to work

Open cloudonshore opened this issue 7 years ago • 3 comments

Nothing of the property/classes in this module seem to work when applied https://github.com/tachyons-css/tachyons-hovers

cloudonshore avatar Aug 17 '17 22:08 cloudonshore

I'm looking into this, yeah it's a legitimate bug (comment here acknowledging). Here's why it doesn't work:

Given:

const Span = styled('span')``

<Span grow-large>hello</Span>

A lookup for the grow-large CSS class will occur but it won't add grow-large:hover and any others to the stylesheet.

There is a grow-large:hover key in the auto-generated tachyons.json but searching for and including that sounds brittle, so as the comment indicates I think the best way to solve this is by merging stuff at the parse step.

tvararu avatar Aug 24 '17 19:08 tvararu

One workaround I found was to add the hover state once in any component, and it'll work anywhere else.

For example, if I had a button with grow grow: hover, then just using grow in any other component will work just fine.

Snazzyham avatar Aug 25 '17 10:08 Snazzyham

I found that installing tachyons in addition to tachyons-components fixed the hover classes.

cgolinski avatar Aug 22 '18 14:08 cgolinski