Skip to content

Instantly share code, notes, and snippets.

@aderaaij
Created October 6, 2017 13:54
Show Gist options
  • Save aderaaij/e540120caa191f0a7dce5ba36a6fa7de to your computer and use it in GitHub Desktop.
Save aderaaij/e540120caa191f0a7dce5ba36a6fa7de to your computer and use it in GitHub Desktop.
mixin svg(id, viewbox, className)
if viewbox
svg(viewbox='#{viewbox}', class!=className)
use(xlink:href='assets/img/sprite.svg#' + id)
else
svg(viewbox='0 0 50 50', class!=className)
use(xlink:href='assets/img/sprite.svg#' + id)
//- Usage: +svg('symbolID', 'viewbox parameters', 'classnames')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment