Skip to content

Commit 26ad8dd

Browse files
alexiscolinthehowl
andauthored
style: improve docs links, toc and icons (#1516)
Last polish docs website design by: - Limiting ToC height and allowing scroll inside (cf #1513) - Replacing external icon - Adding the full logo - Improving the caret icon - Fixing Toc hover color on dark mode --------- Co-authored-by: Morgan <git@howl.moe>
1 parent 4bf9059 commit 26ad8dd

File tree

6 files changed

+54
-27
lines changed

6 files changed

+54
-27
lines changed

misc/docusaurus/docusaurus.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ const config = {
4545
({
4646
navbar: {
4747
hideOnScroll: true,
48-
title: "Gno.land",
4948
logo: {
5049
alt: "Gno.land Logo",
51-
src: "img/logo.svg",
52-
srcDark: "img/logo_light.svg",
50+
src: "img/gnoland.svg",
51+
srcDark: "img/gnoland_light.svg",
5352
},
5453
items: [
5554
{

misc/docusaurus/src/css/custom.css

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@
3636
--ifm-color-secondary: var(--ifm-color-primary-light);
3737
--ifm-color-white: var(--ifm-color-primary);
3838

39+
--ifm-menu-link-sublist-icon: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjk2OTY3IDE1LjUzMDNDMy42NzY3OCAxNS4yMzc0IDMuNjc2NzggMTQuNzYyNiAzLjk2OTY3IDE0LjQ2OTdMMTEuNDY5NyA2Ljk2OTY3QzExLjc2MjYgNi42NzY3OCAxMi4yMzc0IDYuNjc2NzggMTIuNTMwMyA2Ljk2OTY3TDIwLjAzMDMgMTQuNDY5N0MyMC4zMjMyIDE0Ljc2MjYgMjAuMzIzMiAxNS4yMzc0IDIwLjAzMDMgMTUuNTMwM0MxOS43Mzc0IDE1LjgyMzIgMTkuMjYyNiAxNS44MjMyIDE4Ljk2OTcgMTUuNTMwM0wxMiA4LjU2MDY2TDUuMDMwMzMgMTUuNTMwM0M0LjczNzQ0IDE1LjgyMzIgNC4yNjI1NiAxNS44MjMyIDMuOTY5NjcgMTUuNTMwM1oiIGZpbGw9IiMxQzFDMUMiLz4KPC9zdmc+Cg==");
3940
--content-max-w: 50rem;
4041
}
4142

4243
/* For readability concerns, you should choose a lighter palette in dark mode. */
4344
[data-theme="dark"]:root {
4445
--ifm-color-primary: white;
46+
--ifm-color-content-secondary: #a8a8a8;
4547
--ifm-color-primary-dark: #282828;
4648
--ifm-color-primary-darker: #1c1c1c;
4749
--ifm-color-primary-light: #a8a8a8;
@@ -224,6 +226,10 @@ pre code {
224226
color: var(--ifm-color-primary);
225227
}
226228

229+
.menu__link--sublist-caret:after {
230+
background: var(--ifm-menu-link-sublist-icon) 50% / 1.28rem 1.28rem;
231+
}
232+
227233
/* Breadcrumb */
228234
.breadcrumbs__item--active .breadcrumbs__link {
229235
background-color: var(--ifm-navbar-background-color);
@@ -235,10 +241,38 @@ pre code {
235241
overflow-y: inherit !important;
236242
}
237243
.table-of-contents {
244+
position: relative;
238245
background-color: var(--ifm-toc-background-color);
239246
border-radius: 1rem;
240247
border: none !important;
241248
box-shadow: var(--ring-offset-shadow, 0 0 #0000), var(--ring-shadow, 0 0 #0000), var(--shadow);
249+
max-height: calc(100vh - 10rem);
250+
overflow: scroll;
251+
-ms-overflow-style: none; /* IE and Edge */
252+
scrollbar-width: none; /* Firefox */
253+
}
254+
.table-of-contents::-webkit-scrollbar {
255+
display: none;
256+
}
257+
258+
.theme-doc-toc-desktop::after {
259+
content: "";
260+
position: absolute;
261+
bottom: 0;
262+
left: 0;
263+
width: 100%;
264+
height: 2.5ch;
265+
border-radius: 1rem;
266+
background: linear-gradient(0deg, var(--ifm-toc-background-color) 0%, transparent);
267+
pointer-events: none;
268+
}
269+
270+
.table-of-contents__link:hover,
271+
.table-of-contents__link:hover code,
272+
.table-of-contents__link--active,
273+
.table-of-contents__link--active code {
274+
color: var(--ifm-color-primary);
275+
text-decoration: none;
242276
}
243277

244278
/* Footer */
@@ -249,6 +283,18 @@ pre code {
249283
padding-inline: 0.5rem;
250284
}
251285

286+
a.footer__link-item:after {
287+
content: "↗";
288+
font-size: 0.9em;
289+
display: inline-block;
290+
vertical-align: top;
291+
padding-inline-start: 0.2em;
292+
padding-block-start: 0.2;
293+
}
294+
a.footer__link-item > svg {
295+
display: none;
296+
}
297+
252298
.footer .container {
253299
max-width: 100%;
254300
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

misc/docusaurus/static/img/logo.svg

Lines changed: 0 additions & 12 deletions
This file was deleted.

misc/docusaurus/static/img/logo_light.svg

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)