Skip to content

Commit e111af6

Browse files
committed
Merge branch 'MAGEDOC-3438' into 1.0.0-beta-release
2 parents db6ca9f + 05e7dd2 commit e111af6

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
# Responsive layouts
1+
# Overwriting responsive breakpoints
22

3-
<!-- {% raw %} -->
3+
This topic describes how to change the default mobile breakpoint in Page Builder.
44

5-
## What's in this topic
5+
## Default mobile breakpoint
66

7-
This topic describes how to use your custom themes to control responsive layouts within Page Builder.
8-
9-
## Responsive Mobile Images
10-
11-
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:
7+
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 equal to and less than 768px. Page Builder defines this mobile breakpoint in the `Magento_PageBuilder/etc/view.xml` file, as shown here:
128

139
```xml
10+
<?xml version="1.0"?>
11+
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
12+
...
1413
<vars module="Magento_PageBuilder">
1514
<var name="breakpoints">
1615
<var name="mobile">
@@ -22,24 +21,32 @@ By default, when you configure Page Builder to render a background image for a c
2221
</vars>
2322
```
2423

25-
If your custom theme also uses this max-width breakpoint for your mobile layout, no additional configuration is required.
24+
## Changing the mobile breakpoint
25+
26+
If your custom theme also uses this max-width breakpoint for your mobile layout, no changes are required.
27+
28+
However, if your custom theme uses a different mobile breakpoint, you need to overwrite the default breakpoint by either:
2629

27-
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:
30+
1. Adding the theme's breakpoint to the theme's `view.xml` file.
31+
2. Adding a `view.xml` file in the `etc` directory of your content type as shown here:
32+
33+
![product conditions](../images/how-to-change-breakpoint.png "Add view.xml file")
34+
35+
In either case, if your theme uses a mobile breakpoint `max-width` of `600px`, you would add the following markup to the `view.xml` file:
2836

2937
```xml
30-
<vars module="Magento_PageBuilder">
31-
<var name="breakpoints">
32-
<var name="mobile">
33-
<var name="conditions">
34-
<var name="max-width">CUSTOM-BREAKPOINTpx</var>
38+
<?xml version="1.0"?>
39+
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
40+
<vars module="Magento_PageBuilder">
41+
<var name="breakpoints">
42+
<var name="mobile">
43+
<var name="conditions">
44+
<var name="max-width">600px</var>
45+
</var>
3546
</var>
3647
</var>
37-
</var>
38-
</vars>
48+
</vars>
49+
</view>
3950
```
4051

41-
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.
42-
43-
[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.]
44-
45-
<!-- {% endraw %} -->
52+
This directs Page Builder to use this mobile breakpoint instead of its default breakpoint of 768px. Other responsive breakpoints from your custom theme can be added in the same way.
21.2 KB
Loading

0 commit comments

Comments
 (0)