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

Update general padding of newsletter to increase white space #178

Merged
merged 2 commits into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion includes/class-newspack-newsletters-renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ function ( $key ) use ( &$attrs ) {
$attrs['full-width'] = 'full-width';
unset( $attrs['align'] );
}

if ( isset( $attrs['full-width'] ) && 'full-width' == $attrs['full-width'] && isset( $attrs['background-color'] ) ) {
$attrs['padding'] = '20px 0';
}

return $attrs;
}

Expand Down Expand Up @@ -190,7 +195,7 @@ private static function render_mjml_component( $block, $is_in_column = false, $i
// Default attributes for the column which will envelop the component.
$column_attrs = array_merge(
array(
'padding' => '16px',
'padding' => '20px',
)
);

Expand Down Expand Up @@ -298,6 +303,8 @@ private static function render_mjml_component( $block, $is_in_column = false, $i

$default_button_attrs = array(
'padding' => '0',
'inner-padding' => '12px 24px',
'line-height' => '1.8',
'href' => $anchor->getAttribute( 'href' ),
'border-radius' => $border_radius . 'px',
'font-size' => '18px',
Expand Down
7 changes: 6 additions & 1 deletion includes/email-template.mjml.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@
/* Has Background */
.mj-column-has-width .has-background,
.mj-column-per-50 .has-background {
padding: 16px;
padding: 20px;
}

/* Mailchimp Footer */
#canspamBarWrapper {
border: 0 !important;
}
</mj-style>
</mj-head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default ( { onInsertTemplate, templates } ) => {
aria-label={ title }
>
<div className="newspack-newsletters-layouts__item-preview">
<BlockPreview blocks={ parse( content ) } viewportWidth={ 568 } />
<BlockPreview blocks={ parse( content ) } viewportWidth={ 560 } />
</div>
<div className="newspack-newsletters-layouts__item-label">{ title }</div>
</div>
Expand All @@ -54,7 +54,7 @@ export default ( { onInsertTemplate, templates } ) => {

<div className="newspack-newsletters-modal__preview">
{ blockPreview && blockPreview.length > 0 ? (
<BlockPreview blocks={ blockPreview } viewportWidth={ 568 } />
<BlockPreview blocks={ blockPreview } viewportWidth={ 560 } />
) : (
<p>{ __( 'Select a layout to preview.', 'newspack-newsletters' ) }</p>
) }
Expand Down
2 changes: 1 addition & 1 deletion src/components/template-modal/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
&__container {
align-self: flex-start;
margin: 0 auto;
max-width: 568px;
max-width: 560px;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/editor/blocks/posts-inserter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const PostsInserterBlock = ( { setAttributes, attributes, postList, replaceBlock
<span>{ __( 'Posts Inserter', 'newspack-newsletters' ) }</span>
</div>
<div className="newspack-posts-inserter__preview">
<BlockPreview blocks={ templateBlocks } viewportWidth={ 566 } />
<BlockPreview blocks={ templateBlocks } viewportWidth={ 558 } />
</div>
<Button isPrimary onClick={ () => setAttributes( { areBlocksInserted: true } ) }>
{ __( 'Insert posts', 'newspack-newsletters' ) }
Expand Down
66 changes: 56 additions & 10 deletions src/editor/editor/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.wp-block {
max-width: 568px;
max-width: 560px;
}

.editor-post-title {
Expand All @@ -16,18 +16,18 @@
}

.wp-block-column {
padding-bottom: 16px;
padding-bottom: 20px;

> :first-child {
margin-top: 16px !important;
margin-top: 20px !important;

> .wp-block-image {
margin-top: 0;
}
}

> * {
margin-top: -32px !important;
margin-top: -40px !important;
}
}

Expand All @@ -44,12 +44,16 @@
}

.block-editor-block-list__block {
margin-bottom: 32px;
margin-top: 32px;
margin-bottom: 40px;
margin-top: 40px;

&.wp-block-group {
&.has-background {
padding: 16px;
padding: 20px;

+ .has-background {
margin-top: 20px;
}

.block-editor-block-list__layout {
:first-child {
Expand All @@ -70,16 +74,58 @@
}

+ .wp-block-group {
margin-top: -16px;
margin-top: -20px;
}
}

&[data-type='core/list'] {
padding-right: 0;
}

&[data-type='core/button'] {
margin-bottom: 0;
margin-top: 0;
}

&[data-type='core/separator'] {
margin-bottom: 40px;
margin-top: 40px;

hr {
margin: 0;
}
}

.block-library-spacer__resize-container {
margin-bottom: 16px;
margin-bottom: 20px;
}

&.has-background {
margin-bottom: -20px;
margin-top: -20px;

+ .has-background,
+ [data-align='full'] .wp-block-group.has-background {
margin-top: 20px;
}
}
}

[data-align='full'] {
.wp-block-group.has-background {
padding-bottom: 40px;
padding-top: 40px;
}

+ .has-background,
+ [data-align='full'] .wp-block-group.has-background {
margin-top: 20px;
}
}

[data-align='center'] {
figure.wp-block-image:not( .wp-block ) {
margin: 40px 0;
}
}

Expand All @@ -91,7 +137,7 @@
h6,
p {
&.has-background {
padding: 16px;
padding: 20px;
}
}
}
2 changes: 1 addition & 1 deletion src/editor/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default compose( [
<div className="newspack-newsletters-layouts">
<div className="newspack-newsletters-layouts__item">
<div className="newspack-newsletters-layouts__item-preview">
<BlockPreview blocks={ blockPreview } viewportWidth={ 568 } />
<BlockPreview blocks={ blockPreview } viewportWidth={ 560 } />
</div>
<div className="newspack-newsletters-layouts__item-label">{ title }</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/editor/sidebar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@
margin: 0;
}
}

.interface-interface-skeleton__sidebar {
.components-notice {
margin: 0;
}
}
adekbadek marked this conversation as resolved.
Show resolved Hide resolved