Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Toggle responsiveness for embed blocks #10161
Added an inspector control to toggle responsive classes on a per block basis.
How has this been tested?
Start a post, embed a youtube video.
Types of changes
New feature (non-breaking change which adds functionality)
This is SOLID!
It's a little hard to see what the difference is based on that GIF, but it works. Here's the front-end without the Responsive toggle:
In this case, the TwentySeventeen technically makes the video responsive, it's just not as good as the true aspect ratio sensitive responsiveness we made. And it's also going to be on a per-theme basis, obviously.
SO THIS IS WONDERFUL, I think it's a great solution.
Two things. There appears to be an extra bottom margin on the stock iframe that's beeing output:
This pushes the caption down. @kjellr as a theme expert, do you have any insights here on whether this is something Twenty Seventeen adds, or something else? Should we zero it out?
And secondly, we should rephrase the toggle a bit. Right now it says:
This is good, but can be better, especially given the context above where the theme might be providing some tricks. I'm also not sure the casual user knows what "responsive" means. Perhaps we could do:
Something in that vein?
@michelleweber any insights?
I agree about the milestone, and because it's there it means it will get code reviews when the time comes. But I expanded the range just to expediate it. Reason being: while I completely trust your code, and the design/experience is
tofumatt left a comment
This seems good to me, I'm just confused about why we prefix a method with a "maybe" but don't say when the "maybe"'s condition is met.
I also think we should get the attribute to align with the help text. But can embeds be something other than video? Should we be saying Allow content to resize rather than Allow video to resize?
Once those things are clarified though this is good to go. Ping me for another review and we can definitely get this in for 4.0
tofumatt left a comment
Code looks good to me now, I just have one request for a change of argument name at
There's also a "Responsive" label still–do we want to change that?