Skip to content

Instantly share code, notes, and snippets.

@XOP
Created April 9, 2015 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XOP/ef8f2ade592d130f9bc3 to your computer and use it in GitHub Desktop.
Save XOP/ef8f2ade592d130f9bc3 to your computer and use it in GitHub Desktop.
GPU render stylus mixin
//
// render in separate layer
// hack to balance CPU/GPU load
// usage gpuRender(chrome, mac-chrome)
gpuRender($browsers){
$i = 0;
$comma = ",";
$rule = "";
for $b in arguments {
$i += 1;
if ($i == length(arguments)){
$comma = "";
}
$rule += unquote(".") + $b + unquote(" &") + unquote($comma);
}
{$rule} {
backface-visibility: hidden;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment