I want to bundle @mdi/font icons into my app (it's an Electron app).
I installednpm i @mdi/font --save-dev
:
"devDependencies": { "@mdi/font": "^7.0.96", }
Then I imported the css/scss and I tried a few different methods:
main.ts
:import '@mdi/font/css/materialdesignicons.css';
main.scss
:@import './node_modules/@mdi/font/scss/materialdesignicons.scss';
base.css
:@import './node_modules/@mdi/font/css/materialdesignicons.css';
Then I used mdi-* css classes in the markup:
SideMenu.vue:
The application starts and runs but I see the same icon.
Things to consider:
Answering my own question. Thanks @Duannx, the solution is very simple - just add the missing
mdi
class:Nothing specific to vite/vue/electron :)