How do I add Google Material Icons into MVC Net Core Project? I followed these directions in my project folder by adding all the zip files. Just curious what is next step?
/
npm install material-design-icons
This link below is outdated.
How to use Material-UI in asp mvc project
Currently Using MVC Core Net Core 2.2.Company does not want to apply CDN URL route.
How do I add Google Material Icons into MVC Net Core Project? I followed these directions in my project folder by adding all the zip files. Just curious what is next step?
https://google.github.io/material-design-icons/
npm install material-design-icons
This link below is outdated.
How to use Material-UI in asp mvc project
Currently Using MVC Core Net Core 2.2.Company does not want to apply CDN URL route.
Share Improve this question edited Jul 23, 2019 at 22:17 jerrythomas38 asked Jul 23, 2019 at 21:13 jerrythomas38jerrythomas38 7695 gold badges17 silver badges43 bronze badges 2- 1 nuget/packages/MaterialDesign.Icons – Sam Axe Commented Oct 18, 2019 at 17:20
- Can you add some examples of using it? – mikolaj semeniuk Commented Jun 19, 2022 at 19:01
2 Answers
Reset to default 3If you used npm
to install , it will created a folder called node_modules
(possibly hidden in Solution Explorer, click Show All Files
button to check it ).
You have to write some script (gulp, grunt, etc) to move the files from node_modules
directory to wwwroot/lib
file :
How to use npm with ASP.NET Core
How to install font-awesome in Visual Studio 2017 using ASP.NET Core v2
If using gulp , you can try with :
gulp.task('copy', ["clean"], function () {
return gulp.src(['./node_modules/material-design-icons/iconfont/*'], {
base: 'node_modules'
}).pipe(gulp.dest('./wwwroot/lib'));
});
And can reference the css file in _Layout.cshtml
.
Note :Currently use Library Manager(LibMan) to restore material-design-icons
always fail in my testing .
I used this 3 simple steps and worked for me
- go to this cdn and download all google font files in it
- copy all css files that you download it in
css
folder - create a folder with
fonts
name inwwwroot
, and copy other files (font files)that you download it
its ready do use just add css link to your project and enjoy