gadenbuie / xaringanExtra

:ferris_wheel: A playground of enhancements and extensions for xaringan slides.
https://pkg.garrickadenbuie.com/xaringanExtra
Other
448 stars 36 forks source link

Tachyons .grow[] does not work #104

Closed albert-ying closed 3 years ago

albert-ying commented 3 years ago

Hi, I enabled xaringanExtra::use_tachyons(). After explored the document of Tachyons, I found an interesting hover animation function .grow and .dim.

But when I put .grow[ text ] in the R Markdown file, it does not work. I'm wondering if this feature is supported?

gadenbuie commented 3 years ago

The .grow class uses the CSS property transform to scale up the element on hover. But transform only applies to block element, not inline elements. Since .grow[text] is rendered as <span class="grow">text</span> and spans are inline elements, the transformation won't be applied.

You can get around this by making the element an inline block element. Try using .grow.dib[text] instead.

albert-ying commented 3 years ago

Works like magic! Thank you!