Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

mdIcon: Add support for symbol-tags #1514

Closed
Frank3K opened this issue Feb 14, 2015 · 3 comments
Closed

mdIcon: Add support for symbol-tags #1514

Frank3K opened this issue Feb 14, 2015 · 3 comments
Assignees
Milestone

Comments

@Frank3K
Copy link
Contributor

Frank3K commented Feb 14, 2015

The current implementation of md-icon (v0.8.0-rc1-master-91053dc) does not properly handle icons wrapped in symbol-tags. It just adds the complete symbol tag:

     if (el.tagName != 'svg') {
       el = angular.element('<svg xmlns="http://www.w3.org/2000/svg">').append(el)[0];
     }

Since symbol tags are graphical template objects, they do not show unless they are instantiated by a use-tag.

Use case: the grunt-svgstore plugin merges multiple SVG's into a single SVG (see also this css-tricks post). The plugin wraps each SVG in its own symbol tag.

Possible solution: include the child nodes instead of the parent symbol tag. E.g.:

     switch (el.tagName) {
       case 'svg':
         break;
       case 'symbol':
         el = angular.element('<svg xmlns="http://www.w3.org/2000/svg">').append(el.childNodes)[0];
         break;
       default:
         el = angular.element('<svg xmlns="http://www.w3.org/2000/svg">').append(el)[0];
         break;
     }
@programmist
Copy link
Contributor

This will actually be made obsolete by #1548, which is scheduled for 1.0.0-beta. Maybe we can close this one?

@Frank3K
Copy link
Contributor Author

Frank3K commented Mar 31, 2015

I'd love to see this change land in master, such that I / others can already start using symbol-tags. When #1548 is implemented, the symbol-tags should just keep on working, but then a little better.

@ThomasBurleson
Copy link
Contributor

@programmist - if we are doing another enchancement for Icons in 1.0beta and this will be resolved by those, then let's wait.

@ThomasBurleson ThomasBurleson modified the milestones: 1.0-beta1, 0.9.0 Apr 2, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 1.0-beta1, 0.10.0 Apr 24, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 0.10.0, 0.11.0 Jun 16, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 0.11.0, REVISIT Jul 31, 2015
@ThomasBurleson ThomasBurleson added the needs: review This PR is waiting on review from the team label Jul 31, 2015
@programmist programmist modified the milestones: 1.0-beta1, REVISIT Jul 31, 2015
@programmist programmist removed the needs: review This PR is waiting on review from the team label Jul 31, 2015
@naomiblack naomiblack modified the milestones: 1.0-beta1, post-1.0 Aug 14, 2015
@naomiblack naomiblack removed this from the 1.0-beta1 milestone Aug 14, 2015
@ThomasBurleson ThomasBurleson modified the milestones: post-1.0 , Backlog Jan 5, 2016
@ThomasBurleson ThomasBurleson modified the milestones: Backlog, Deprecated Apr 20, 2016
cobisimo added a commit to cobisimo/material that referenced this issue Mar 30, 2018
Add support for SVG icon sets with symbol elements.
SVG icon sprite with symbols is most commonly produced by:
svg-sprite-loader, webpack-svgstore-plugin, gulp-svg-sprites ...
This may consider also as backport, as angular material2 project support
this kind of sets.

This change is related to angular#8689 issue and
directly related to closed issue angular#1514
cobisimo added a commit to cobisimo/material that referenced this issue Apr 10, 2018
Add support for SVG icon sets with symbol elements.
SVG icon sprite with symbols is most commonly produced by:
svg-sprite-loader, webpack-svgstore-plugin, gulp-svg-sprites ...
This may consider also as backport, as angular material2 project support
this kind of sets.

This change is related to angular#8689 issue and
directly related to closed issue angular#1514
mmalerba pushed a commit that referenced this issue Apr 17, 2018
Add support for SVG icon sets with symbol elements.
SVG icon sprite with symbols is most commonly produced by:
svg-sprite-loader, webpack-svgstore-plugin, gulp-svg-sprites ...
This may consider also as backport, as angular material2 project support
this kind of sets.

This change is related to #8689 issue and
directly related to closed issue #1514
chmelevskij pushed a commit to chmelevskij/material that referenced this issue Jun 19, 2018
Add support for SVG icon sets with symbol elements.
SVG icon sprite with symbols is most commonly produced by:
svg-sprite-loader, webpack-svgstore-plugin, gulp-svg-sprites ...
This may consider also as backport, as angular material2 project support
this kind of sets.

This change is related to angular#8689 issue and
directly related to closed issue angular#1514
Splaktar pushed a commit that referenced this issue Jul 31, 2018
Add support for SVG icon sets with symbol elements.
SVG icon sprite with symbols is most commonly produced by:
svg-sprite-loader, webpack-svgstore-plugin, gulp-svg-sprites ...
This may consider also as backport, as angular material2 project support
this kind of sets.

This change is related to #8689 issue and
directly related to closed issue #1514
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants