Initial public commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'defaults' => [
|
||||
'wrapper' => true,
|
||||
'languages' => [],
|
||||
'items' => []
|
||||
],
|
||||
'preview' => function() {
|
||||
$site = site();
|
||||
|
||||
return [
|
||||
'languages' => $site->languages(),
|
||||
'items' => $site->pages()->visible()
|
||||
];
|
||||
}
|
||||
];
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php if($wrapper): ?><section class="nav"><?php endif ?>
|
||||
<nav class="nav__section nav__section--languages" aria-label="<?= l::get('nav.lang.label', 'Language select') ?>">
|
||||
<ul>
|
||||
<?php foreach($languages as $language): ?>
|
||||
<li class="nav__item nav__item--compact<?php e($language === $site->language(), ' nav__item--active') ?>"><a href="<?= $page->url($language->code()) ?>" class="nav__link"><?= $language->name() ?></a></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav class="nav__section nav__section--pages" aria-label="<?= l::get('nav.main.label', 'Primary') ?>">
|
||||
<ul>
|
||||
<?php foreach($items as $item): ?>
|
||||
<li class="nav__item<?php e($item->isOpen(), ' nav__item--active') ?>"><a href="<?= $item->url() ?>" class="nav__link"><?= $item->title() ?></a></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</nav>
|
||||
<?php if($wrapper): ?></section><?php endif ?>
|
||||
@@ -0,0 +1,54 @@
|
||||
.nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
margin-left: 4rem;
|
||||
}
|
||||
|
||||
.nav__section {
|
||||
text-align: right;
|
||||
|
||||
&--languages {
|
||||
line-height: 1;
|
||||
margin-bottom: 0.5rem;
|
||||
|
||||
@media (max-width: 40em) {
|
||||
margin-bottom: 0.8rem;
|
||||
}
|
||||
}
|
||||
|
||||
&--pages {
|
||||
line-height: 1.4;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.nav__item {
|
||||
display: inline-block;
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-left: 0.5em;
|
||||
}
|
||||
|
||||
&--compact:not(:first-child) {
|
||||
margin-left: 0.25em;
|
||||
}
|
||||
|
||||
&--active .nav__link {
|
||||
color: $color--brand-secondary;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 40em) {
|
||||
.nav {
|
||||
margin: 0;
|
||||
margin-top: 1.5rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav__section {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user