Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are the new themes of icons available on Google Fonts? #773

Closed
steventango opened this issue May 12, 2018 · 82 comments
Closed

Are the new themes of icons available on Google Fonts? #773

steventango opened this issue May 12, 2018 · 82 comments

Comments

@steventango
Copy link

Recently four new themes of icons are available: outlined, rounded, two tone, and sharp. Are these available on Google fonts? If not is there a timeline on when they will be added? Thanks.

@WizardPC
Copy link

Interrested too !

@ncovercash
Copy link

Please this! With the introduction of themes themes are now required in order to use the outlined version of several important icons, such as grade. I'd like most if a class could be added to change the theme, however, adding a prefix/suffix would be great too!

@axdemelas
Copy link

axdemelas commented May 22, 2018

Maybe with (BEM) modifiers:

<i class="material-icons">dashboard</i>

<i class="material-icons material-icons--outline">dashboard</i>

@ncovercash
Copy link

ncovercash commented May 22, 2018

@ahlechandre Looks good! For the CSS from google fonts, it shouldn't be too hard. Just like:

/* Default from https://fonts.googleapis.com/css?family=Material+Icons */
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* Added */
.material-icons.material-icons--outline {
  font-family: 'Material Icons Outline';
}

Shouldn't be a complex change, would just need to serve multiple fonts.

@richardriman
Copy link

+1

3 similar comments
@ChillkroeteTTS
Copy link

+1

@RemusGrigorescu
Copy link

+1

@dunxen
Copy link

dunxen commented May 29, 2018

+1

@devhitech
Copy link

+1

4 similar comments
@nrone
Copy link

nrone commented Jun 7, 2018

+1

@Ghkuijer
Copy link

Ghkuijer commented Jun 7, 2018

+1

@udscbt-wsx
Copy link

+1

@ThePlastic
Copy link

+1

@ViAndersson
Copy link

Most of you probably know this, but you can actually access a couple of icons in the outlined theme. To use them with web-fonts you simply use:
<i class="material-icons">lock_outline</i>

instead of:
<i class="material-icons">lock</i>

To find whether or not an icon is available in the outlined theme simply search the github repo for icons with _outline_24px.svg in their file name.

It's not a lot, but at least it's something.

Brgds

@fc-janharold
Copy link

How about the rounded theme? Anybody managed to make it work? Tried @smileytechguy's approach, didn't worked.

@marcoocram
Copy link

+1

1 similar comment
@joe-kimlinger
Copy link

+1

@ncovercash
Copy link

@fc-janharold My "approach" was simply a suggestion as to how the team at Google could serve these icons without breaking backwards compatibility or making things awkward. It hasn't been implemented (and may not ever be)

@TallOrderDev
Copy link

+1

3 similar comments
@iamstevendao
Copy link

+1

@robrwo
Copy link

robrwo commented Jun 22, 2018

+1

@marceloromaomultilaser
Copy link

+1

@stephengardner
Copy link

+1, subbed. Outlines look like a fantastic addition

@fc-janharold
Copy link

Oh, I thought it's already working. @smileytechguy, thanks for the clarification.

@philmarc
Copy link

+1

@carlosrovira
Copy link

High Josh, great news! I think many people here (and outside) are waiting for this, so great to hear that you're working on this. So keep up the great work!, we'll wait for this to happen! :)
Thanks

@artiomchi
Copy link

Sorry, holding my breath anyway. This is somewhat frustrating :(

@PRR24
Copy link

PRR24 commented Oct 11, 2018

No sure why this request has turned out to be too complex to handle.
If this is because of some characters are not ready yet, couldn't it be (initially) released with fallback, eg:
https://fonts.googleapis.com/css?family=Material+Icons+Outlined =>

.material-icons {
  font-family: 'Material Icons Outlined', 'Material Icons';
  ...

This would allow taking existing icons into use while the team has time to fill missing gaps.

@malav93
Copy link

malav93 commented Nov 12, 2018

Hey folks, the font is actually available. Looks like the spec hasn't been finalized yet? We need to wait for them to finalize, test, publish, etc.

I am not sure what the spec is going to look like but for those who want to have a non-spec implementation, you could do the following to match what the material icons website does:

Import the following 6 style sheets made available on the material icons page:

* https://storage.googleapis.com/non-spec-apps/mio-icons/latest/styles.css

* https://storage.googleapis.com/non-spec-apps/mio-icons/latest/baseline.css

* https://storage.googleapis.com/non-spec-apps/mio-icons/latest/sharp.css

* https://storage.googleapis.com/non-spec-apps/mio-icons/latest/outline.css

* https://storage.googleapis.com/non-spec-apps/mio-icons/latest/round.css

* https://storage.googleapis.com/non-spec-apps/mio-icons/latest/twotone.css

Then use the same markup as the website (seems to be similar to fontawesome?)

<i class="baseline-router icon-image-preview"></i>
<i class="outline-router icon-image-preview"></i>
<i class="round-router icon-image-preview"></i>
<i class="twotone-router icon-image-preview"></i>
<i class="sharp-router icon-image-preview"></i>

Here is a sample HTML file that demonstrates what is needed.

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Material Icons</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500">
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" href="https://storage.googleapis.com/non-spec-apps/mio-icons/latest/styles.css">
    <link rel="stylesheet" href="https://storage.googleapis.com/non-spec-apps/mio-icons/latest/baseline.css">
    <link rel="stylesheet" href="https://storage.googleapis.com/non-spec-apps/mio-icons/latest/sharp.css">
    <link rel="stylesheet" href="https://storage.googleapis.com/non-spec-apps/mio-icons/latest/outline.css">
    <link rel="stylesheet" href="https://storage.googleapis.com/non-spec-apps/mio-icons/latest/round.css">
    <link rel="stylesheet" href="https://storage.googleapis.com/non-spec-apps/mio-icons/latest/twotone.css">
    <style>
        .pad {
            padding: 10px;
        }

        .round-corners {
            border-radius: 8px;
        }

        .my-0 {
            margin-top: 0px;
            margin-bottom: 0px;
        }

        .underline {
            width: 100px;
            height: 2px;
            border-radius: 1px;
            background-color: currentColor;
            margin-top: 12px;
        }
    </style>
</head>

<body class="mdc-typography">
    <header class="mdc-toolbar mdc-toolbar--fixed demo-toolbar">
        <div class="mdc-toolbar__row">
            <section class="mdc-toolbar__section mdc-toolbar__section--align-start">
                <span class="mdc-toolbar__title">Material Icons</span>
            </section>
        </div>
    </header>
    <main>
        <div class="mdc-toolbar-fixed-adjust">
            <div class="demo-grid mdc-layout-grid">
                <div class="mdc-layout-grid__inner">
                    <div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone mdc-elevation--z2 pad round-corners">
                        <div class="mdc-list-group">
                            <h3 class="mdc-list-group__subheader">Imports</h3>
                            <div class="mdc-list-group__subheader underline"></div>
                            <ul class="mdc-list">
                                <li class="mdc-list-item">Import the following 6 stylesheets made available by google:</li>
                                <li class="mdc-list-item">https://storage.googleapis.com/non-spec-apps/mio-icons/latest/styles.css</li>
                                <li class="mdc-list-item">https://storage.googleapis.com/non-spec-apps/mio-icons/latest/baseline.css</li>
                                <li class="mdc-list-item">https://storage.googleapis.com/non-spec-apps/mio-icons/latest/outline.css</li>
                                <li class="mdc-list-item">https://storage.googleapis.com/non-spec-apps/mio-icons/latest/round.css</li>
                                <li class="mdc-list-item">https://storage.googleapis.com/non-spec-apps/mio-icons/latest/twotone.css</li>
                                <li class="mdc-list-item">https://storage.googleapis.com/non-spec-apps/mio-icons/latest/sharp.css</li>
                            </ul>
                            <h3 class="mdc-list-group__subheader">Filled/Baseline</h3>
                            <div class="mdc-list-group__subheader underline"></div>
                            <ul class="mdc-list demo-list">
                                <li class="mdc-list-item">&lt;i class=&quot;baseline-router icon-image-preview&quot;&gt;&lt;/i&gt;</li>
                                <li class="mdc-list-item"><i class="baseline-router icon-image-preview"></i></li>
                            </ul>
                            <h3 class="mdc-list-group__subheader">Outline</h3>
                            <div class="mdc-list-group__subheader underline"></div>
                            <ul class="mdc-list demo-list">
                                <li class="mdc-list-item">&lt;i class=&quot;outline-router icon-image-preview&quot;&gt;&lt;/i&gt;</li>
                                <li class="mdc-list-item"><i class="outline-router icon-image-preview"></i></li>
                            </ul>
                            <h3 class="mdc-list-group__subheader">Round</h3>
                            <div class="mdc-list-group__subheader underline"></div>
                            <ul class="mdc-list demo-list">
                                <li class="mdc-list-item">&lt;i class=&quot;round-router icon-image-preview&quot;&gt;&lt;/i&gt;</li>
                                <li class="mdc-list-item"><i class="round-router icon-image-preview"></i></li>
                            </ul>
                            <h3 class="mdc-list-group__subheader">Two-Tone</h3>
                            <div class="mdc-list-group__subheader underline"></div>
                            <ul class="mdc-list demo-list">
                                <li class="mdc-list-item">&lt;i class=&quot;twotone-router icon-image-preview&quot;&gt;&lt;/i&gt;</li>
                                <li class="mdc-list-item"><i class="twotone-router icon-image-preview"></i></li>
                            </ul>
                            <h3 class="mdc-list-group__subheader">Sharp</h3>
                            <div class="mdc-list-group__subheader underline"></div>
                            <ul class="mdc-list demo-list">
                                <li class="mdc-list-item">&lt;i class=&quot;sharp-router icon-image-preview&quot;&gt;&lt;/i&gt;</li>
                                <li class="mdc-list-item"><i class="sharp-router icon-image-preview"></i></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </main>
</body>

</html>

This is just a hack, not an efficient way of using it. The solution is simply addind background-image, that we can do in general css, so no need to import such large css in our project. Just get css & png images of the icons from these files and use it.

@Atulin
Copy link

Atulin commented Nov 18, 2018

Definitely not an ideal solution, since it uses png instead of svg.

At this point it might be a good idea to simply download all the csv icons, pop them into Icomoon and use that.

@petergng
Copy link

Got tired of this issue and just fixed the font myself with some help around the forum. you can specify each style via ligatures and loading the font. Can find errthang here: https://peter.ng/material-icons

demo mov

material-icon-gen-doc mov

@carlosrovira
Copy link

Hi Peter,

thanks for sharing, very interesting :)
About two color icons, can we use with your font? thanks

@Atulin
Copy link

Atulin commented Nov 26, 2018

Doing god's work Google didn't do, thank you!

@petergng
Copy link

About two color icons, can we use with your font? thanks

I'm not sure if fonts have a capability for handling multicolor? But if you have a reference i'm sure we could make that happen. Another thought would be to split out a material_multi_fg and material_multi_bg and make someone specify the two fonts overlayed

@carlosrovira
Copy link

Hi Peter,
didn't think in font support for two-tone fonts, maybe can't be doable.
I should investigate that as I have some free time (nothing soon I'm afraid), maybe something in the terms you comment about some js-css where we have 2 fonts overlapped could be a way...
Thanks for your comments :)

@MarcusCalidus
Copy link

MarcusCalidus commented Dec 15, 2018

For use with Angular Material (7+) you could use https://www.npmjs.com/package/ts-material-icons-svg.

@cguilhermef
Copy link

Hi guys! I do this:

https://github.com/cguilhermef/material-icons-outline

Just using Icomoon, uploading all of the svg icons, some configuration and... well, now you have the outlined version.

@EdricChan03
Copy link

EdricChan03 commented Feb 27, 2019

No sure why this request has turned out to be too complex to handle.
If this is because of some characters are not ready yet, couldn't it be (initially) released with fallback, eg:
https://fonts.googleapis.com/css?family=Material+Icons+Outlined =>

.material-icons {
  font-family: 'Material Icons Outlined', 'Material Icons';
  ...

This would allow taking existing icons into use while the team has time to fill missing gaps.

(See #773 (comment))

It appears that the link you added actually works (EDIT: as in it shows a font declaration), but there's currently no CSS defined for a class. EDIT (10 Mar 2019): There are now CSS classes for the new font icons.

After a few minutes of manually checking the links for the other Material icon variants, they all work but also have no CSS classes defined. EDIT (10 Mar 2019): There are now CSS classes for the new font icons.

I also have created a Codepen confirming that the icons are rendering correctly.

https://codepen.io/Chan4077/pen/bZNyQG

@Rodrigocoelhojr
Copy link

@Chan4077 that is wonderful and very helpful, thanks!

However, I cannot color the outlined fonts, or any other versions! It is always black.

I edited your Codepen to show my example, note how only the baseline is red:
https://codepen.io/rodrigocoelhoc/pen/bZjxrr

Anyone knows why? or have a workaround using the official https://fonts.googleapis.com/css?family=Material+Icons+Outlined ?

Thanks!

@KaelWD
Copy link

KaelWD commented Mar 20, 2019

Everything except two-tone is red for me. Both firefox 65 and chrome 72 on linux.

@Rodrigocoelhojr
Copy link

@KaelWD really? you are not seeing the outline (and all the others) in Black and White?

Screen Shot 2019-03-20 at 13 38 40

@KaelWD
Copy link

KaelWD commented Mar 20, 2019

weird

image

@anckaertr
Copy link

@KaelWD, is that in Windows / OSX ?

@amedviediev
Copy link

Have the same issue with icon colors in Chrome and Firefox on Mac OS. However, the color works as expected in Safari and on all browsers on Windows.

@jstgermain
Copy link

@petergng what font application do you use?

@EdricChan03
Copy link

EdricChan03 commented Mar 28, 2019

@Rodrigocoelhojr @KaelWD Testing the color CSS property on the font icons has revealed that they support the color property with the exception of the two-tone icons.

@sphism
Copy link

sphism commented Apr 23, 2019

The two tone font can't use color:red but it should be able to use fill:red (but that doesn't work) Looking in chrome dev tools the fill is set to black, rgb(0,0,0) ... You can however use some filters, but not all filter: invert(1) for white, filter: invert(0.5) for grey ... bad sadly you can't seem to filter:sepia(1) invert(0.5) hue-rotate(45deg); to get a custom color....

Oh Nice

Colored Two Tone Material Design icons:

.material-icons-two-tone {
  // Bright blue icons
  filter: invert(0.5) sepia(1) saturate(10) hue-rotate(180deg);
}

Without hue-rotate the saturated sepia color will be orange, then you just hue-rotate it to whatever color you want. Reduce the saturate value for duller tones.

Codepen: https://codepen.io/sphism/pen/xeaGPW

colored_two_tone_material_design_icons

@EdricChan03
Copy link

EdricChan03 commented Sep 12, 2019

As of today, it seems that the Material.io Icons website is now using the icon fonts instead of the former method:

Screenshot of Material.io Icons website with Chrome DevTools open

The SVG/PNG exports for an icon are now pinpointing to the resource where it is hosted (at Google Fonts):

Screenshot of Material.io Icons website on Export Icon view

Looking at the XHR requests for the site, it seems that the icons are retrieved from this URL: https://fonts.google.com/metadata/icons (P.S. This is a slightly malformed JSON file, just remove the preceding malformed data - )]}')

Here's what the file looks like without the preceding malformed data (shortened):

{
  "host": "fonts.gstatic.com",
  "asset_url_pattern": "/s/i/{family}/{icon}/v{version}/{asset}",
  "families": [
    "Material Icons",
    "Material Icons Outlined",
    "Material Icons Round",
    "Material Icons Sharp",
    "Material Icons Two Tone"
  ],
  "icons": [
    {
      "name": "360",
      "version": 1,
      "unsupported_families": [],
      "categories": [
        "maps"
      ],
      "tags": []
    },
    {
      "name": "3d_rotation",
      "version": 1,
      "unsupported_families": [],
      "categories": [
        "action"
      ],
      "tags": []
    },
    // ...
  ]
}

(See the metadata file for more info)


Attachments:

@zainulabedin-abs
Copy link

hot to get outlined fonts ??

@EdricChan03
Copy link

The new font files can now be found in the font directory, introduced as part of #1055 🎉.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests