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

mdIcon: Icons based on SVG, font-faces, and CSS #1042

Closed
ThomasBurleson opened this issue Dec 23, 2014 · 15 comments
Closed

mdIcon: Icons based on SVG, font-faces, and CSS #1042

ThomasBurleson opened this issue Dec 23, 2014 · 15 comments
Assignees
Milestone

Comments

@ThomasBurleson
Copy link
Contributor

A suite of icons should be support within Angular Material. Many components (BottomSheet, Lists, Cards, Chips, FABs, etc.) will use md-icon as a child element.

screen shot 2014-12-23 at 1 24 39 pm
toolbar_icons
keyboard_icons

Icon Types

While Material Design icons come with SVG and CSS sprites for various resolutions, the full set of icons is enumerated below:

  • SVG
  • Animated SVG
  • Color SVG
  • Font Faces
  • PNG
  • JPEG

A live preview of all icons in the Material-Icons repository is shown here: Live Preview

screen shot 2014-12-23 at 1 26 37 pm

Visual requirements:

- Font-icons only - class name used to specify desired icon; e.g. `` - Hover effects to animate, colorize, etc. - Media support for responsive changes - Support for Dark themes

Functional requirements:

- Ability to use remote SVG, PNG, or JPEG resources - Ability to use embedded (aka inlined) resources

Questions:

- How can developers easily select a subset of icons for their needs? - How can developers easily embedded their own SVGs ? - Can we provide a template and a batch gulp tool to easily embedded a first-pass rendition of 1..n remote SVGs ? - How will the icons be deployed as part of Angular Material releases ? - Will Theming impact icon choices (colors) ? ### Additional Resources - [FlatIcon](http://www.flaticon.com/packs/material-design) - [SVG Animations and CSS Transforms](http://css-tricks.com/svg-animation-on-css-transforms/) - http://www.filamentgroup.com/lab/bulletproof_icon_fonts.html - http://www.sitepoint.com/tips-accessible-svg/ ### Version 2 Wishlist - SVG support for colors and animations - Multi-state icons may be needed where each state is represented by animated SVGs - See [FAB with Progress Indicators](http://material-design.storage.googleapis.com/publish/v_2/material_ext_publish/0B0NGgBg38lWWbTlSaHdQZEMtalk/components-progressactivity-typesofindicators-061101_Circular_Aspirational_xhdpi_002.webm) - State features are not for user-interactions but rather for icon animations. - More information is needed about transitions between animation states of icons - State support; where each state display an icon visualization. State changes update visuals. - This would be very powerful...

Here is a sample of states with md-icon

 <md-icon>
  <md-icon-state state="start" src="" />
  <md-icon-state state="animated" src="" />
  <md-icon-state state="done" src="" />
</md-icon>

Design Doc

A Google design document will be prepared to present issues, constraints, solutions, and impacts.

@ThomasBurleson
Copy link
Contributor Author

Aria Considerations

If no label is required on <md-icon> itself, this creates potential ARIA issues leaving the parent element responsible for labeling (and throwing errors).

For example:

<md-button class="md-fab md-primary">
  <md-tooltip>
    Refresh
  </md-tooltip>
  <md-icon icon="ic_refresh"></md-icon>
</md-button>

This fails for accessibility because <md-tooltip> does not provide an accessible name for <md-button>. This should be the responsibility of <md-icon>, either by providing aria-label or some other labeling mechanism.

If we enforce aria-label on <md-icon>, we will need to update $mdAria.expect to check for aria-label on child nodes.

Opened issue #567.

@ilanbiala
Copy link
Contributor

@ThomasBurleson will this depend on angular-material-icons?

@CICCIOSGAMINO
Copy link

Actually i use the directive md-icon like this :

 <md-icon icon="bower_components/material-design-icons/action/svg/design/ic_android_24px.svg"></md-icon>

how can set a different color or size in md-icon ?

@marcysutton
Copy link
Contributor

Should we leave SVG out of @font-face resources? @robertmesserle mentioned using it for anti-aliasing in Chrome/IE, but it is being deprecated in Chrome (and possibly Firefox). https://groups.google.com/forum/#!topic/icomoon/ttjKOE7fEv8

Inline SVG is good as long as we expose alternate text.

@ThomasBurleson
Copy link
Contributor Author

As recently discussed, we will still support Javascript overrides for SVG content in mdIcons.
But that will be part #2. Part #1 will support font faces.

@cristiano-belloni
Copy link

Also, http://materialdesignicons.com/ - cool icons drawn by the community.

@justindujardin
Copy link

There are a few material design icons that will not convert well to fonts: the editor color selection icons and the device wifi/signal/battery icons. Will these be supported in some way?

@calidion
Copy link

i would like to know how to incorporate fontawesome icons into md-icon.

@ThomasBurleson
Copy link
Contributor Author

Using FontAwesome with <md-icon />: CodePen Demo

@calidion
Copy link

great.

@utopiaio
Copy link

i don't know whether or not i should create an issue, but when going through 0.8.0-rc1, the md-icon used on md-tabs is barely visible on iOS devices
ios simulator screen shot feb 16 2015 15 57 18

@3Pi
Copy link

3Pi commented May 29, 2015

What is the right way for using material icons (as shown on Google Material Design Icons in a md-button ?
Ligatures are OK wherever else but in md-buttons and I didn't find out how to use md-font-icon properly...

@edaquinta
Copy link

Hey, I know this issue is closed but I still don't get how I can use the Material Icons (http://google.github.io/material-design-icons/) with the directive in a seamless way. I think I still need some CSS individual classes to use md-font-icon right?

@edaquinta
Copy link

btw, I create my own approach:

CSS

.menu:after { content: "\E5D2" }

HTML

< md-icon md-font-icon="menu" >< /md-icon >

so I define the icons I'll be using but probably I working double, maybe there is a better way, but I didn't find it cause I don't wanna use the svg, just the web font.

@ThomasBurleson
Copy link
Contributor Author

@edaquinta plz open a new issue.
@Moe-Szyslak - do you still have this issue with the code in master? If yes, plz open a new issue with a Demo.
@3Pi - Please post this in the Angular Material Forum

@angular angular locked and limited conversation to collaborators May 29, 2015
@angular angular locked and limited conversation to collaborators May 29, 2015
@angular angular locked and limited conversation to collaborators May 29, 2015
Akxe pushed a commit to Akxe/material that referenced this issue Apr 28, 2024
- update StackBlitz for v13-next
- update firebase-tools
- fix dependabot issues
- update to `marky@1.2.2` to support NodeJS 16.x

Closes angular#1038. Closes angular#1040. Closes angular#1042.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests