Skip to content

Commit e799319

Browse files
committed
MAGEDOC-3424: Update Iconography topic
Added instructions for creating PNG and SVG images
1 parent 9f70016 commit e799319

File tree

3 files changed

+55
-9
lines changed

3 files changed

+55
-9
lines changed

docs/configurations/iconography.md

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,69 @@ The following image shows all available PageBuilder Admin icons with class names
1111

1212
![PageBuilder admin icons](../images/pagebuilder-icons.png){:width="870px" height="auto"}
1313

14-
You can use these icons when extending or customizing the PageBuilder module or [create your own icons].
14+
You can use these icons when extending or customizing the PageBuilder module or create your own icons using SVG files or icon fonts as described next.
1515

16-
## Creating icon fonts
16+
## Creating SVG or PNG icons
1717

18-
We recommend using icon fonts to get the best quality for your icons.
19-
The PageBuilder Admin icon fonts can be found in the [cms-icons repository].
18+
To add your own icons, we recommend creating SVG icons because they are smaller and render more clearly on high-resolution screens, including mobile devices.
2019

21-
If you want to add your own icons, each icon will need to be in its own SVG files. There are multiple ways to create icon fonts, here is one to get started:
20+
The size of the icons you create depends on where within Page Builder you want to use them. You can add icons to Page Builder in three areas:
2221

23-
1. Go to <a href="https://icomoon.io/app/" target="\_blank"> https://icomoon.io/app/ </a> or download this app in Chrome web store.
22+
- Panel
23+
- Form
24+
- Stage
2425

25-
2. Upload your icons in SVG format into the app.
26+
### Panel icons
2627

27-
3. Specify desired font names and specify the Unicode characters to map the icons. Setting the icons to Private User Area will disable screen-readers or other accessibility tools to read your icon's characters (read "Unicode" section here).
28+
To create a panel icon that integrates seamlessly with the existing panel icons, use the following specifications:
29+
30+
![Create config file](../images/step6-icon-properties.png)
31+
32+
The *artboard* represents the actual width and height of your icon when it is exported from your graphics application (16 x 16px). The *artwork* represents the content of your icon. Following these dimensions ensures your icons will match the size and positioning of the existing Page Builder icons within the panel.
33+
34+
### Form and stage icons
35+
36+
The native Page Builder icons found in forms and on the Admin stage are a variety of sizes, from 20 x 20px up to almost 200px in width, as shown here:
37+
38+
![Create config file](../images/iconography-form-icons.png)
39+
40+
The best way to decide how big to create your form or stage icons is to inspect the sizes of the Page Builder's existing icons from the browser dev tools. The idea is to emulate the icon sizes as closely as possible to ensure that your icons integrate well and look professional alongside Page Builder's existing icons.
41+
42+
## Adding your icons
43+
44+
Add all your SVG and/or PNG icons to the `adminhtml/web/css/images` directory for your content type. For example, if your content type is called `example-quote`, you would put your icons in `adminhtml/web/css/images/content-type/example-quote/appearance/` as follows:
45+
46+
![Create config file](../images/iconography-adding-icons.png)
47+
48+
## Create CSS classes for your icons
49+
50+
For each SVG or PNG icon you create, add a CSS class to your LESS file in `adminhtml` as shown here:
51+
52+
![Create config file](../images/step6-icon-style.png)
53+
54+
Creating a CSS class for each icon provides an easy way to reference and display your icons in a variety of places throughout Page Builder. The following CSS rule set shows one way to link to your icons through CSS:
55+
56+
```css
57+
.icon-pagebuilder-quote {
58+
background-image: url('@{baseDir}Example_PageBuilderQuote/css/images/content-type/example-quote/appearance/icon-pagebuilder-quote.svg');
59+
width: 16px;
60+
height: 16px;
61+
}
62+
```
63+
64+
| Attribute | Description |
65+
| ---------------------- | ------------------------------------------------------------ |
66+
| `class name` | To match the class names of Page Builder's native icons, we recommend prefixing your icon names with `icon-pagebuilder` as we have done with the Quote panel icon. |
67+
| `background-image url` | The `url` used for the `background-image` is the most critical part of the CSS. Always use the `@{baseDir}` variable followed by your full module name, followed by the path to your image, starting with `css`. When deployed, Page Builder creates a link in the static output where the browser can resolve it as described below. |
68+
| `width` | Sets the width of the icon image. |
69+
| `height` | Sets the height of the icon image. |
70+
71+
When deployed, your icon images are linked from `pub/static` as shown here:
72+
73+
![Create config file](../images/step6-icon-link-static.png)
2874

29-
4. Then initialize a download in the app to generate the icon font and CSS style sheet.
3075

3176
[Magento Admin icons]: https://devdocs.magento.com/guides/v2.2/pattern-library/graphics/iconography/iconography.html
3277
[create your own icons]: https://devdocs.magento.com/guides/v2.2/pattern-library/graphics/iconography/iconography.html#creating-icons
3378
[cms-icons repository]: https://github.com/magento-ux/cms-icons
79+
26.5 KB
Loading
16.9 KB
Loading

0 commit comments

Comments
 (0)