Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

feat(icon): svg icons with styles and simple img elements #1288

Closed
wants to merge 7 commits into from
Closed

feat(icon): svg icons with styles and simple img elements #1288

wants to merge 7 commits into from

Conversation

justindujardin
Copy link

Update the md-icon directive to support CSS styling and loading of .svg file icons directly. Add documentation, tests, and examples.

Questions:

  • the directive currently defaults to render icons as svg so that styling may be applied to svg elements. is it better to default to the img rendering, which would pollute the dom less but not svg element styling?
  • sizing of the svg/img elements that are rendered seems to be unintuitive. e.g. if you use CSS to size the md-icon element, the svg or img child elements won't always size as expected. does it make sense to size the child elements to fit the parent md-icon container?
  • what is the desired behavior when an icon url is invalid? should this case be handled, and how?

 - Use XMLHttpRequest to load SVG as XML and inject into directive.  Note this will not support executing attached SVG scripts.
 - Use <img> element to load as static (not CSS style capable) SVG images.  This may be desirable in situations dealing with many copies of complex SVG icons, to avoid exploding the element count in the DOM.
- to allow loading resources for component directives that require them.
- proxy config/fixtures path to /fixtures/ in tests.
- load an svg icon from the fixtures path and verify it is properly embedded in icon container.
- enable jsdocs blocks to show page in docs site.
- reformat directive definition to model after button.
- update styles to apply to img and svg elements.
-
- dry up tests with a setup fixture to make implementing more of them simple.
- embed icon as svg or img.
- embed icon as svg and manipulate with CSS filters.
- embed icon as svg and manipulate particular svg elements with CSS.
- add border color media icon to demonstrate styling svg child elements.
- fixes issue where svg icon ends up being the viewport height on firefox.
@ThomasBurleson ThomasBurleson modified the milestone: Backlog Jan 26, 2015
@marcysutton
Copy link
Contributor

mdIcon is currently being rewritten, so this might all be irrelevant very soon: #1042

@ThomasBurleson can you provide some input?

@Splaktar Splaktar removed this from the - Backlog milestone Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants