Last active
August 28, 2015 04:06
-
-
Save jina/02bf4458b37e0125a182 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# data/prefix.yml | |
css: "slds-" | |
# helpers/ds_helpers.rb | |
module DsHelpers | |
def pf(*classes) | |
classes.map! { |x| "#{data.prefix.css}#{x}" }.join(' ') | |
end | |
end | |
# in html wherever | |
<p class="<%= pf 'foo', 'goo', 'boo' %>"> | |
Some content text | |
</p> | |
<hr class="<%= pf 'bar', 'har', 'yar' %>" /> | |
# output in view source | |
<p class="slds-foo slds-goo slds-boo"> | |
Some content text | |
</p> | |
<hr class="slds-bar slds-har slds-yar" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Big thanks to @brixen & @swrainey for the pointers.