feat: add CSS float and alignment support for images and figures#1174
Merged
linawolf merged 2 commits intoTYPO3-Documentation:mainfrom Feb 28, 2026
Merged
Conversation
c63597b to
0cf2a02
Compare
This was referenced Feb 12, 2026
docs: document image/figure float and alignment
TYPO3-Documentation/TYPO3CMS-Guide-HowToDocument#510
Merged
CybotTM
added a commit
to CybotTM/TYPO3CMS-Guide-HowToDocument
that referenced
this pull request
Feb 12, 2026
Add documentation for the new CSS float and alignment support for images and figures introduced in render-guides 0.37.0. Split the monolithic Images.rst into three focused pages: - Images.rst: basics, parameters, Examples 1-2 - ImageZoom.rst: zoom modes, options, accessibility, Examples 3-7 - ImageAlignment.rst: float/align, clearing, responsive, Examples 8-10 Depends on: TYPO3-Documentation/render-guides#1174
linawolf
reviewed
Feb 14, 2026
linawolf
reviewed
Feb 14, 2026
CybotTM
added a commit
to CybotTM/TYPO3CMS-Guide-HowToDocument
that referenced
this pull request
Feb 14, 2026
Add documentation for the new CSS float and alignment support for images and figures introduced in render-guides 0.37.0. Split the monolithic Images.rst into three focused pages: - Images.rst: basics, parameters, Examples 1-2 - ImageZoom.rst: zoom modes, options, accessibility, Examples 3-7 - ImageAlignment.rst: float/align, clearing, responsive, Examples 8-10 Depends on: TYPO3-Documentation/render-guides#1174
ineswillenbrock
approved these changes
Feb 17, 2026
Contributor
ineswillenbrock
left a comment
There was a problem hiding this comment.
It might have been better to modernize the classes and use float-start and float-end: those are the replacements for float-left and float-right.
But this one might be the safer option: who knows where the float options are used besides the rendered content
3 tasks
d8cea7a to
3b6155f
Compare
Closed
5 tasks
Member
|
It would be great to have functional tests covering the changes to the figure directive |
Contributor
Author
|
Added in 4322425 — integration tests covering:
All 113 integration tests pass. |
eb0ec66 to
8eb929c
Compare
8eb929c to
e20a1b7
Compare
Add missing float and alignment CSS for images and figures, replacing the deprecated HTML align attribute with CSS class mapping. - Add float-left/float-right CSS rules for img and figure elements with max-width: 50% and responsive breakpoint at 575.98px - Add align-center CSS for centered images and figures - Map :align: left/right/center to CSS classes in Twig templates, replacing the deprecated HTML align attribute on <img> - Preserve :align: option on FigureNode (was being stripped) - Strip float classes from inner <img> inside <figure> to prevent caption wrapping issues - Add .clear-both CSS utility alias alongside existing .cc - Split ImagesAndFigures rendertest into Index, Zoom, and FloatAndAlignment pages
Cover all float/alignment scenarios: - Figure :align: left/right/center maps to CSS classes - Image :align: left/right/center maps to CSS classes - Figure :class: float-left/right (float stripped from inner img) - Mixed :class: float-left with-shadow (extra classes preserved) - Image :class: float-right - Combined :align: + :class: (both applied to figure element)
e20a1b7 to
9c48651
Compare
linawolf
approved these changes
Feb 28, 2026
Member
|
Thanks for your contribution! |
linawolf
pushed a commit
to TYPO3-Documentation/TYPO3CMS-Guide-HowToDocument
that referenced
this pull request
Mar 1, 2026
* docs: document image/figure float and alignment options Add documentation for the new CSS float and alignment support for images and figures introduced in render-guides 0.37.0. Split the monolithic Images.rst into three focused pages: - Images.rst: basics, parameters, Examples 1-2 - ImageZoom.rst: zoom modes, options, accessibility, Examples 3-7 - ImageAlignment.rst: float/align, clearing, responsive, Examples 8-10 Depends on: TYPO3-Documentation/render-guides#1174 * fix: correct heading underline characters for TYPO3 convention When ImageZoom.rst and ImageAlignment.rst were extracted from Images.rst into their own pages, heading underline characters were not promoted to match the new document hierarchy. Sections that were h3/h4 in the parent document need to become h2/h3 as standalone pages. TYPO3 heading convention: - h1: = above and below (page title) - h2: = below only (sections) - h3: - below only (subsections) - h4: ~ below only (sub-subsections) Signed-off-by: Sebastian Mendel <info@sebastianmendel.de> --------- Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves: #1172
Summary
float: left/float: rightCSS properties toimg.float-left/img.float-rightrules (Bootstrap 5 removed these)figure.float-left,figure.float-right) withmax-width: 50%and responsive breakpoint (<576px disables float)img.align-center/figure.align-centerCSS for centered alignmentalignattribute inimage.html.twigwith CSS class mapping (:align: left→float-left,:align: right→float-right,:align: center→align-center):align:CSS class support infigure.html.twig:align:option on FigureNode (was being stripped) so.. figure:: :align: leftworksfloat-left/float-rightfrom inner<img>inside<figure>to prevent caption wrapping issues.clear-bothCSS utility alias (alongside existing.cc)ImagesAndFiguresrendertest into separate pages: Index (styling), Zoom, FloatAndAlignmentFiles changed
assets/sass/components/_rst.scssfloatproperty +align-centerto img rulesassets/sass/components/_images.scssassets/sass/_utilities.scss.clear-bothaliasresources/template/body/image.html.twigalignattr with CSS classesresources/template/body/figure.html.twig:align:CSS class supportsrc/Directives/FigureDirective.php:align:on FigureNode, strip float from inner imgresources/public/css/theme.cssDocumentation-rendertest/ImagesAndFigures/Test plan
:align: left/:align: righton figures works correctly.clear-bothclears floats as expectedRelated
float-start/float-end)finalfrom upstream directives to avoid forking