-
Notifications
You must be signed in to change notification settings - Fork 847
Calendly: Changed the embed, to remove the inline styles #14579
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
Conversation
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: March 3, 2020. |
|
This looks good to me, just two thoughts:
I wonder if we can fire an event on resize to sort this out? I added an issue for it: #14619 |
Well, no, but there's no other option really. If we allow it to add the inline styles it breaks things, and to override it, we'd probably have to get into a lot of theme-specific CSS, or sprinkling
Yes, I don't think there's much we can do about that at the moment. It's all wrapped up with the problem of alignment and the way these aligned embeds are positioned using |
834381b to
366bc2c
Compare
jeherve
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me, I only have minor comments left.
The inline styles added to the parent container by the Calendly script were interferring with the CSS used for aligning elements to the left and right on the desktop view of Twenty Twenty (and so probably other themes) An undocumented option to the init function stops these styles being added, and so this change swaps the embed code to set that option, as well as tweak the CSS to make a best effort at laying out the embed when aligned to the sides.
The render_callback was being called to get the content of the page in the admin, and this was causing the block embed to render full screen when it was inline mode. This short circuits the render callback in the admin.
We've discovered using `wp_unique_id`, so it seemed sensible to use that here. There was a check for is_admin in the render callback, because of an error with the post being rendered as the editor loaded. I can't replicate this now, so I've removed the check.
The inline styles added to the parent container by the Calendly script were interferring with the CSS used for aligning elements to the left and right on the desktop view of Twenty Twenty (and so probably other themes) An undocumented option to the init function stops these styles being added, and so this change swaps the embed code to set that option, as well as tweak the CSS to make a best effort at laying out the embed when aligned to the sides.
The render_callback was being called to get the content of the page in the admin, and this was causing the block embed to render full screen when it was inline mode. This short circuits the render callback in the admin.
001c029 to
b829347
Compare
|
Ready for another review. |
jeherve
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well in my tests. 👍
|
Caution: This PR has changes that must be merged to WordPress.com |
|
r203460-wpcom |

The inline styles added to the parent container by the Calendly script
were interfering with the CSS used for aligning elements to the left
and right on the desktop view of Twenty Twenty (and so probably other
themes)
Changes proposed in this Pull Request:
An undocumented option to the init function stops these styles being
added, and so this change swaps the embed code to set that option, as
well as tweak the CSS to make the best effort at laying out the embed when
aligned to the sides.
Is this a new feature or does it add/remove features to an existing part of Jetpack?
This an improvement on a new feature
Testing instructions:
There are still some known problems with the Twenty Twenty theme and alignment of blocks, but having discussed it with @kjellr (p1580823343135400-slack-themes), we've decided that it's best to leave the layout to the theme and make the block as lightweight as possible.
Proposed changelog entry for your changes: