|
61 | 61 | [How to create custom PageBuilder content type container]: how-to-create-custom-content-type-container.md
|
62 | 62 |
|
63 | 63 | ## What's in this topic
|
64 |
| -This topic describes Page Builder specifics for usage with custom themes. |
| 64 | +This topic describes how to use your custom themes to control responsive layouts within Page Builder. |
65 | 65 |
|
66 | 66 | ## Responsive Mobile Images
|
67 |
| -Within Page Builder we have dynamic style generation for our mobile background images for containers. This functionality requires the mobile breakpoint to be specified, if different from the modules configuration, within your theme. |
68 |
| - |
69 |
| -The module provides this configuration default within `Magento_PageBuilder/etc/view.xml`. We use the industry standard maximum width of 768px for the mobile image breakpoint. |
| 67 | +By default, when you configure Page Builder to render a background image for a container, it uses a mobile image when the container's width is less than the industry-standard max-width of 768px. This width is configured within `Magento_PageBuilder/etc/view.xml`, as follows: |
70 | 68 | ```xml
|
71 | 69 | <vars module="Magento_PageBuilder">
|
72 | 70 | <var name="breakpoints">
|
73 |
| - <var name="mobile">768px</var> |
| 71 | + <var name="mobile"> |
| 72 | + <var name="conditions"> |
| 73 | + <var name="max-width">768px</var> |
| 74 | + </var> |
| 75 | + </var> |
74 | 76 | </var>
|
75 | 77 | </vars>
|
76 | 78 | ```
|
77 | 79 |
|
78 |
| -If your theme utilises this breakpoint for your mobile layout no additional configuration is required. |
| 80 | +If your custom theme also uses this max-width breakpoint for your mobile layout, no additional configuration is required. |
79 | 81 |
|
80 |
| -If your theme does have a different mobile breakpoint you'll need to configure this value within your theme. This can be done within your themes `view.xml` by including the following within the `<view />` node: |
| 82 | +However, if your custom theme uses a different mobile breakpoint, you'll need to add that breakpoint (in pixels) to your theme's `view.xml` by including the following XML within the `<view />` node, and replacing `CUSTOM-BREAKPOINT` with the integer value of your theme's breakpoint, as follows: |
81 | 83 | ```xml
|
82 | 84 | <vars module="Magento_PageBuilder">
|
83 | 85 | <var name="breakpoints">
|
84 |
| - <var name="mobile">BREAKPOINTpx</var> |
| 86 | + <var name="mobile"> |
| 87 | + <var name="conditions"> |
| 88 | + <var name="max-width">CUSTOM-BREAKPOINTpx</var> |
| 89 | + </var> |
| 90 | + </var> |
85 | 91 | </var>
|
86 | 92 | </vars>
|
87 | 93 | ```
|
88 |
| -You need to replace `BREAKPOINT` with the integer value of your themes breakpoint. |
| 94 | + |
| 95 | +This directs Page Builder to use your theme's mobile breakpoint instead of its default breakpoint of 768px. Other responsive breakpoints from your custom theme can be added in the same way. |
| 96 | + |
| 97 | +[Note: I think it might be nice to include another example or two of configuring other breakpoints (or other styles?) from custom themes as relevant.] |
0 commit comments