Skip to content

Instantly share code, notes, and snippets.

@xzyfer
Created February 4, 2014 11:40
Show Gist options
  • Select an option

  • Save xzyfer/8802191 to your computer and use it in GitHub Desktop.

Select an option

Save xzyfer/8802191 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
@function global-function($name) {
@return "hello " + $name;
}
@mixin global-mixin($name) {
normal-global: global-function($name);
call-global: call("global-function", $name);
/* This makes total sense since `scoped-function` is well.. scoped */
normal-scoped: scoped-function($name);
call-scoped: call("scoped-function", $name);
}
.test-scoped {
@function scoped-function($name) {
@return "hello " + $name;
}
@mixin scoped-mixin($name) {
normal-global: global-function($name);
call-global: call("global-function", $name);
/* if this works */
normal-scoped: scoped-function($name);
/* shouldn't this aswell? */
call-scoped: call("scoped-function", $name);
}
@include scoped-mixin("world");
}
.test-global {
@include global-mixin("world");
}
.test-scoped {
normal-global: "hello world";
call-global: "hello world";
/* if this works */
normal-scoped: "hello world";
/* shouldn't this aswell? */
call-scoped: scoped-function("world");
}
.test-global {
normal-global: "hello world";
call-global: "hello world";
/* This makes total sense since `scoped-function` is well.. scoped */
normal-scoped: scoped-function("world");
call-scoped: scoped-function("world");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment