Skip to content

Commit

Permalink
Style the site navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesdring committed Jun 21, 2024
1 parent 626e320 commit 0895dfa
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
9 changes: 8 additions & 1 deletion src/_components/page/Nav.vto
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ css: |
<nav class="page">
<ul>
{{ for key, link of links }}
<li><a href="{{ link.url }}">{{ link.title }}</a></li>
<li>
<a
href="{{ link.url }}"
class="{{ current.startsWith(link.url) ? 'current' : null }}"
>
{{ link.title }}
</a>
</li>
{{ /for }}
</ul>
</nav>
20 changes: 20 additions & 0 deletions src/_includes/css/base.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
@import "./fonts/poppins.css";

/* Site-wide overrides of variables. Customises the components. */
:root {
--header-color: white;
--header-background: #2254F4;

--nav-page-color: white;
--nav-page-background: black;
--nav-page-color-hover: black;
--nav-page-background-hover: white;

--link-block-color: black;
--link-block-background: #aaa;
--link-block-color-hover: white;
--link-block-background-hover: black;
}

html {
font-family: Arial, Helvetica, sans-serif;
height: 100%;
Expand Down Expand Up @@ -43,6 +59,10 @@ body {
text-decoration: underline;
}
}
& .current {
--nav-page-color: black;
--nav-page-background: white;
}
}
& > footer {
color: white;
Expand Down
3 changes: 2 additions & 1 deletion src/_includes/layout/page.vto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

{{# Site navigation #}}
{{ comp.page.Nav({
links: search.pages('technique', 'order') // Find all search technique pages
links: search.pages('technique', 'order'), // Find all search technique pages
current: url
}) }}

<main>
Expand Down
15 changes: 0 additions & 15 deletions src/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,3 @@
@import 'css/base.css';
@import 'css/table.css';
@import 'css/transitions.css';

:root {
--header-color: white;
--header-background: #2254F4;

--nav-page-color: white;
--nav-page-background: black;
--nav-page-color-hover: black;
--nav-page-background-hover: white;

--link-block-color: black;
--link-block-background: #aaa;
--link-block-color-hover: white;
--link-block-background-hover: black;
}

0 comments on commit 0895dfa

Please sign in to comment.