marella / material-icons

Latest icon fonts and CSS for self-hosting material design icons.
https://marella.github.io/material-icons/demo/
Apache License 2.0
305 stars 36 forks source link

Help with mixins, icons not showing #14

Closed JorgeSibrian14 closed 3 years ago

JorgeSibrian14 commented 4 years ago

I'm usign laravel 6 that work with webpack, i do this imports on app.scss: //material-icons $material-icons-font-path: '~material-icons/iconfont/'; @import '~material-icons/iconfont/material-icons.scss'; @import '~material-icons/iconfont/codepoints.scss'; @import '~material-icons/iconfont/mixins.scss'; @import '~material-icons/iconfont/variables.scss'; @import '~material-icons/css/material-icons.scss'; I add more imports than you recomend. And then i use this to put an icon in a button, just for trying: image I run: npm run dev(and i use too: npm run watch), and reload deleting cache from browser and i get this: image The material icons when i use the span tag is working well, but when i use the mixins that happens. Can you help me please?

marella commented 3 years ago

Sorry for the late response. You might be missing the .material-icons class. You can add it to the button class but it is not recommended:

.btn-secondary:before {
  @extend .material-icons;
}

It is better to display the icon using a separate element instead of modifying a common class:

<button class="btn-secondary"><span class="material-icons">face</span>...</button>