Log1x / sage-svg

A simple package for using inline SVGs with Sage 10.

Home Page:https://github.com/log1x/sage-svg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic classes ?

Tartamata opened this issue · comments

Hello,
Is there a way to add dynamic classes ?
Example: (:class="{'rotate-180': open, 'rotate-0': !open}")
Im trying to achieve this:
<svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>

Not at the moment. You would have to put that on a span wrapper or something instead.

Any example please ?

Just a container around the SVG like:

<span :class="{'rotate-180': open, 'rotate-0': !open}">
  @svg('arrow-right')
</span>

Great
Thank you