Fix video alignment after dependency update without CSS #10611
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Retry of #10566, see that PR for details of the problem we're solving.
Tested on Firefox and Edge, checked videos and tables.
This time, use




:align: defaultfor each video, but don't add any custom CSS. This will align videos on the left without floating:Since no CSS is changed, tables still render correctly:
Left alignment matches the behavior of 4.3 videos. While I think center alignment looks a bit better, I don't see a clear way to do it without introducing additional tags at every video usage, and left alignment looks fine and matches existing behavior.
Why we can't use
:align: left, as the plugin intends:It left-aligns with
floatdue to our Sphinx theme, see the original PR for details.Why we can't use
:align: centerto center, as the plugin intends:It left-aligns due to our Sphinx theme.
Why we can't use
:align: defaultwith custom CSS just for videos, to center:The video plugin places the video inside a div which only has the
align-defaultclass, so there's no way to specifyalign-defaultjust for the videos. We could add a class with:class:, see here. But after reverting the first fix, I'm not sure trying to maintain custom CSS just to center videos is worth the maintenance, and this would also require the use of an extra tag at every video instance.