tachyons-components
tachyons-components copied to clipboard
Hover classes don't seem to work
Nothing of the property/classes in this module seem to work when applied https://github.com/tachyons-css/tachyons-hovers
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.
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.
I found that installing tachyons
in addition to tachyons-components
fixed the hover classes.