foundation-emails
foundation-emails copied to clipboard
Don't add first/last classes if they already exist
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?
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?
Ran into this today also. @rafibomb I think your suggestion sounds excellent.
+1