Open jimjam-slam opened 2 hours ago
I should note that if you remove the offending image in #notworking
, the layout works fine!
Thanks, I can repro.
You can work around in the meantime by moving the offending image to its own div
.
I believe the issue arises from our expectation that .column-screen
would be used to wrap a single element at a time. (You can infer this from the way we use it in our docs, but we never actually describe this and I think everything should just work.)
That makes sense! I've reached for it in the past to build things like website hero sections, so if it's possible for it to work with more complex layouts, that would be fantastic (but I understand that you hadn't intended it for that kind of use).
Absolute worst case for us over on Closeread, we could potentially write our own CSS to re-implement the .column-*
class 🤔 (cc @andrewpbray)
Bug description
When we place an image with a caption inside a fenced div with
.column-screen
, the image gets.column-screen
and the section does not, which causes various kinds of layout havoc (the rest of the section doesn't get the enlarged width, and.page-columns
propagates up from the image through the rest of the document, which makes placing one's own CSS grids inside the section extremely difficult).Steps to reproduce
Test case: https://github.com/jimjam-slam/test-quarto-cr-img-classes
Expected behavior
The fenced div in the input document that has
.column-screen
should have it in the output HTML, and the image inside#notworking
should not. The other ancestors of the image should also not have.page-fill .page-columns
.Actual behavior
The image receives
.column-screen
and goes to full width. Other elements in the section don't. Any nested grids declared inside the broken section tend to get overridden, as.page-columns
is on all ancestors of the image inside.Your environment
Quarto check output
EDIT: added a screenshot of the output, and also a link to previous discussion: