foundation-emails icon indicating copy to clipboard operation
foundation-emails copied to clipboard

Don't add first/last classes if they already exist

Open danherd opened this issue 7 years ago • 3 comments

I am using dir="rtl" on a wrapper to reverse the ordering of columns. It works fine, but obviously the column margins are wrong.

I have tried manually adding class="last" to the first column and class="first" to the last column. This works, but not entirely as Foundation also adds the 'first' class to the first column and the 'last' class to the last column.

Here's my INKY code:

<wrapper class="product" dir="rtl">
  <row>
    <columns small="6" large="3" dir="ltr" class="last">
      <img src="#">
    </columns>
    <columns small="6" large="3" dir="ltr" class="first">
      <p>Some Text</p>
    </columns>
  </row>
</wrapper>

This produces the following HTML:

<table dir="rtl" class="wrapper product" align="center">
  <tbody>
    <tr>
      <td class="wrapper-inner">
        <table class="row">
          <tbody>
            <tr>
              <th class="last small-6 large-3 columns first" dir="ltr">
                <table>
                  <tbody>
                    <tr>
                      <th>
                        <img src="#">
                      </th>
                    </tr>
                  </tbody>
                </table>
              </th>
              <th class="first small-6 large-3 columns last" dir="ltr">
                <table>
                  <tbody>
                    <tr>
                      <th>
                        <p>Some Text</p>
                      </th>
                    </tr>
                  </tbody>
                </table>
              </th>
            </tr>
          <tbody>
        </table>
      </td>
    </tr>
  </tbody>
</table>

As you can see, despite me manually adding the first and last classes, they are also added by Foundation. Could it be made so if these classes already exist, Foundation does not add them?

danherd avatar Apr 28 '17 14:04 danherd

Hmm. I understand the concept you are going for here - and I think this is something Inky can handle better for us.

I think Inky should swap the classes .first and .last for us when it sees dir="rtl"

Thoughts?

rafibomb avatar Apr 28 '17 15:04 rafibomb

Ran into this today also. @rafibomb I think your suggestion sounds excellent.

sambaldwin avatar Jun 12 '17 19:06 sambaldwin

+1

ghost avatar Feb 08 '18 13:02 ghost