Note: These guidelines do not apply to the Language Flag Icons, which should have their own guidelines
The rules below are mainly there for a few reasons:
- To make it easier to communicate to developers what an icon's purpose and naming should be
- To make it easier for Liferay's theme developers to be able to customize the look and feel of the icon set from a theme
- To make sure that the icons delivered are as fast to load and cruft-free as possible
- For general consistency sake with existing icons
- Icons should be designed at 512x512 size.
- Use a ratio of 1:32, so if you want to get 1px in a 16px icon you must use 32px of space.
- Do not use decimals for pixels, only full numbers. To achieve this in Illustrator, turn on the "Snap to Pixel" option in the View menu.
- Outline icons have 2px of border.
- Try to use 2px of border radius for corners, though in some cases you can use 1px or avoid it altogether.
- Layers should not be arbitrarily grouped.
- But unless it's absolutely necessary, icons should not be only a single compound path.
- Icons should only use one color, which is pure black for all elements
- Validate the consistency and clarity of the icon
- Make sure that the icon looks visually and stylistically consistent with the rest of the icons.
- Make sure that the icon makes sense within the context of it's intended purpose (it should be as clear as possible what thing it's describing)
- If creating more than one icon in a file, layers should be named, as best as possible, to what the icon name will be.
- The icon name should be all lowercased, and words separated by dashes.
- The names should attempt to be representative of not mainly how they look, but what their general purpose could be.
- This isn't a hard and fast rule, but calling an icon that looks like a plus sign would probably be more commonly used to add something, so you would want to make sure that if it is supposed to be a plus, that you make it unique to that action.
- Make sure you keep the number of anchor points to only those needed. The image below is an example of what you should not do.
- Elements inside of the icon should have a class attribute of either
lexicon-icon-body
orlexicon-icon-outline
.lexicon-icon-body
is used primarily for elements that make up the core or the main part of an icon.
You generally want to uselexicon-icon-body
if there are lines inside of your icon that surround or enclose an area or space.lexicon-icon-outline
us used primarily for elements that make up the lines of the icon, even if it visually looks like a blank area.
Icons that only have a single element should generally get thelexicon-icon-outline
class.
- Icons should not have any style elements embedded or use any CSS for presentation (in fact, at the very most, only
fill="none"
is acceptable as a presentational attribute).