Giter Club home page Giter Club logo

gridicons's Introduction

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. If you don't want to use React, you can simply include the raw .svg files from the svg-min folder.

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 http://automattic.github.io/gridicons/.

Install

Use the following command and execute in your terminal:

npm install gridicons --save

Usage

You can either import the whole iconset and decide at run-time which icon to use:

import Gridicon from 'gridicons';
//...
render() {
    return <Gridicon icon="add-image" />;
}

Or import icons individually:

import GridiconAddImage from 'gridicons/dist/add-image';
//...
render() {
    return <GridiconAddImage />;
}

If you use only a few icons, the recommended way of using the Gridicon library is to import them individually. At the moment of writing this, individual icons are between 1K and 2K, and the file containing the whole iconset sits at 92K.

Props

  • icon: String - the icon name. This is ignored when importing icons individually.
  • size: Number - (default: 24) set the size of the icon.
  • onClick: Function - (optional) if you need a click callback.

Notes:

  • The icon set is made to be used exactly at these pixel sizes: 12, 18, 24, 36, 48, 54, 72.
  • gridicon-my-sites as it's a small-size version of the WordPress logo, shouldn't be used larger than 36px. If you need to use the WordPress logo in larger sizes, see the Social Logos project.

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 svg-min files can both be used in production directly or dragged to Sketch to create designs.
  • the sources/svg-32 folder contains a subset of icons optimized at 32px, for the iOS navigation bar.

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 as starting point). 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 sources/svg folder), make sure to include a screenshot, ideally containing side by side comparison with some other Gridicons as a visual reference.
  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. Review the SVG source of the new icons to make sure they are clean and readable.
  3. Check pixel sharpness: open in Illustrator (with "Pixel Preview") or Sketch (with "Show Pixels"), adjust if needed.
  4. Run grunt command from terminal. It will generate svg-min, build, dist, svg-sprite, pdf, php, and docs.
  5. Commit
  6. 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.

Once you checkout the repo run npm install in the gridicons folder. To generate all the fonts, svgs and so on you run npm run build

Publishing to npm

Note: to proceed with this you need to have write authorization to npm.

  1. Create a new PR with updated CHANGELOG.md and updated version in package.json (i.e. 1.2.3-alpha.1), see an example here.
  2. In the "CHANGELOG.md" make sure to check all the previous commits since the previous versioned release.
  3. Pre-publish that PR branch on npm with npm publish --tag next (more info). Running the npm publish --tag next command will send the data that you have localy to npm. Having the alpha version in the package.json file will create a newly tagged version npm package. Use npm view gridicons to look at the list of current tags. You do not need to commit changes to github in order to publish to npm, but it is recommended so folks testing know what's available.
  4. Create a new update PR in a repository that makes use of Gridicons and run npm install gridicons@next --save (which will update packages.json). If you're creating the PR in Calypso and you get warnings, it might need to regenerate the shrinkwrap, in which case run npm run update-deps. See an example here.
  5. Test if the new icons show up, and there are no regressions in the previous icons. Take a look at the http://calypso.localhost:3000/devdocs/design/gridicons for example.
  6. If changes look good, remove the alpha postfix in the version (i.e. 1.2.3-alpha.1 to 1.2.3) on both repositories PRs.
  7. Merge the Gridicons PR.
  8. Tag the release on GitHub: git tag -a v1.2.3 -m "Release v1.2.3" (and push git push origin v1.2.3).
  9. Check if it shows up in the Releases list.
  10. Publish to MASTER using the latest tag npm publish.
  11. Merge the update PR in the other repository.

License

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

More notes on publishing to npm

You need to have a npm user account. Create one here. Once you have created it, set up the account on you machine via $ npm adduser

Setup the 2fa with npm $ npm profile enable-2fa

Now everytime before you can publish You will be asked for a your 2FA code (OPT)

gridicons's People

Contributors

aduth avatar alternatekev avatar anomiex avatar bjtitus avatar blowery avatar codebykat avatar davewhitley avatar ehg avatar enejb avatar folletto avatar gwwar avatar hugobaeta avatar iamthomasbishop avatar jameskoster avatar jancavan avatar jasmussen avatar josemarques avatar katinthehatsite avatar mattmiklic avatar melchoyce avatar mladenplavsic avatar mtias avatar noahtallen avatar nosolosw avatar porada avatar scruffian avatar sgomes avatar shaunandrews avatar stuwest avatar sylvesterwilmott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gridicons's Issues

Add icon: RSS

Do we need an RSS icon? Does that count as a logo?

Add icon: Features

@folletto Do we need a "features" icon (puzzle piece) and "price" icon (paper currency) for themes? They are on the list of icons we need made, but I know you are working on the theme showcase and I was wondering if you plan on using those 2 icons.

Add Icon: Schedule

In the editor, you can schedule a post.

Currently we are using a clock icon:
schedule

Add Icons: Sharing icons

Sharing (sharing/) uses the following social icons:

  • Facebook
  • Twitter
  • Google+
  • LinkedIn
  • Tumblr
  • Path
  • Eventbrite

And the sharing buttons (that are not listed above)
sharing buttons

  • Mail
  • Print
  • Reddit
  • Press This
  • Pinterest
  • Pocket

Grid tweaks to Gridicons page

Looking at the Gridicons page, I find it a little hard to judge the balance of the icons. I'm not sure if that's because of the amount of icons on the page (not enough?), the size, or the cell spacing.

screen shot 2015-02-26 at 11 43 45 am

I think maybe the icon should be sized down, and the cell spacing decreased.

I find this icon grid to be a little easier to scan and determine if the icons are optically balanced.

screen shot 2015-02-26 at 11 45 10 am

Add icons (3): mobile preview devices

I've been sketching an interface exploration with different screen breakpoints, so I tried to use Gridicons as well instead of dashicons and I think we need some extra icons there too.

Context:

  • The gridicons-phone.svg is nice, but feels too abstract, "just a rounded square".
  • The gridicons-tablet.svg is abstract too, but also turned in a different direction. This makes its usage more limited.

To be also in sync with the picker in the customizer, we can introduce three icons that are meant to be together.

Here's an initial idea:

screen shot 2015-07-20 at 14 56 02

Basically:

  1. Introduces the screen/computer icon, with a shape that matches the tablet one, just with different bevels.
  2. Add a "button" to both tablet and phone so they are more clearly distinctive.

Add icons: Audio

We represent audio files with an icon in the media gallery.

Currently:
audio file

wp-admin:
wp-admin audio file

Add Icon: Gallery

In the editor, you can set posts formats, such as a gallery:

From IO editor:
gallery

Add icon: Trophy

Missing but highly needed for achievements/notifications and in various pages in Stats to highlight "best ever"-type data.

Export React component.jsx files alongside the SVG sprite?

It was @MichaelArestad's idea: alongside the current SVG sprite that works well with traditional webpages, we should consider adding a step to the Grunt compiler that directly outputs a React jsx file for use in Calypso. The benefits would be that it's slightly easier to use the icons directly in React based applications, but mostly that it's more componentized.

It could be implemented in two ways:

  1. We could output one component per icon. For example icons/icon-reader.jsx, which could then be inserted using <ReaderIcon />. The tiny benefit would be that for a page that needs only one icon, only that one icon needs to be included.
  2. One component for all icons, essentially a "sprite" component. Icons could then be inserted using <Gridicon icon={reader} />, and so on. The benefit would be easily remembered syntax, and only one component to include to get access to all icons. The downside theoretically is that users who only visit one page that has one icon will have to download the whole sprite.

I'm leaning towards 2, as right now the entire set is only 16K, though it also probably has only a 4th of the total icons we need. Still, as soon as a user visits more than one page, the sprite is "ajax-cached".

Thoughts?

Create new icons

  • Reader (Newspaper)
  • Notifications
  • Me/My Sites (Person in a circle)
  • Settings (Gear, cog)
  • New Post (Pencil with plus, plus by itself)
  • Primary Blog (House)
  • New x
  • Stats (Bar graph)
  • Posts (Thumbtack, pencil)
  • Pages (Paper)
  • Comments (Speech bubble)
  • Likes (Star)
  • Heart
  • Reblog (Arrows pointing at themselves)
  • Follow (Plus in a circle)
  • Following (Check in a circle)
  • Unfollow (Minus in a circle) we don't need this one
  • Tags (Shopping tag)
  • Time (Clock)
  • RSS icon — is this a logo? (something we don't want in gridicons)
  • Reply (Arrow pointing right)
  • Approve (Check)
  • Unapprove (Circle with slash)
  • Trash can
  • Spam (Octagon with exclamation mark)
  • Search (Magnifying glass)
  • Expand (Down arrow)
  • Collapse (Up arrow)
  • User (Silhouette of person)
  • More (Ellipsis)
  • Password (Lock, key)
  • Hide Password (Eye with slash)
  • Show Password (Eye)
  • Edit (Pencil)
  • Categories (Folder)
  • iOS Share (Box with arrow pointing up)
  • iOS Refresh (Circle arrow)
  • iOS Back (Left arrow) we should use the system icon here
  • iOS Forward (Right arrow) we should use the system icon here
  • Android Share (Triangle with dots) we should use the system icon here
  • Android Send Message (Paper airplane) we should use the system icon here
  • Android More (3 vertical dots) we should use the system icon here
  • Zoom (Magnifying glass +) we don't need this one
  • Unzoom (Magnifying glass -) we don't need this one
  • Types (Ship steering wheel)
  • Features (Puzzle piece)
  • Layouts (Big box next to little box)
  • Colors (Drop of ink)
  • Price (Paper currency)
  • Customize (Paintbrush)
  • Status (Pin) not needed anymore?
  • Schedule Post (Calendar)
  • Location (Map location marker)
  • Header, h1, h2, h3
  • Align image left
  • Align image center
  • Align image right
  • Insert Image
  • Insert Video
  • Insert Gallery
  • Insert Embed
  • Insert link
  • Bold
  • Italic
  • Unordered list
  • Ordered list
  • Blockquote
  • Horizontal Rule
  • Align left
  • Align center
  • Align right
  • Upgrades (Shopping cart)
  • Help/support (chat bubbles or life saver)

Additional information and context here.

Add Icon: post format

In the Editor (/post), we use icons in the sidebar to represent the various metaboxes. We have gridicons for all but post format.

This is what we are using now, but I'm open to other suggestions:
post format

Add icon: preview

We aren't using one in the editor now, but we have talked about trying an eye icon for preview.

Add icons: Follow and Following

My initial idea was to make the "follow" and "following" icons a square, since we now make the distinction between squares and circles for blavatars and avatars:

screen shot 2015-05-28 at 4 05 42 pm

Another option is to use a circle instead, which looks good, but doesn't have the nice the square vs. circle logic.

screen shot 2015-05-28 at 4 11 47 pm

Also, it might conflict with other uses of the plus in a circle icon:

screen shot 2015-05-28 at 4 12 41 pm

Chevron icons look too small

They look too small compared to the other icons (close and share in this case):

iphone 6

Maybe there should be a chevron and chevron-small ?

Add icons: Wordpress.com CPTs

Please add icons for custom post types used by themes on Wordpress.com. Use case: calypso 'My Sites' Sidebar menu -- basically replacing wp-admin's CPT menu items dashicons.

This includes

  • testimonials (as used by the Sela, for example)
  • restaurant menus (e.g. Confit & Bon Vivant themes)
  • rooms (Stay theme)
  • and possibly a 'default' one (currently using 'noticon-document')

Icons should all have the same visual weight

In using Gridicons so far I've found that not all the icons appear optically to be the same size, despite our 24px grid. From Google's guidelines on icon design:

As the following figure shows, when you size an icon to fill the available area, square and circular icons are significantly larger than they should be, compared to icons with other shapes.

visual_weight_1

Normalizing the icon sizes, as the next figure shows, gives the icons roughly even area and visual weight.

visual_weight_2

You can see the issue here:

screen shot 2014-11-24 at 1 15 13 pm

The close icon appears to be significantly larger than the alert icon, despite them both being 24px and aligned to the grid.

screen shot 2014-11-24 at 1 15 23 pm

Merge in new Gridicons

Big milestone: merging in the initial set of Gridicons containing enough icons to make it usable.

See also: #9

Add Icon: Media

A media icon to cover more than just images. Something like what we have in dashicons.
screen shot 2015-06-12 at 9 43 44 am

Add Icons: tinyMCE formatting icons

In the editor, we have all the tinyMCE formatting icons except for:

  • justify text
  • underline
  • text color :shudder:
  • clear formatting
  • paste as text (could reuse or alter gridicons-clipboard)
  • special character
  • increase indent (could be based on gridicons-align-image-left)
  • decrease indent (could be based on gridicons-align-image-right)

Add icon: Themes

Traditionally this has been a painter's palette. It sort of makes sense, but a palette represents color more than anything. I think this icon works pretty well for themes (currently in gridicons as "layout"):

screen shot 2015-05-28 at 3 29 44 pm
:

Readme tweaks

@folletto, the new readme is really great. Here are some issues that I ran into:

current:

  1. Add the transparent square from another icon behind the SVG on that same containing layer.

suggestion:

  1. Copy a transparent square from another layer, and paste it behind the icon on your new layer.

Not using the word "SVG" here helps separate the SVG file from SVG vector artwork.

current:

  1. Re-generated the SVG from IA dragging the script exporter-multi.jsx inside the Illustrator window.

suggestion:

  1. Generate an SVG by dragging the script exporter-multi.jsx inside the Illustrator window.

Fixed some typos and simplified.

On step 7, the exporter script defaulted to exporting the add icon which was incorrect, so I think we need to add a step. Something like:

  1. Select your new icon layer from the Export layers dropdown and click Export.

Also on step 7, I got a weird error about compound paths that I had never received before. Dragging the script again solved the issue...weird.

Ideas

On step 2 under Prose a New Icon we could suggest using icon-template.ai. We could add a section to the bottom that explains the icon template, the guides, etc. For example, we could explain that certain guides are for square shaped icons.

We could also add a "Things to look for" section.

  • Make sure to combine shapes, no groups.
  • Layer ordering and path ordering.
  • make sure there are no guides, because those will show up in the SVG code.

Add icon: Menus / Hierarchy (2 icons?)

This could also be TWO icons, not one:

  • We need an icon for Menus
  • Menus is currently using the Hiearchy icon

Both are currently missing.

Current use of menu icon:

screen shot 2015-07-17 at 18 33 04

screen shot 2015-07-17 at 18 32 57

Add Icon: Print icon

Previously discussed in #48 as part of the social icons, which have now been moved to a separate repo.

Add icon: scheduled time

Would be nice to have an icon to use to indicate that a time has been set, an alternative version of gridicons-time.

New Posts Icon

I've been thinking about the post/posts icon for some time.

The Past

screen shot 2015-08-27 at 22 19 34

I think the old thumbtack fails/succeeds because:

  • Now widely recognized by most of the WP world.
  • Skeumorphism-dependent (you have to know what it is).
  • Weird weight (takes careful balancing visually).
  • Is confusing considering you can sometimes "pin" things depending on what you use WP for.
  • Signals pinning board, doesn't signify relevancy.

The Now

screen shot 2015-08-27 at 22 20 08

I think the current icon fails/succeeds because:

  • More relevant for most than a thumbtack.
  • Only signifies text (not photos/videos/post formats).
  • Is visually weighted less than pages and many other icons (it stands out).
  • Only signifies one piece of content.
  • Not friendly for RTL/symbol languages? ;)
  • Doesn't signify relevancy.

The Future

screen shot 2015-08-27 at 22 24 53

After some exploration, I've arrived at my proposed new icon. I think it works because it:

  • Signifies multiple things in a generic shape: a bullet in a list, a camera, a block of content, a pussle piece, a location, a looking glass, a stackable toy, and most importantly a notification (more on this below).
  • Is actually really close to the CPT icon, using the same general shape and a dot to signify one CPT!
  • Is better weighted compared to other icons, most importantly including the Pages icon and writing icons (see below).
  • Ties in with the Create icon's shape, but a filled block means the post can already be there (hence it works for lists). In comparison, the Create icon is outlined, meaning it's not yet "active". Once published/saved it will be a filled box and available in a posts list.
  • The dot signifies an item in a stack in the same way that the dot on the Notification bell icon doesn't mean that there's only 1 item to be seen: it can be more than one, but it means that there's content to be seen. The positioning of the dot is different as it's not a secondary indicator for another icon (compare to * icon or the dot for Notifications). Instead, it builds a mental picture of creating content to generate notifications for yourself and others. Each post, if you have subscriber, would invoke that same dot for them. Each post may have interesting stats to look at.
  • Creates such a generic shape that it could be universally adopted over time to signify a "post", "status update", "news bulletin", etc. Compare to the Location icon and how universal the drop marker is nowadays.

Given that we don't have the same icon as Core anymore and the current one falls short in many ways I don't think it'd be a big deal to change the icon for posts.

Some examples..
screen shot 2015-08-27 at 22 10 10
screen shot 2015-08-27 at 22 09 24
screen shot 2015-08-27 at 22 09 12
screen shot 2015-08-27 at 22 08 38
screen shot 2015-08-27 at 22 36 55

Thoughts?

Add Icon: Image caption

In the editor, you can add a caption to an image from the inline image toolbar. Right now we are using the comment icon, which isn't very intuitive:

screen shot 2015-08-21 at 4 21 24 pm

Move icon development from Illustrator to Sketch?

Right now all gridicons are designed in Illustrator. Each icon has an artboard on its own. Each is saved as SVG and exported, then renamed and grunted.

The process is not super difficult, but it's also not super smooth either. Would migrating to Sketch improve the situation here?

I'm somewhat new to Sketch myself, but it seems like Sketch would allow for somewhat simpler exporter options, not only to SVG files for the grunt process, but even for exporting multiple densities of each icon for Android and iOS at the same time. Seems like there's a benefit there.

Both have the pain point that adding in the icons is sort of a manual merge.

Thoughts?

Add icon: Share/Sharing

We need to choose a share icon for the web.

In the native apps, we should use the standard share icons (or our own versions) on each platform (iOS and Android):

44 share-128
rg6iz

For the web, we have been using the Open Share Icon:

openshareicon-64x64

https://shareaholic.com/openshareicon

The idea behind it seems appropriate for us, but the best share icon is the one users will recognize. The Open Share Icon isn't widespread, and as a result, I don't think it's very recognizable.

Additionally, they require image attribution near the image, which I don't think we currently do:

Clear attribution and a hyperlink back to this page in a prominent location near to the image is required.

In my opinion, the share icon that Material Design uses would be best to use in Gridicons:

screen shot 2015-05-28 at 3 50 52 pm

It's open source, and with the strong push behind Material Design, I think this icon will be even more closely associated with "share" in the next few years.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.