forked from necolas/react-native-web
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathnav.html
More file actions
60 lines (54 loc) · 2.17 KB
/
nav.html
File metadata and controls
60 lines (54 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{% set navPages = collections.nav | eleventyNavigation %}
<nav id="navigation-scroller" class="view overflow-x-hidden overflow-y-auto h-full p-6 pt-12">
<h1 class="m-0 mb-4" style="font-size:1rem;">
<a class="view no-underline group font-semibold" href="{{ '/' | url }}" style="color:var(--docs-theme-color)">
<span class="view flex-row items-center overflow-hidden mb-1 text-xl">
{{ site.name }}
</span>
<span>{{ site.packageName }}@{{ site.packageVersion }}</span>
</a>
</h1>
{% macro renderNavListItem(entry) -%}
{% set itemClassName %}
{% if entry.url == page.url %}
font-semibold text-color-inherit
{% else %}
text-color-faint hover:text-color-inherit
{% endif %}
{% endset %}
{% set itemStyle %}
{% if entry.url == page.url %}
background-color:var(--docs-theme-color-faded); border-left:3px solid var(--docs-theme-color); margin-left:-13px; border-radius:0 0.25rem 0.25rem 0;
{% endif %}
{% endset %}
<li class="view item mb-2">
{%- if entry.url != false -%}
<a class="text block {{ itemClassName }}" href="{{ entry.url | url }}" style="padding:2px 10px; margin:-2px -10px;{{itemStyle}}">
{{ entry.title }}
{% if entry.label != null %}
{% set labelColor -%}
{%- if entry.label == 'Change' -%}
#ff8300
{%- else -%}
#86b300
{%- endif -%}
{%- endset %}
<span class="px-1 ml-2 inline-block border rounded text-uppercase text-sm" style="border-color:{{labelColor}}; color:{{labelColor}}; font-weight:normal">{{ entry.label }}</span>
{% endif %}
</a>
{% else %}
<span class="text block font-semibold text-uppercase text-sm">{{ entry.title }}</span>
{% endif %}
{%- if entry.children.length -%}
<ul class="view list-none mt-2 mb-4">
{%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%}
</ul>
{%- endif -%}
</li>
{%- endmacro %}
<ul class="view list-none mt-6">
{%- for entry in navPages %}
{{ renderNavListItem(entry) }}
{%- endfor -%}
</ul>
</nav>