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

[Bug] Use material icon offline #369

Open
Alexandre-petitjean opened this issue Sep 13, 2023 · 0 comments
Open

[Bug] Use material icon offline #369

Alexandre-petitjean opened this issue Sep 13, 2023 · 0 comments

Comments

@Alexandre-petitjean
Copy link

Alexandre-petitjean commented Sep 13, 2023

Version

3.0.6

Reproduction link

https://github.com/creativetimofficial/material-dashboard/blob/master/assets/css/material-dashboard.css

Operating System

IOS

Device

laptop

Browser & Version

Firefox 117.0.1

Steps to reproduce

  1. I use the Bootstrap starter template from the doc and add the material icon exemple : <i class="material-icons">face</i>

What is expected?

I build an offline website and I want to use the material icon set. I excepte the icons to appear.

What is actually happening?

The icons do not appear.


Solution

I see that the material-icons class is in the Material-dashboard.css file but the font family 'Material Icons Round' is not defined.

I added the definition of font-family to material-dashboard.css with the missing otf file. And I have added some rules for the icon size.

The file can be found in the github repo of google material icon : https://github.com/google/material-design-icons/blob/master/font/MaterialIconsRound-Regular.otf

@font-face {
  font-family: 'Material Icons Round';
  font-style: normal;
  font-weight: 400;
  src: url(../fonts/MaterialIconsRound-Regular.otf);
}

<!-- The class was already present and was not modified -->
.material-icons {
  font-family: 'Material Icons Round';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  /* Preferred icon size */
  display: inline-block;
  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';
}

<!-- The rules I get on the material icon docs -->
.material-icons.md-18 {
  font-size: 18px;
}

.material-icons.md-24 {
  font-size: 24px;
}

.material-icons.md-36 {
  font-size: 36px;
}

.material-icons.md-48 {
  font-size: 48px;
}

Additional comments

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

No branches or pull requests

1 participant