-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from TYPO3incubator/task/textmedia-styling
Add textmedia element and styling
- Loading branch information
Showing
9 changed files
with
289 additions
and
19 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
local_packages/football/Resources/Private/Scss/Abstracts/Varibles/_variables.scss
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
// Variables | ||
$gallery-gutter-width: 1rem; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
@import "form"; | ||
@import "news"; | ||
@import "game"; | ||
@import "textmedia"; |
107 changes: 107 additions & 0 deletions
107
local_packages/football/Resources/Private/Scss/Elements/_textmedia.scss
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
.ce-gallery { | ||
|
||
figure { | ||
margin-block-end: 1rem; | ||
|
||
.ce-center & { | ||
margin-inline-start: auto; | ||
margin-inline-end: auto; | ||
} | ||
} | ||
|
||
img { | ||
display: block; | ||
} | ||
} | ||
|
||
@media (min-width: 500px) { | ||
|
||
.ce-intext { | ||
|
||
&::after { | ||
display: block; | ||
content: ''; | ||
clear: both; | ||
} | ||
|
||
&.ce-nowrap { | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
.ce-bodytext { | ||
width: calc(50% - (#{$gallery-gutter-width} / 2)); | ||
} | ||
|
||
&.ce-right { | ||
flex-direction: row-reverse; | ||
} | ||
} | ||
} | ||
|
||
.ce-gallery { | ||
|
||
.ce-intext & { | ||
width: calc(50% + (#{$gallery-gutter-width} / 2)); | ||
} | ||
|
||
// use padding for flexbox | ||
.ce-left:not(.ce-nowrap) & { | ||
float: inline-start; | ||
padding-inline-end: $gallery-gutter-width; | ||
} | ||
|
||
.ce-right:not(.ce-nowrap) & { | ||
float: inline-end; | ||
padding-inline-start: $gallery-gutter-width; | ||
} | ||
|
||
.ce-nowrap.ce-left & { | ||
padding-inline-end: $gallery-gutter-width; | ||
} | ||
|
||
.ce-nowrap.ce-right & { | ||
padding-inline-start: $gallery-gutter-width; | ||
} | ||
} | ||
} | ||
|
||
@media (min-width: 850px) { | ||
|
||
.ce-gallery { | ||
// if columns greater 1 | ||
&:not([data-ce-columns='1']) { | ||
|
||
.ce-row { | ||
display: flex; | ||
justify-content: space-between; | ||
flex-wrap: wrap; | ||
|
||
&::after { | ||
content: ''; | ||
flex: auto; | ||
} | ||
} | ||
|
||
.ce-column { | ||
width: 50%; | ||
padding-block: 0; | ||
padding-inline: calc(#{$gallery-gutter-width} / 2); | ||
|
||
&:first-child { | ||
padding-inline-start: 0; | ||
} | ||
|
||
&:last-child { | ||
padding-inline-end: 0; | ||
} | ||
} | ||
} | ||
|
||
&[data-ce-columns='3'] { | ||
|
||
.ce-column { | ||
width: 33.333%; | ||
} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...packages/football/Resources/Private/Templates/ContentElements/Partials/Media/Gallery.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true"> | ||
<f:if condition="{gallery.rows}"> | ||
<div class="ce-gallery{f:if(condition: data.imageborder, then: ' ce-border')}" data-ce-columns="{gallery.count.columns}" data-ce-images="{gallery.count.files}"> | ||
<f:if condition="{gallery.position.horizontal} == 'center'"> | ||
<div class="ce-outer"> | ||
<div class="ce-inner"> | ||
</f:if> | ||
<f:for each="{gallery.rows}" as="row"> | ||
<div class="ce-row"> | ||
<f:for each="{row.columns}" as="column"> | ||
<f:if condition="{column.media}"> | ||
<div class="ce-column"> | ||
<f:render partial="Media/Type" arguments="{file: column.media, dimensions: column.dimensions, data: data, settings: settings}" /> | ||
</div> | ||
</f:if> | ||
</f:for> | ||
</div> | ||
</f:for> | ||
<f:if condition="{gallery.position.horizontal} == 'center'"> | ||
</div> | ||
</div> | ||
</f:if> | ||
</div> | ||
</f:if> | ||
</html> |
4 changes: 4 additions & 0 deletions
4
.../football/Resources/Private/Templates/ContentElements/Partials/Media/Rendering/Image.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true"> | ||
<f:media class="image-embed-item" file="{file}" width="{dimensions.width}" height="{dimensions.height}" alt="{file.alternative}" title="{file.title}" loading="{settings.media.lazyLoading}" decoding="{settings.media.imageDecoding}" /> | ||
</html> |
13 changes: 13 additions & 0 deletions
13
local_packages/football/Resources/Private/Templates/ContentElements/Partials/Media/Type.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true"> | ||
<f:switch expression="{file.type}"> | ||
<f:case value="3"> | ||
<f:render partial="Media/Type/Audio" arguments="{file: file, dimensions: dimensions, data: data, settings: settings}" /> | ||
</f:case> | ||
<f:case value="4"> | ||
<f:render partial="Media/Type/Video" arguments="{file: file, dimensions: dimensions, data: data, settings: settings}" /> | ||
</f:case> | ||
<f:defaultCase> | ||
<f:render partial="Media/Type/Image" arguments="{file: file, dimensions: dimensions, data: data, settings: settings}" /> | ||
</f:defaultCase> | ||
</f:switch> | ||
</html> |
19 changes: 19 additions & 0 deletions
19
...kages/football/Resources/Private/Templates/ContentElements/Partials/Media/Type/Image.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true"> | ||
<figure class="image"> | ||
<f:if condition="{file.link}"> | ||
<f:then> | ||
<f:link.typolink parameter="{file.link}" title="{file.title}"> | ||
<f:render partial="Media/Rendering/Image" arguments="{file: file, dimensions: dimensions, settings: settings}" /> | ||
</f:link.typolink> | ||
</f:then> | ||
<f:else> | ||
<f:render partial="Media/Rendering/Image" arguments="{file: file, dimensions: dimensions, settings: settings}" /> | ||
</f:else> | ||
</f:if> | ||
<f:if condition="{file.description}"> | ||
<figcaption class="image-caption"> | ||
{file.description -> f:format.nl2br()} | ||
</figcaption> | ||
</f:if> | ||
</figure> | ||
</html> |
51 changes: 32 additions & 19 deletions
51
local_packages/football/Resources/Private/Templates/ContentElements/TextMedia.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,38 @@ | ||
<html data-namespace-typo3-fluid="true" | ||
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"> | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true"> | ||
|
||
<f:render partial="Header/All" arguments="{_all}" /> | ||
|
||
<f:if condition="{data.bodytext}"> | ||
<div> | ||
<f:format.html>{data.bodytext}</f:format.html> | ||
</div> | ||
<f:if condition="{gallery.position.noWrap} != 1"> | ||
<f:render partial="Header/All" arguments="{_all}" /> | ||
</f:if> | ||
|
||
<f:if condition="{files}"> | ||
<f:media file="{files.0}"></f:media> | ||
<div> | ||
Image meta: | ||
<ul> | ||
<li>alt-text: {files.0.alternative}</li> | ||
<li>title: {files.0.title}</li> | ||
<li>description: {files.0.description}</li> | ||
<li>position: {data.imageorient}</li> | ||
</ul> | ||
</div> | ||
</f:if> | ||
<div class="ce-textpic ce-{gallery.position.horizontal} ce-{gallery.position.vertical}{f:if(condition: gallery.position.noWrap, then: ' ce-nowrap')}"> | ||
<f:if condition="{gallery.position.vertical} != 'below'"> | ||
<f:render partial="Media/Gallery" arguments="{_all}" /> | ||
</f:if> | ||
|
||
<f:if condition="{data.bodytext}"> | ||
<f:then> | ||
<div class="ce-bodytext"> | ||
<f:if condition="{gallery.position.noWrap}"> | ||
<f:render partial="Header/All" arguments="{_all}" /> | ||
</f:if> | ||
<f:format.html>{data.bodytext}</f:format.html> | ||
</div> | ||
</f:then> | ||
<f:else> | ||
<f:if condition="{gallery.position.noWrap}"> | ||
<f:if condition="{data.header}"> | ||
<div class="ce-bodytext"> | ||
<f:render partial="Header/All" arguments="{_all}" /> | ||
</div> | ||
</f:if> | ||
</f:if> | ||
</f:else> | ||
</f:if> | ||
|
||
<f:if condition="{gallery.position.vertical} == 'below'"> | ||
<f:render partial="Media/Gallery" arguments="{_all}" /> | ||
</f:if> | ||
</div> | ||
|
||
</html> |
This file contains 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