Update nav styling
This commit is contained in:
parent
c45b1e2e64
commit
7d1591d400
|
@ -17,9 +17,12 @@ td {
|
||||||
.dib;
|
.dib;
|
||||||
.f6;
|
.f6;
|
||||||
.link;
|
.link;
|
||||||
.ml2;
|
.pv3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-item--active {
|
.nav-item--active {
|
||||||
|
.b--blue;
|
||||||
|
.bb;
|
||||||
.black;
|
.black;
|
||||||
|
.bw1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,12 @@
|
||||||
|
|
||||||
<nav class="db dtc-ns v-mid w-100 tl tr-ns mt2 mt0-ns">
|
<nav class="db dtc-ns v-mid w-100 tl tr-ns mt2 mt0-ns">
|
||||||
{% for link in links %}
|
{% for link in links %}
|
||||||
{% set pattern = '#^' ~ (link.pattern ?: link.href) ~ '/?#' %}
|
{% set classes = [
|
||||||
<a href="{{ link.href }}" class="nav-item {{ page.url matches pattern ? 'nav-item--active' }}">
|
'nav-item',
|
||||||
{# <a href="{{ link.href }}" class="f6 hover-blue link dib pa3 {{ page.url matches pattern ? 'black bb b--blue bw1' : 'black-50' }}"> #}
|
not loop.first ? 'ml3',
|
||||||
|
page.url matches '#^' ~ (link.pattern ?: link.href) ~ '/?#' ? 'nav-item--active',
|
||||||
|
] %}
|
||||||
|
<a href="{{ link.href }}" class="{{ classes|join(' ') }}">
|
||||||
{{- link.title -}}
|
{{- link.title -}}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in a new issue