Skip to content

Instantly share code, notes, and snippets.

@jakebellacera
Created March 14, 2014 04:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakebellacera/9542315 to your computer and use it in GitHub Desktop.
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).
# 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