Skip to content

Commit 9dcf260

Browse files
authored
Merge branch 'main' into add-provideasync
2 parents b03be65 + 5a4cf07 commit 9dcf260

2 files changed

Lines changed: 95 additions & 19 deletions

File tree

docs/_layouts/guide.html

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,43 @@
22
layout: default
33
---
44

5+
{% assign sidebarItems = site.guide | sort: 'chapter' %}
6+
7+
{% for item in sidebarItems %}
8+
{% if item.title == page.title %}
9+
{% unless forloop.first %}
10+
{% assign prevIndex = forloop.index| minus: 2 %}
11+
{% assign prev = sidebarItems[prevIndex] %}
12+
{% endunless %}
13+
{% unless forloop.last %}
14+
{% assign nextIndex = forloop.index %}
15+
{% assign next = sidebarItems[nextIndex] %}
16+
{% endunless %}
17+
{% endif %}
18+
{% endfor %}
19+
520
<div class="d-md-flex flex-1">
6-
{% assign sidebarItems = site.guide | sort: 'chapter' %}
721
{% include sidebar.html %}
822

923
<section class="col-lg-9 px-5 f4">
1024
<div class="container-md markdown-body mb-5">
1125
<h1 class="mb-4 f0-light">{{ page.title }}</h1>
1226
{{ content }}
27+
<div class="mt-4">
28+
<nav class="prev-next-links" aria-label="Pagination">
29+
{% if prev %}
30+
<a class="prev-next-links__button" rel="previous" href="{{ site.baseurl }}{{prev.url}}" aria-label="Previous Page">
31+
<div class="f6 text-uppercase">Previous</div>
32+
{{prev.title}}
33+
</a>
34+
{% endif %} {% if next %}
35+
<a class="prev-next-links__button" rel="next" href="{{ site.baseurl }}{{next.url}}" aria-label="Next Page">
36+
<div class="f6 text-uppercase">Next</div>
37+
{{next.title}}
38+
</a>
39+
{% endif %}
40+
</nav>
41+
</div>
1342
</div>
1443
</section>
15-
1644
</div>

docs/custom.css

Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1-
pre { font-size: 100% !important }
2-
code { font-size: 90% !important }
1+
pre {
2+
font-size: 100% !important;
3+
}
4+
code {
5+
font-size: 90% !important;
6+
}
37

4-
h1, h2, h3, h4, h5 { margin: 1rem 0; width: 100%; }
5-
ul li { margin-left: 1rem }
8+
h1,
9+
h2,
10+
h3,
11+
h4,
12+
h5 {
13+
margin: 1rem 0;
14+
width: 100%;
15+
}
16+
ul li {
17+
margin-left: 1rem;
18+
}
619

7-
.top-100px { top: 100px }
20+
.top-100px {
21+
top: 100px;
22+
}
823

924
/* No preference or prefers light */
10-
:root:not([data-prefers-color-scheme=dark]),
11-
html[data-prefers-color-scheme=light] {
25+
:root:not([data-prefers-color-scheme='dark']),
26+
html[data-prefers-color-scheme='light'] {
1227
--color-bg-canvas: rgb(255, 255, 255);
1328
--color-bg-canvas-shadow: rgba(255, 255, 255, 0);
1429
--color-bg-canvas-tertiary: #f6f8fa;
@@ -17,7 +32,7 @@ html[data-prefers-color-scheme=light] {
1732
--color-accent-fg: #0969da;
1833
}
1934
/* Prefers dark */
20-
html[data-prefers-color-scheme=dark] {
35+
html[data-prefers-color-scheme='dark'] {
2136
--color-bg-canvas: rgb(13, 17, 23);
2237
--color-bg-canvas-shadow: rgba(13, 17, 23, 0);
2338
--color-bg-canvas-tertiary: #161b22;
@@ -26,7 +41,7 @@ html[data-prefers-color-scheme=dark] {
2641
--color-accent-fg: #58a6ff;
2742
}
2843
@media (prefers-color-scheme: dark) {
29-
:root:not([data-prefers-color-scheme=light]) {
44+
:root:not([data-prefers-color-scheme='light']) {
3045
--color-bg-canvas: rgb(13, 17, 23);
3146
--color-bg-canvas-shadow: rgba(13, 17, 23, 0);
3247
--color-bg-canvas-tertiary: #161b22;
@@ -42,30 +57,63 @@ body {
4257
}
4358

4459
a {
45-
color: var(--color-accent-fg)
60+
color: var(--color-accent-fg);
4661
}
4762

4863
/* Sidebar */
4964
/* NB: `!important` is already used; so it’s required here */
50-
.bg-gray { background-color: var(--color-bg-canvas-tertiary) !important }
65+
.bg-gray {
66+
background-color: var(--color-bg-canvas-tertiary) !important;
67+
}
5168

5269
/* Code Blocks & Syntax */
53-
.markdown-body .highlight pre, .markdown-body pre {
70+
.markdown-body .highlight pre,
71+
.markdown-body pre {
5472
background-color: var(--color-bg-canvas-tertiary);
5573
overflow: auto;
5674
}
5775

5876
/* Inline Code */
59-
.markdown-body code, .markdown-body tt { background-color: var(--color-markdown-code-bg) }
77+
.markdown-body code,
78+
.markdown-body tt {
79+
background-color: var(--color-markdown-code-bg);
80+
}
6081

6182
/* Tables */
62-
.markdown-body table tr:nth-of-type(odd) th, .markdown-body table tr:nth-of-type(odd) td { background-color: var(--color-bg-canvas) }
63-
.markdown-body table tr:nth-of-type(even) th, .markdown-body table tr:nth-of-type(even) td { background-color: var(--color-bg-canvas-tertiary) }
83+
.markdown-body table tr:nth-of-type(odd) th,
84+
.markdown-body table tr:nth-of-type(odd) td {
85+
background-color: var(--color-bg-canvas);
86+
}
87+
.markdown-body table tr:nth-of-type(even) th,
88+
.markdown-body table tr:nth-of-type(even) td {
89+
background-color: var(--color-bg-canvas-tertiary);
90+
}
6491

6592
/* Override Primer .tooltipped default aria-label */
66-
.code-tooltip:after { content: attr(data-title); text-align: left; font-size: 100%; }
93+
.code-tooltip:after {
94+
content: attr(data-title);
95+
text-align: left;
96+
font-size: 100%;
97+
}
6798
/* :after text will be announced by AT, this adds a separation between textContent and :after text */
68-
.code-tooltip:before { content: ': '; font-size: 0; }
99+
.code-tooltip:before {
100+
content: ': ';
101+
font-size: 0;
102+
}
69103
.code-tooltip {
70104
scroll-margin-top: 150px;
71105
}
106+
107+
108+
/* Prev and next links */
109+
.prev-next-links {
110+
display: flex;
111+
gap: 16px;
112+
}
113+
114+
.prev-next-links__button {
115+
border: solid 1px;
116+
padding: 16px;
117+
border-radius: 4px;
118+
flex: 1;
119+
}

0 commit comments

Comments
 (0)