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

Embed: Fix failure placeholder alignment/sizing #19673

Merged
merged 3 commits into from
Jan 21, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
12 changes: 6 additions & 6 deletions packages/block-library/src/embed/embed-placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ const EmbedPlaceholder = ( props ) => {
>
{ _x( 'Embed', 'button label' ) }
</Button>
{ cannotEmbed &&
<p className="components-placeholder__error">
{ __( 'Sorry, this content could not be embedded.' ) }<br />
<Button isSecondary onClick={ tryAgain }>{ _x( 'Try again', 'button label' ) }</Button> <Button isSecondary onClick={ fallback }>{ _x( 'Convert to link', 'button label' ) }</Button>
</p>
}
</form>
<div className="components-placeholder__learn-more">
<ExternalLink href={ __( 'https://wordpress.org/support/article/embeds/' ) }>
{ __( 'Learn more about embeds' ) }
</ExternalLink>
</div>
{ cannotEmbed &&
<div className="components-placeholder__error">
{ __( 'Sorry, this content could not be embedded.' ) }<br />
<Button isSecondary onClick={ tryAgain }>{ _x( 'Try again', 'button label' ) }</Button> <Button isSecondary onClick={ fallback }>{ _x( 'Convert to link', 'button label' ) }</Button>
</div>
}
</Placeholder>
);
};
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/table/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
}
}

.components-base-control__field {
margin-bottom: 0;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes the bottom margins of the input fields, allowing the Inputs + Button to align correctly.

}

.wp-block-table__placeholder-button {
margin-top: auto;
margin-right: auto;
Expand Down
6 changes: 6 additions & 0 deletions packages/components/src/placeholder/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
}
}

.components-placeholder__error,
.components-placeholder__instructions,
.components-placeholder__label,
.components-placeholder__fieldset {
Expand Down Expand Up @@ -74,6 +75,11 @@
margin-bottom: 1em;
}

.components-placeholder__error {
margin-top: 1em;
width: 100%;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required to render underneath the help text, considering the display: flex based wrapper.

}

.components-placeholder__preview img {
margin: 3%;
width: 50%;
Expand Down