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

Restore captions for image and embed #7749

Merged
merged 1 commit into from
Jul 6, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion core-blocks/embed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import apiRequest from '@wordpress/api-request';
*/
import './style.scss';
import './editor.scss';
import './theme.scss';

// These embeds do not work in sandboxes
const HOSTS_NO_PREVIEWS = [ 'facebook.com' ];
Expand Down
9 changes: 9 additions & 0 deletions core-blocks/embed/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@
max-width: $content-width / 2;
width: 100%;
}

.wp-block-embed {
// Supply caption styles to images, even if the theme hasn't opted in.
// Reason being: the new markup, figcaptions, are not likely to be styled in the majority of existing themes,
Copy link
Member

Choose a reason for hiding this comment

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

Is this intended to be deprecated eventually, once themes know about this new markup? Or will we keep it?

This comment reads a bit like it's a stop-gap.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should phase it away, but don't want to rush it because it will cause a visual degradation at this moment.

// so we supply the styles so as to not appear broken or unstyled in those.
figcaption {
@include caption-style();
}
}
3 changes: 0 additions & 3 deletions core-blocks/embed/theme.scss

This file was deleted.

1 change: 0 additions & 1 deletion core-blocks/image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { createBlobURL } from '@wordpress/blob';
* Internal dependencies
*/
import './style.scss';
import './theme.scss';
import edit from './edit';

export const name = 'core/image';
Expand Down
7 changes: 7 additions & 0 deletions core-blocks/image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@
max-width: none;
}
}

// Supply caption styles to images, even if the theme hasn't opted in.
// Reason being: the new markup, figcaptions, are not likely to be styled in the majority of existing themes,
// so we supply the styles so as to not appear broken or unstyled in those.
figcaption {
@include caption-style();
}
}
5 changes: 0 additions & 5 deletions core-blocks/image/theme.scss

This file was deleted.