You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
15
15
16
-
## Creating icon fonts
16
+
## Creating SVG or PNG icons
17
17
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.
20
19
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:
22
21
23
-
1. Go to <ahref="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
24
25
25
-
2. Upload your icons in SVG format into the app.
26
+
### Panel icons
26
27
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:
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:
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:
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:
|`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:
0 commit comments