@title Getting Started @previewBell(){ } @previewOverlay(){ } @download(text, url){ } @boostrapInfo(){
Bootstrap Getting Started
} # @title @boostrapInfo() There are many different ways you can consume the Material Design Icons in your projects. The most common uses are listed below. Boostrap has a separate guide that can be viewed [here](/bootstrap). ## Webfont @download(Download the Webfont, https://github.com/Templarian/MaterialDesign-Webfont/archive/master.zip) For those targetting the web your best option is to use the webfont (bower `bower install mdi` or npm `npm install mdi`). Files should match the file structure below. ```text File Structure fonts /materialdesignicons-webfont.eot /materialdesignicons-webfont.svg /materialdesignicons-webfont.ttf /materialdesignicons-webfont.woff /materialdesignicons-webfont.woff2 css /materialdesignicons.min.css - Minified CSS /materialdesignicons.min.css.map - Developer Tools Map preview.html - Preview the font files ``` To reference the icons add the line below into the `head` tag. ```html Reference the CSS ``` To use the icons inline you can use the syntax below. ```html Webfont Example ``` @previewBell() From version 1.6.80+, the `mdi` class will no longer alter styles of the element it is applied to and will only alter the styles of the `:before` pseudo element where the icon is inserted. This means it is now possible to apply icons directly to elements without key styles such as `font-family` being overridden. As you no longer need to use an aditional element (such as `i`), your HTML can be more semantically correct. ```html Semantic Icon Example Home ``` This change should not affect any existing icons other than rare cases where the `mdi` class is inherited by the icon element from a parent. If you are having issues please refer to the Iconsets webfont feature below which explains this in more detail and shows how it can be fixed. If this does not solve the problem feel free to open a new [issue](https://github.com/Templarian/MaterialDesign/issues) on github with the title 'Broken Icons After Update' outlining the code which no longer works. ### Webfont features The webfont provides several additional helper classes which can be used to quickly display icons in a certain way. #### Font Size The classes `.mdi-18px`, `.mdi-24px`, `.mdi-36px`, and `.mdi-48px` can be added to easily change the size of the icon to the most optimal sizes. ```html Size Example Home Home ``` #### Color Use either `.mdi-light` or `.mdi-dark` to set the color of the icon to the default material values. You can also add `.mdi-inactive` to an element with those classes to use the inactive color variant. ```html Color Example Home Home Home Home ``` #### Flip Icons can be flipped horizontally and/or vertically using the classes `.mdi-flip-horizontal` and `.mdi-flip-vertical`. ```html Flip Example Home Home ``` #### Rotate Icons can be rotated by 45 degree increments using the syntax `.mdi-rotate-[angle]` where angle is one of the following values: 45, 90, 135, 180, 225, 270, or 315. ```html Rotate Example Home Home ``` #### Iconsets (v1.6.80+) As of version 1.6.80+, the `mdi` class can no longer be applied once to a parent element so that all child elements inherit the `mdi` styles needed to render icons (set the font to use the mdi iconfont etc). To remedy this, we have added a new class `.mdi-set`. This simply allows you to do something like the following example without specifying the `mdi` class on every icon. ```html Iconset Example
``` ## Inline SVG The webfont is not the only way to use the icons. They can also be included inline with the `svg` tag. Right click any icon on the site and click the 'View SVG' item in the context menu for example code. ```html SVG Inline Exmaple ``` SVGs like the webfont can be overlayed and combined. ```html Overlay Example ``` @previewOverlay() SVGs can also be styled with CSS similar to HTML elements and assigned classes. ```css Examples svg.example:hover path { fill: #900; fill-opacity: 0.5; } ``` ## SASS Use the characters in custom SASS use the method below. ``` @function mdi($name) { @return char(nth($hexes, index($names, $name))); } .custom:before { font: normal normal normal 24px/1 "Material Design Icons"; content: mdi('account'); } ``` ## Android (Vector Drawable) Android uses the Vector Drawable format that is similar to SVG. Right click any icon to download or view the vector drawable syntax. ## WPF / Windows / Windows Phone Windows uses the vector XAML format. Right click any icon on the site and click the "View XAML" item in the context menu. ## Angular Material @download(Download for Angular Material v1 'mdi.svg', /api/download/angularmaterial/38EF63D0-4744-11E4-B3CF-842B2B6CFE1B) The `mdi.svg` contains all the icons provided on the site. Use inline with [$mdIconProvider](https://material.angularjs.org/latest/api/service/$mdIconProvider). ```javascript Configure app.config(function($mdIconProvider) { $mdIconProvider .defaultIconSet('my/app/mdi.svg') }); ``` Usage: ```html Example Usage ``` ## Polymer @download(Download for Polymer v0.5 'mdi.html', /api/download/polymer/38EF63D0-4744-11E4-B3CF-842B2B6CFE1B) @download(Download for Polymer v1.0 'mdi.html', /api/download/polymer/v1/38EF63D0-4744-11E4-B3CF-842B2B6CFE1B) The `mdi.html` contains all the icons provided on the site. Use inline with the following code. ```html Polymer Example ``` Learn more about custom icons in the [polymer documentation for v0.5](https://www.polymer-project.org/docs/elements/icons.html#roll-your-own) and for Polymer v1.0 [iron-iconset-svg](https://elements.polymer-project.org/elements/iron-iconset-svg). ## Cordova Due to a "bug" in Cordova you will need to manually edit the css file to remove the version query string. [Read More](https://github.com/Templarian/MaterialDesign/issues/760). ## Symbols for Adobe Illustrator [Download Symbols for Adobe Illustrator](https://github.com/danielhickman/MaterialDesign/tree/master/Symbols/Templarian) by Daniel Hickman. This GitHub repo also includes the steps to keep the symbol library updated with the latest. ## Visual Studio Please use the [Glyphfriend](https://visualstudiogallery.msdn.microsoft.com/5fd24afb-b3b2-4cec-9b03-1cfcec6123aa) extension to quickly autocomplete icons. ## ATOM The [tool-bar](https://atom.io/packages/tool-bar) package supports this icon set. ## Grunt `grunt-webfont` Creating subsets of the font can be done with the [grunt-webfont](https://github.com/sapegin/grunt-webfont) package. ... explain step by step here... ## License These fonts and designs are covered by the [license.txt](https://github.com/Templarian/MaterialDesign/blob/master/license.txt) located in the root of the git repo on GitHub.