Socket
Book a DemoInstallSign in
Socket

@automattic/material-design-icons

Package Overview
Dependencies
Maintainers
50
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automattic/material-design-icons

Material icons in SVG format.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
50
Created
Source

Material design icons

This package currently only provides Material icon SVGs required by the Calypso nav drawer. The official material-design-icons package (https://github.com/google/material-design-icons) is generally quite out-dated. It also includes many image formats that are not relevant to Calypso.

As we adopt Material icons more widely, it will probably be worthwhile to fully populate this package with all the available icons. Alternatively, we could seek out an alternative distribution of the icons.

Using a Material icon in Calypso

We use svgr to load SVG files and convert them to React components:

import { ReactComponent as SvgExample } from './test.svg';

<SvgExample />;

Adding a new Material icon

To add more icons, you'll have to download individual icons to the appropriate directories, then rebuild and commit the updated sprites file:

  • Search for an icon in the official repository, minding the style (like outline)

  • Select an icon, and download the corresponding SVG file with black as color

    Beware that the default style and size for the MaterialIcon class is outline and 24

  • Move that SVG file in the sub-folder matching the category of that icon

    The category should be one of the categories listed in the select box of the search form

  • Rebuild material-icons.svg by running:

    yarn workspace @automattic/material-design-icons run build
    

Keywords

wordpress

FAQs

Package last updated on 07 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts