Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout Grid: Enable mobile rendering in mobile editor. #161

Merged
merged 10 commits into from
Feb 4, 2021
2 changes: 1 addition & 1 deletion blocks/layout-grid/front.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@

// Ensure inner blocks with deliberate overflows are still constrained to column.
.wp-block-jetpack-layout-grid-column {
max-width: 100%;
max-width: 100%;
}
40 changes: 27 additions & 13 deletions blocks/layout-grid/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ function getSpacingValues() {
];
}

export const getPaddingValues = () => ( [
{ value: 'none', label: __( 'No padding', 'layout-grid' ) },
].concat( getSpacingValues() ) );
export const getPaddingValues = () =>
[ { value: 'none', label: __( 'No padding', 'layout-grid' ) } ].concat(
getSpacingValues()
);

export const getGutterValues = () => ( [
{ value: 'none', label: __( 'No gutter', 'layout-grid' ) },
].concat( getSpacingValues() ) );
export const getGutterValues = () =>
[ { value: 'none', label: __( 'No gutter', 'layout-grid' ) } ].concat(
getSpacingValues()
);

export const getColumns = () => ( [
export const getColumns = () => [
{
label: __( '1 column', 'layout-grid' ),
value: 1,
Expand All @@ -39,17 +41,29 @@ export const getColumns = () => ( [
label: __( '4 columns', 'layout-grid' ),
value: 4,
},
] );
];

export const DEVICE_DESKTOP = 'Desktop';
export const DEVICE_TABLET = 'Tablet';
export const DEVICE_MOBILE = 'Mobile';

export const getLayouts = () => ( [
{ value: DEVICE_DESKTOP, label: __( 'Desktop', 'layout-grid' ), icon: desktop },
{ value: DEVICE_TABLET, label: __( 'Tablet', 'layout-grid' ), icon: tablet },
{ value: DEVICE_MOBILE, label: __( 'Mobile', 'layout-grid' ), icon: mobile },
] );
export const getLayouts = () => [
{
value: DEVICE_DESKTOP,
label: __( 'Desktop', 'layout-grid' ),
icon: desktop,
},
{
value: DEVICE_TABLET,
label: __( 'Tablet', 'layout-grid' ),
icon: tablet,
},
{
value: DEVICE_MOBILE,
label: __( 'Mobile', 'layout-grid' ),
icon: mobile,
},
];

export const MAX_COLUMNS = 4;

Expand Down
Loading