Material design icons are not displayed in the browser

I am trying to place a Google Material Design badge for my website, but I can’t get the badges displayed in Chrome or Safari.

I am using this CSS file:

@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url(/public/dist/font/Material-Design-Icons.eot); /* For IE6-8 */
  src: url(/public/dist/font/Material-Design-Icons.woff2) format('woff2'),
       url(/public/dist/font/Material-Design-Icons.woff) format('woff'),
       url(/public/dist/font/Material-Design-Icons.ttf) format('truetype');
}

.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;  /* Preferred icon size */
  display: inline-block;
  width: 1em;
  height: 1em;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;

  /* Support for all WebKit browsers. */
  -webkit-font-smoothing: antialiased;
  /* Support for Safari and Chrome. */
  text-rendering: optimizeLegibility;

  /* Support for Firefox. */
  -moz-osx-font-smoothing: grayscale;

  /* Support for IE. */
  font-feature-settings: 'liga';
}

Pulling a file:

link(rel="stylesheet", href="/public/dist/css/font.css")

What I see in the browser is loading

The font itself is even loaded onto the page, I see the .woff file on the network tab in Chrome.

This is a folder structure publicthat is hosted on the server as "is is".

a shared folder

I use the font here (jade):

i.material-icons.prefix perm_identity

And I see that the CSS class above applies to this element

But fonts are not displayed.

EDIT: People here have the same problem: https://github.com/google/material-design-icons/issues/205

+4
2

- materializecss.com, , Google GH,

+2

Google -. https://google.imtqy.com/material-design-icons/ , - Google. . -, - , .

+1

Source: https://habr.com/ru/post/1624984/


All Articles