Created
March 26, 2015 09:39
-
-
Save matori/49a9ac06514b87bfc0de to your computer and use it in GitHub Desktop.
Jade mixin for SVG sprite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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