Skip to content

Commit 3bae1ba

Browse files
bdenhamdavemacaulay
authored andcommitted
MC-3805: Write dev docs for responsive mobile images
- Edited/rewrote to be make intent and instructions more explicit.
1 parent 590c553 commit 3bae1ba

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

app/code/Magento/PageBuilder/docs/custom-themes.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,28 +61,37 @@
6161
[How to create custom PageBuilder content type container]: how-to-create-custom-content-type-container.md
6262

6363
## 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.
6565

6666
## 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:
7068
```xml
7169
<vars module="Magento_PageBuilder">
7270
<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>
7476
</var>
7577
</vars>
7678
```
7779

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.
7981

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:
8183
```xml
8284
<vars module="Magento_PageBuilder">
8385
<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>
8591
</var>
8692
</vars>
8793
```
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

Comments
 (0)