add sectioned template style

This commit is contained in:
isUnknown 2024-09-03 15:46:35 +02:00
parent 5f8bdc66c0
commit caf16ee9ca
8 changed files with 80 additions and 4 deletions

View file

@ -161,3 +161,13 @@
.no-padding {
padding: 0 !important;
}
.shift-large {
margin-left: var(--shift-large);
}
.shift-medium {
margin-left: var(--shift-medium);
}
.shift-small {
margin-left: var(--shift-small);
}

View file

@ -0,0 +1,20 @@
[data-template="sectioned"] main p {
font-size: var(--font-size-s);
}
[data-template="sectioned"] main .big p {
font-size: var(--font-size-m);
}
[data-template="sectioned"] main h2 {
font-weight: bold;
margin-bottom: calc(var(--padding-vertical) / 1.5);
}
[data-template="sectioned"] .blocks > *:not(:last-child) {
margin-bottom: 1rem;
}
[data-template="sectioned"] main section:nth-child(odd):not(:first-child) {
background-color: var(--color-brown-light);
}

View file

@ -11,6 +11,10 @@
--font-size-h1: 2.8125rem;
--font-size-xl: 3.75rem;
--shift-large: 7vw;
--shift-medium: calc(var(--shift-large) / 2);
--shift-small: calc(var(--shift-medium) / 2);
--curve-quick-slow: cubic-bezier(0.455, 0.03, 0.515, 0.955);
--curve-quick: cubic-bezier(0.23, 1, 0.32, 1);
--padding-vertical: 2rem;

View file

@ -15,4 +15,5 @@
@import url("src/swiper.css");
@import url("src/collapsable-section.css");
@import url("src/program-filters.css");
@import url("src/page-sectioned.css");
@import url("src/footer.css");

View file

@ -3,17 +3,24 @@ icon: text
wysiwyg: true
preview: text
fields:
text:
label: Texte
type: writer
placeholder: field.blocks.text.placeholder
leftMargin:
label: ⇥ Marge gauche
type: radio
columns: 4
default: false
width: 3/4
options:
false: Aucune
small: Petite
medium: Moyenne
large: Grande
text:
label: Texte
type: writer
placeholder: field.blocks.text.placeholder
isBig:
label: Grand
type: toggle
default: false
width: 1/4
help: Augmente la taille du texte

View file

@ -0,0 +1,5 @@
<ul>
<?php foreach($block->toStructure() as $item): ?>
<li></li>
<?php endforeach ?>
</ul>

View file

@ -0,0 +1,3 @@
<div class="<?php e($block->leftMargin()->isNotEmpty() == 'true', 'shift-' . $block->leftMargin()) ?><?php e($block->isBig() == 'true', 'big') ?>">
<?= $block->text(); ?>
</div>

View file

@ -0,0 +1,26 @@
<?php snippet('header') ?>
<section>
<h1><?= $page->title() ?></h1>
</section>
<?php foreach($page->children() as $sectionPage): ?>
<section>
<?php if ($sectionPage->isIndexed() != 'false'): ?>
<h2 class="h3"><?= $sectionPage->title() ?></h2>
<?php endif ?>
<?php foreach ($sectionPage->section()->toLayouts() as $layout): ?>
<div class="grid" id="<?= $layout->id() ?>">
<?php foreach ($layout->columns() as $column): ?>
<div class="grid__item" style="--span:<?= $column->span() ?>">
<div class="blocks">
<?= $column->blocks() ?>
</div>
</div>
<?php endforeach ?>
</div>
<?php endforeach ?>
</section>
<?php endforeach ?>
<?php snippet('footer') ?>