by Benito Serna

Styler gem and Tachyons components

A list of examples from the list of Tachyons components, showing you how you can use the styler gem to define the styles composing the tachyons css classes.

< Back to index

Logo links inline

<%
  styles = Styler.new do
    style :container, %w(sans-serif dt w-100 border-box pa3 ph5-ns)
    style :logo, %w(dtc v-mid mid-gray link dim w-25)
    style :logo_img, %w(dib w2 h2 br-100)
    style :links, %w(dtc v-mid w-75 tr)
    style :link, %w(link dim dark-gray f6 f5-ns dib mr3 mr4-ns)
    style :last_link, [link - "mr3" - "mr4-ns"]
  end
%>

<nav class="<%= styles.container %>">
  <a class="<%= styles.logo %>" href="#" title="Home">
    <img alt="Site Name" class="<%= styles.logo_img %>" src="http://tachyons.io/img/logo.jpg"/>
  </a>
  <div class="<%= styles.links %>">
    <a class="<%= styles.link %>" href="#">Services</a>
    <a class="<%= styles.link %>" href="#">Blog</a>
    <a class="<%= styles.last_link %>" href="#">Join Us</a>
  </div>
</nav>