Socket
Socket
Sign inDemoInstall

gridicons

Package Overview
Dependencies
3
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gridicons

The [Calypso](https://github.com/Automattic/wp-calypso/) / [WordPress.com](https://wordpress.com) official icon set.


Version published
Weekly downloads
18K
decreased by-9.94%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Gridicons

The Calypso / WordPress.com official icon set.

Using the Gridicon Component in your project:

Note that this component requires react to be installed in your project.

Gridicon renders a single svg icon based on an icon prop. It takes a size property but defaults to 24px. For greater sharpness, the icons should only be shown at either 18px, 24px, 36px or 48px.

There's a gallery with all the available icons in https://wpcalypso.wordpress.com/devdocs/design/gridicons.

npm install gridicons --save
Usage
import Gridicon from 'gridicons';
//...
render() {
    return <Gridicon icon="add-image" />;
}
Props
  • icon: String - the icon name.
  • size: Number - (default: 24) set the size of the icon.
  • onClick: Function - (optional) if you need a click callback.

Icon Set Style Guidelines

  • 24dp base grid
  • straight 45 degree angles
  • flat, bidimensional look (no faux 3D whatsoever)
  • 2dp lines
  • 2dp radius rounded corners
  • no logos
  • hollow means inactive, solid means active (for example a hollow bookmark star is solid when checked)
  • icons should be sized optically so they are balanced against each other, see icon-template.ai

These are not rules, they are guidelines that can be broken with the proper reason. The purpose of them is to achieve a uniform look as we all work on it together. They are also open to growing organically. They are meant to guide you to create an icon that fits with all the others (style, alignment, size, ...), if you break any of the above to make it fit better, that works too.

Notes:

  • the bundled file, gridicons-32.ai, will only ever contain 5 icons used for WordPress.com main navigation. It's only there to add some flexibility to the sizing of this navigation.
  • the svg-min files can both be used in production directly or dragged to Sketch to create designs.

Propose a New Icon

Note that the icons in this set are tied to be used in Calypso, but there might be exceptions for more general icons that make sense to be added.

  1. Make sure you have a updated local clone of the repository.
  2. Draw the icon in Illustrator on a 24px grid using the guidelines above (use icon-template.ai if you'd like).
    Tip: tap CMD + Option + Y in Illustrator to see the pixel grid version.
  3. Submit a Pull Request with the icon as a SVG file (inside the svg folder).
  4. Discuss, iterate, review, refine until ready.
  5. Once ready, an admin will proceed adding it.

Add a Proposed Icon to Gridicons (Admins Only)

  1. Switch to the branch (i.e. Pull Request) with the new icon.
  2. Open 'gridicons.ai' in Illustrator.
  3. Add a new containing layer with the name of the icon (i.e. "trophy").
  4. Add the icon from the SVG on that containing layer. Make sure to check pixel preview.
  5. Generate an SVG by dragging the script exporter-multi.jsx inside the Illustrator window.
  6. In the dialog, select your new icon layer from the "Export layers" dropdown and click Export (make sure the output directory is gridicons/svg).
  7. Run grunt command from terminal, to generate the svg-min, react, and svg-sprite directories.
    Optional: if you need to update pdf files, generate these too.
  8. Commit
  9. Merge & delete branch

Installing Automation Scripts

This icon set uses a few automation scripts to ease the generation of new icons in a reliable way. In short, we require node and grunt. For detailed instructions check the installation page.

Publishing to NPM

  • Follow install instructions
  • Check in changes if any and follow PR process.
  • Bump package version in package.json to the next desired version and add an alpha postfix 1.1.0-alpha.1
  • While testing changes publish using the next tag npm publish --tag next
  • If changes look good remove postfix in the version 1.1.0
  • Publish using the latest tag npm publish --tag latest

License

Gridicons is licensed under GNU General Public License v2 (or later).

FAQs

Last updated on 18 Jan 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc