diff --git a/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Content/SemanticSection.fusion b/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Content/SemanticSection.fusion index 786e76247..c3734b91b 100644 --- a/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Content/SemanticSection.fusion +++ b/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Content/SemanticSection.fusion @@ -2,7 +2,7 @@ prototype(Neos.NeosIo:SemanticSection) < prototype(Neos.Neos:ContentComponent) { isLast = ${iterator.isLast} renderer = afx` -
+

diff --git a/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Overrides/Image.fusion b/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Overrides/Image.fusion index a19d9b3b8..f322d99aa 100644 --- a/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Overrides/Image.fusion +++ b/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Overrides/Image.fusion @@ -12,13 +12,6 @@ prototype(Neos.NodeTypes:Image) < prototype(Neos.Neos:ContentComponent) { } image = ${q(node).property('image')} - imageClassName = Neos.Fusion:DataStructure { - alignment = ${'neos-alignment-' + q(node).property('alignment')} - alignment.@if.isSet = ${q(node).property('alignment')} - - addImageStyle = ${'image--style image--style-' + q(node).property('imageStyle')} - addImageStyle.@if.isSet = ${!String.isBlank(q(node).property('imageStyle'))} - } loading = 'lazy' lightbox = true @@ -52,51 +45,70 @@ prototype(Neos.NodeTypes:Image) < prototype(Neos.Neos:ContentComponent) { } } - renderer.@context.image = Neos.Fusion:Case { - default { - condition = ${props.image} - renderer = Neos.Neos:ImageTag { - asset = ${props.image} - title = ${props.title} - maximumHeight = ${props.maximumHeight} - maximumWidth = ${props.maximumWidth} - allowUpScaling = ${props.allowUpScaling} - allowCropping = ${props.allowCropping} - width = ${props.width} - height = ${props.height} - async = true - attributes { - alt = ${props.alternativeText} - loading = ${props.loading} - data-lightbox = Neos.Neos:ImageUri { - asset = ${props.image} - @if.enabled = ${props.lightbox} - @if.notInBackend = ${!renderingMode.isEdit && !renderingMode.isPreview} - } - style = Neos.Fusion:Join { - maxHeight = ${'max-height: ' + props.maximumHeight + 'px;'} - maxHeight.@if.set = ${props.maximumHeight} - } - } - } + @private { + className = Neos.Fusion:DataStructure { + main = 'neos-nodetypes-image' + + alignment = ${'neos-alignment-' + q(node).property('alignment')} + alignment.@if.isSet = ${q(node).property('alignment')} + } + + figureClassName = Neos.Fusion:DataStructure { + addImageStyle = ${'image--style image--style-' + q(node).property('imageStyle')} + addImageStyle.@if.isSet = ${!String.isBlank(q(node).property('imageStyle'))} } - fallback { - condition = ${!props.image && renderingMode.isEdit} - renderer = afx` - Dummy image - ` + + thumbnail = ${props.image ? Neos.Seo.Image.createThumbnail( + props.image, + null, + props.width, + props.maximumWidth, + props.height, + props.maximumHeight, + props.allowCropping, + props.allowUpScaling, + false + ) : null} + + imageSrc = Neos.Fusion:ResourceUri { + resource = ${private.thumbnail.resource} + @if.set = ${private.thumbnail} + } + + image = Neos.Fusion:Case { + image { + condition = ${private.imageSrc} + renderer = afx` + {props.alternativeText} + ` + } + fallback { + condition = true + renderer = afx` + Dummy image + ` + } } } renderer = afx` -
-
+
+
- {image} + {private.image} - {!props.link ? image : ''} + {!props.link ? private.image : ''}
{props.caption}
diff --git a/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Overrides/TextWithImage.fusion b/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Overrides/TextWithImage.fusion index 5dafa8c5c..e4fb6b9a4 100644 --- a/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Overrides/TextWithImage.fusion +++ b/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Overrides/TextWithImage.fusion @@ -5,8 +5,9 @@ prototype(Neos.NodeTypes:TextWithImage) < prototype(Neos.NodeTypes:Image) { property = 'text' } + className.main = 'neos-nodetypes-textwithimage' + renderer { - attributes.class = 'neos-nodetypes-textwithimage' content.@process.appendText = ${value + props.text} } } diff --git a/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Atoms/_Typography.scss b/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Atoms/_Typography.scss index 092ad07ba..5d575854b 100644 --- a/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Atoms/_Typography.scss +++ b/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Atoms/_Typography.scss @@ -3,7 +3,11 @@ */ p { - margin: 0 0 rs($basic-spacing); + margin: 0; + + & + * { + margin-top: rs($basic-spacing); + } } b, diff --git a/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Main.scss b/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Main.scss index 04eeea911..59e54f558 100644 --- a/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Main.scss +++ b/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Main.scss @@ -73,6 +73,7 @@ @import "Molecules/_EventList"; @import "Molecules/_VidoeEmbed"; @import "Molecules/_FormBuilder"; +@import "Molecules/_SemanticSection"; // Organisms @import "Organisms/_SiteHeader"; diff --git a/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Molecules/_Image.scss b/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Molecules/_Image.scss index 842c3a539..d369d8292 100644 --- a/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Molecules/_Image.scss +++ b/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Molecules/_Image.scss @@ -1,15 +1,20 @@ .neos-nodetypes-textwithimage, .neos-nodetypes-image { - @include u-cf(); + display: flex; + gap: rs($half-spacing, $unit: rem) rs($basic-spacing, $unit: rem); + flex-direction: column; + align-items: start; figure { --background-color: none; --color: currentColor; background-color: var(--background-color); color: var(--color); + display: flex; + flex-direction: column; - & + * { - margin-top: 1em; + img { + display: block; } figcaption { @@ -76,19 +81,19 @@ } .neos-alignment-left { - text-align: left; + flex-direction: row; } .neos-alignment-center { - text-align: center; + align-items: center; } .neos-alignment-right { - text-align: right; -} + flex-direction: row-reverse; -.neos-nodetypes-image { - margin-bottom: rs($basic-spacing, $unit: rem); + figure { + justify-content: end; + } } img[data-lightbox]:hover { diff --git a/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Molecules/_SemanticSection.scss b/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Molecules/_SemanticSection.scss new file mode 100644 index 000000000..a126f745f --- /dev/null +++ b/DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Molecules/_SemanticSection.scss @@ -0,0 +1,7 @@ +.semantic-section { + > .neos-contentcollection { + display: flex; + flex-direction: column; + gap: rs($basic-spacing, $unit: rem); + } +}