OpenTable: Allow the various block styles to be centre aligned#14633
OpenTable: Allow the various block styles to be centre aligned#14633
Conversation
The centre alignment wasn't working as the iframe is set to 100% and its content was left-aligned. The width of the iframe is getting set by the OpenTable embed JS code, so in order to override it, we need to use `!important`. That's not ideal, but I think as it's isolated, it should be ok.
|
Caution: This PR has changes that must be merged to WordPress.com |
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: March 3, 2020. |
|
This works for me, but I wonder if we should also get it working in the editor? |
+1 It's really annoying when editor and front end don't look the same. [data-type='jetpack/opentable'][data-align='center'] iframe {
margin: 0 auto;
width: 224px !important;
}EDIT: or... what @scruffian did in fd485d5 😄 |
|
pablinos, Your synced wpcom patch D38695-code has been updated. |
|
That's weird, it was working in the editor for me! |
|
Ah, so the centre alignment gets added as a data attribute to a parent
|
|
IMO we should make the editor and the frontend as close to each other as possible. |
jeherve
left a comment
There was a problem hiding this comment.
Seems to work well in my tests. 👍
|
r202886-wpcom |
* 8.3 release: changelog * Changelog: add #14516 * Changelog: add #14574 * Bring in changes from 8.2.1 and 8.2.2 * Update stable version * Bring in 8.2.3 changes * Changelog: add #14714 * Changelog: add #14639 * Changelog: add #14678 * Changelog: add #14673 * Changelog: add #14687 * Changelog: add #14704 * Changelog: add #14702 * Changelog: add #14541 * Changelog: add #14657 * Changelog: add #14622 * Changelog: add #14582 * Changelog: add #14638 * Changelog: add #14633 * Changelog: add #14571 * Changelog: add #14592 * Changelog: add #14539 * Changelog: add #14514 * Changelog: add #14643 * Changelog: add #14494 * Changelog: add #13739 * Changelog: add #14707 * Changelog: add #14736 * Changelog: add #14706 * Changelog: add #14730 * Changelog: add #14685 * Changelog: add #14727 * Changelog: add #14711 * Changelog: add #14742 * Changelog: add #14746 * Changelog: add #14725 * Changelog: add #13999 * Changelog: add #14740 * Changelog: add #14759 * Changelog: add #14703 * Changelog: add #14753 * Changelog: add #14754 * Changelog: add #14645 * Cahngelog: add #14599
The centre alignment wasn't working as the iframe is set to 100% and its
content was left-aligned.
Changes proposed in this Pull Request:
This change adds CSS to fix the width of the iframe when the embed is centre aligned. The width of the iframe is getting set by the OpenTable embed JS code, so in order to override it, we need to use
!important. That's not ideal, but I think as it's isolated, it should be ok.Is this a new feature or does it add/remove features to an existing part of Jetpack?
This is a bug fix to a new feature
Testing instructions:
Proposed changelog entry for your changes:
No changelog entry necessary.As this has moved milestone it probably does need a changelog entry now. How about:
Centre alignment fixed for the OpenTable block