Closed Kriesse closed 7 years ago
Cool, this is an interesting pattern. I like the idea of using sprites vs icon fonts just for the ability to use aria properties alone.
I'm curious (and maybe a little skeptical) how yo-yo and the use element will work together since it sounds like use element is a little sketchy. The svg-react article says React doesn't need use, and I can probably figure out a way for us not to need it either. The pattern of having the SVGs be re-usable components (as in the svg-react article) is cool, although obviously we'd have to translate from JSX to plain vanilla JS/HTML.
I wouldn't want to spend a horrible amount of time on this, but if it is doable within a reasonable timeframe then I am down.
I started to work on an svg icon system in this branch, following this pattern.
Still to do:
@laurengarcia Can you help me out here^? Maybe all of this shouldn't happen in this module anyway, but per each project that uses it?
We’ll need an icon system that allows us to easily add and update icons and re-use them across projects.
I'd like a system where we
/svg
<symbol>
s into one big SVG sprite<symbol>
s can then be referenced in in the markup via<use>
, which also allows styling via CSSSee this article for details*: https://css-tricks.com/svg-sprites-use-better-icon-fonts/
Maybe we also don’t need the whole sprite system, but can do something like this? https://css-tricks.com/creating-svg-icon-system-react/
I'd need help with both approaches. Feedback welcome!
/cc @laurengarcia
*some good extended reading on svg sprites and styling them: https://css-tricks.com/svg-symbol-good-choice-icons/ https://css-tricks.com/gotchas-on-getting-svg-into-production/ http://tympanus.net/codrops/2015/07/16/styling-svg-use-content-css/