最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Use Google Material UI in ASP Net CORE MVC project - Stack Overflow

programmeradmin2浏览0评论

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
Add a ment  | 

2 Answers 2

Reset to default 3

If 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_modulesdirectory 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

  1. go to this cdn and download all google font files in it
  2. copy all css files that you download it in css folder
  3. create a folder with fonts name in wwwroot , and copy other files (font files)that you download it

its ready do use just add css link to your project and enjoy

发布评论

评论列表(0)

  1. 暂无评论