chiark / gitweb /
css: work around Firefox-specific behavior with .m-figure.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 4 Jan 2022 18:54:09 +0000 (19:54 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Tue, 4 Jan 2022 19:53:57 +0000 (20:53 +0100)
commitb04d3d30db165ac155ab64720851302ff17e4266
treea51c4cb514ce42eefde91f746caabc5d4811ffbd
parente1c9a00a945635fdffaf227beed2d22b4df67da0
css: work around Firefox-specific behavior with .m-figure.

The `.m-figure > *` has `display: table-caption;` to make overlong
content wrap to width of the image, instead of pushing out the figure
border. However, this makes Firefox render just the first element and
ignore everything after, thus the original figure descriptions weren't
visible in Firefox, only in Chrome.

Because HTML5 says <figcaption> has to be right inside <figure>, I can't
wrap the caption together with other content in a <span>, although that
would make Firefox render things properly. Instead I'm nesting all
description inside <figcaption> in a .m-figure-description, which then
reverts all styling applied for <figcaption>. Kinda ew, but works.

Originally this was reported for just image figures, but the same
problem applies to math and graph figures as well. Not for code/console
figure though, as those don't have `display: table-caption;` and instead
span the whole width always.

This has to be fixed in m.htmlsanity as well, doing that in a separate
commit as it's a bit involved as well.
css/m-components.css
css/m-dark+documentation.compiled.css
css/m-dark.compiled.css
css/m-light+documentation.compiled.css
css/m-light.compiled.css
doc/css/components-test.rst
doc/css/components.rst