develog

Google Material icons 본문

카테고리 없음

Google Material icons

냐옴 2022. 11. 13. 00:40

 

1. 아래 링크에서 폰트를 다운로드 한다

https://developers.google.com/fonts/docs/material_icons

2. 다운로드 받은 파일을 아래 경로에 저장한다

- css/font

 

3. @font-face 를 등록한다

@font-face {
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: 400;
    src: local('Material Icons'),
        local('MaterialIcons-Regular'),
        url(css/font/MaterialIcons-Regular.woff2) format('woff2'),
        url(css/font/MaterialIcons-Regular.woff) format('woff'),
        url(css/font/MaterialIcons-Regular.ttf) format('truetype');
}

 

4. .material-icons class 를 등록한다

.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;  /* Preferred icon size */
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;

    /* Support for all WebKit browsers. */
    -webkit-font-smoothing: antialiased;
    /* Support for Safari and Chrome. */
    text-rendering: optimizeLegibility;

    /* Support for Firefox. */
    -moz-osx-font-smoothing: grayscale;

    /* Support for IE. */
    font-feature-settings: 'liga';
}

 

5. 기본 사용법

<i class="material-icons">아이콘명</i>
<i class="material-icons">face</i>

 

5. 아이콘명은 아래 링크에서 확인한다

https://fonts.google.com/icons

 

 

https://developers.google.com/fonts/docs/material_icons

 

머티리얼 아이콘 가이드  |  Google Fonts  |  Google Developers

이 페이지는 Cloud Translation API를 통해 번역되었습니다. Switch to English 머티리얼 아이콘 가이드 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요. 머티리얼 아이

developers.google.com

 

https://fonts.google.com/icons

 

Material Symbols and Icons - Google Fonts

Material Symbols are our newest icons consolidating over 2,500 glyphs in a single font file with a wide range of design variants.

fonts.google.com

 

Comments