What is material-design-icons-iconfont?
The material-design-icons-iconfont npm package provides a convenient way to include Material Design icons in your web projects. It offers a collection of icons that follow the Material Design guidelines, which can be easily integrated into your HTML and CSS.
What are material-design-icons-iconfont's main functionalities?
Include Icons via CSS
You can include the Material Design icons in your project by adding a link to the CSS file in your HTML. This makes all the icons available for use in your web pages.
<link href="https://cdn.jsdelivr.net/npm/material-design-icons-iconfont@6.1.0/dist/material-design-icons.css" rel="stylesheet">
Use Icons in HTML
Once the CSS is included, you can use the icons in your HTML by adding an <i> element with the class 'material-icons' and the name of the icon you want to use as its content.
<i class="material-icons">face</i>
Styling Icons with CSS
You can style the icons using CSS. For example, you can create a class to change the size and color of the icons.
.icon-large { font-size: 48px; color: red; }
Other packages similar to material-design-icons-iconfont
font-awesome
Font Awesome is a popular icon set and toolkit that provides a wide range of icons. It offers more icons than material-design-icons-iconfont and includes both free and pro versions. Font Awesome icons can be used in a similar way by including the CSS and using the appropriate classes.
ionicons
Ionicons is an open-source icon set designed for use with Ionic Framework, but it can be used in any web project. It offers a different style of icons compared to Material Design and includes a variety of icons suitable for mobile and web applications.
bootstrap-icons
Bootstrap Icons is an icon library designed to work seamlessly with Bootstrap. It provides a set of icons that match the design language of Bootstrap components. Like material-design-icons-iconfont, it can be included via CSS and used in HTML.
Project's Demo Page
MDIDX - Same Material Design icons, Better DX
MDIDX (this repository) is a ~fork (+ fixes) of Google's Material Design icons repository.
Sadly, Google allocates low maintenance and low support for issues reported by software developers having trouble using the Material Design icons library.
MDIDX helps modern web developers to use and include the (awesome) Material Design icons library in their project.
Installation
using npm
npm install material-design-icons-iconfont --save
Usage - Check out the Demo Page
-
Using scss
Import fonts and variables in your project
$material-design-icons-font-directory-path: '~material-design-icons-iconfont/dist/fonts/';
@import '~material-design-icons-iconfont/src/material-design-icons';
Customize your own classes
access material variable with Sass mixins:
.my-face {
@include material-icon('face');
}
# or
.my-face:before {
content: material-icons-content('face');
}
What's the difference? Why forking?
-
Performance -
When you checkout Google's original repository ( via git, npm and bower) you experience an unwanted delay. This checkout delay is caused by thousands of separate source graphic svg,png,...
files.
Needless to say that these file are irrelevant for the average developer's purposes and cause build congestion (especially when using in CI systems)
In this fork all irrelevant files have been removed while keeping only the required files.
-
SCSS Support - Modern developers need support for scss
. You can customize the referenced font's files filename and path
-
Maintenance - The original repository's release has missing icons that should be included according to https://material.io/tools/icons
How to contribute to this project
Configure environment
Install nodejs on your environemt (> 7.6 for async await)
running build
npm install
npm run build