Skip to content

Instantly share code, notes, and snippets.

@matori
Created March 26, 2015 09:39
Show Gist options
  • Save matori/49a9ac06514b87bfc0de to your computer and use it in GitHub Desktop.
Save matori/49a9ac06514b87bfc0de to your computer and use it in GitHub Desktop.
Jade mixin for SVG sprite
mixin sprite(name, title, titleId, desc)
- var svgAttrObj = {};
- var titleAttrObj = {};
if titleId
- svgAttrObj['aria-labelledby'] = titleId;
- titleAttrObj['id'] = titleId;
svg&attributes(svgAttrObj)&attributes(attributes)
if title
title&attributes(titleAttrObj) #{title}
if desc
desc #{desc}
use(xlink:href="#sprite-#{name}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment