Skip to content

Commit 9a941d6

Browse files
committed
MAGEDOC-3424: Update Iconography topic
Included more examples showing how icons and images are used within forms and on the stage.
1 parent e799319 commit 9a941d6

File tree

5 files changed

+72
-18
lines changed

5 files changed

+72
-18
lines changed

docs/configurations/iconography.md

Lines changed: 72 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,57 @@
22

33
## Overview
44

5-
PageBuilder Admin icons follow the same design principles as the core [Magento Admin icons].
6-
They are simple, flat, and monochromatic to prevent the loss of detail at smaller sizes and makes the shapes easier to comprehend.
5+
PageBuilder Admin icons follow the same design principles as the core [Magento Admin icons]. They are simple, flat, and monochromatic to prevent the loss of detail at smaller sizes, while making their shapes easier to comprehend.
76

87
## Page Builder icons
98

10-
The following image shows all available PageBuilder Admin icons with class names to reference them by:
9+
Here are the available PageBuilder Admin font icons (with class names) for use within your content type as needed:
1110

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

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.
13+
Page Builder references these icons by their class names. For example, Page Builder's Heading content type references `icon-pagebuilder-heading` for its panel icon configuration file as shown here:
14+
15+
```xml
16+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/content_type.xsd">
17+
<type name="heading"
18+
label="Heading"
19+
icon="icon-pagebuilder-heading"
20+
...>
21+
```
22+
23+
Page Builder's Heading also references three more icons in its toolbar as defined in `Magento/PageBuilder/view/adminhtml/web/js/content-type/heading/preview.js` shown here:
24+
25+
```js
26+
{
27+
key: "text_align",
28+
type: "select",
29+
values: [{
30+
value: "left",
31+
label: "Left",
32+
icon: "icon-pagebuilder-align-left"
33+
}, {
34+
value: "center",
35+
label: "Center",
36+
icon: "icon-pagebuilder-align-center"
37+
}, {
38+
value: "right",
39+
label: "Right",
40+
icon: "icon-pagebuilder-align-right"
41+
}]
42+
}];
43+
```
44+
45+
The icons are render in the Heading's toolbar as shown here:
46+
47+
![Create config file](../images/iconography-toolbar-icons.png)
48+
49+
You can use these icon class names in your own content types or create your own icons using SVG files (recommended) or PNGs as described next.
1550

1651
## Creating SVG or PNG icons
1752

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.
53+
To add your own icons, we recommend creating SVG images because they are smaller and render more clearly on high-resolution screens, including mobile devices.
1954

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:
55+
The size, appearance, and color of your images depends on where within Page Builder you want to use them. You can add icons to Page Builder in three areas:
2156

2257
- Panel
2358
- Form
@@ -29,29 +64,39 @@ To create a panel icon that integrates seamlessly with the existing panel icons,
2964

3065
![Create config file](../images/step6-icon-properties.png)
3166

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.
67+
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 to ensure your icons match the size and positioning of the existing Page Builder font icons within the panel.
3368

34-
### Form and stage icons
69+
### Form icons
3570

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:
71+
Most of the images used in the Page Builder base forms are one of three sizes: 20 x 20px, 148 x 60px, and 194 x 98px.
3772

3873
![Create config file](../images/iconography-form-icons.png)
3974

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.
75+
Your images should match Page Builder's images in both size and appearance. This ensures a professional, integrated look alongside Page Builder's existing icons. We recommend creating three artboards to match these three sizes. Then give your artwork 1-2 pixels of white space from the artboard's edge, as described for panel icons.
76+
77+
### Stage icons
4178

42-
## Adding your icons
79+
Stage images can be a variety of sizes. For example, Page Builder's `cms-empty-row.svg` image (shown for an empty row, no doubt) is 468 x 103px with a color of #AAA6A0:
80+
81+
![Create config file](../images/iconography-stage-images.png)
82+
83+
Again, take note of its simple design and subtle color.
84+
85+
## Adding your images
4386

4487
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:
4588

4689
![Create config file](../images/iconography-adding-icons.png)
4790

48-
## Create CSS classes for your icons
91+
## Create CSS classes
92+
93+
As discussed earlier in this topic, Page Builder references its icon fonts using class names from a variety of locations, such as the panel, the toolbar, and the visual selectors within forms. Creating your own CSS classes for the SVG and PNG images you plan on referencing by class name is required if you want to participate in Page Builder's system of CSS class references.
4994

50-
For each SVG or PNG icon you create, add a CSS class to your LESS file in `adminhtml` as shown here:
95+
Add the CSS classes for your icons to your LESS file in `adminhtml` (and to the `frontend` LESS file if relevant) as shown here:
5196

5297
![Create config file](../images/step6-icon-style.png)
5398

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:
99+
The following CSS rule set shows one general way to link your icons through CSS:
55100

56101
```css
57102
.icon-pagebuilder-quote {
@@ -61,19 +106,28 @@ Creating a CSS class for each icon provides an easy way to reference and displa
61106
}
62107
```
63108

109+
If you are creating an icon for the panel, replace the `background-image` attribute with `content` (as described in the content type tutorial, [Step 6: Add an icon](../create-basic-content-type/step-6-add-icon.md)).
110+
64111
| Attribute | Description |
65112
| ---------------------- | ------------------------------------------------------------ |
66113
| `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. |
114+
| `background-image url` | The `url` used for the `background-image` is the most critical part of your own CSS classes. 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. |
68115
| `width` | Sets the width of the icon image. |
69116
| `height` | Sets the height of the icon image. |
70117

71-
When deployed, your icon images are linked from `pub/static` as shown here:
118+
When deployed, your CSS classes and links to your icons are generated in `pub/static` as shown here:
72119

73120
![Create config file](../images/step6-icon-link-static.png)
74121

122+
For more general information about Magento's Admin icons and how to create your own icons for use in Magento, take a look at these topics:
123+
124+
* [Magento Admin icons]
125+
* [Create your own icons]
126+
* [The CMS icons repository]
127+
128+
75129

76130
[Magento Admin icons]: https://devdocs.magento.com/guides/v2.2/pattern-library/graphics/iconography/iconography.html
77-
[create your own icons]: https://devdocs.magento.com/guides/v2.2/pattern-library/graphics/iconography/iconography.html#creating-icons
78-
[cms-icons repository]: https://github.com/magento-ux/cms-icons
131+
[Create your own icons]: https://devdocs.magento.com/guides/v2.2/pattern-library/graphics/iconography/iconography.html#creating-icons
132+
[The CMS icons repository]: https://github.com/magento-ux/cms-icons
79133

382 Bytes
Loading
4.44 KB
Loading
10.6 KB
Loading
7.91 KB
Loading

0 commit comments

Comments
 (0)