Created
March 14, 2014 04:52
-
-
Save jakebellacera/9542315 to your computer and use it in GitHub Desktop.
Dynamically calls a SASS variable by a string (e.g. var("foo" + "bar") => $foobar).
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
# To use this in your SASS project, simply load this module into | |
# your environment. | |
module Sass::Script::Functions | |
# Dynamically calls a variable by a string | |
# e.g. var("foo" + "bar") => $foobar | |
def var(name) | |
assert_type name, :String, :name | |
@environment.var(name.value) | |
end | |
declare :var, :args => [:string] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment