diff --git a/src/scope.rs b/src/scope.rs index 068b52a..fbb5192 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -56,9 +56,12 @@ impl Scope { pub fn get_var(&self, v: &str) -> SassResult { let name = &v.replace('_', "-"); - match self.vars.get(name) { - Some(v) => Ok(v.clone()), - None => get_global_var(name), + match get_global_var(name) { + Ok(v) => Ok(v), + Err(e) => match self.vars.get(name) { + Some(v) => Ok(v.clone()), + None => Err(e) + } } }