Skip to content

Commit 4e90e5f

Browse files
joshkalnicola
authored andcommitted
Add dark mode to website
- Use https://github.com/bufferhead-code/nightowl to provide hooks for prefers-color-scheme (OS level choice) and a manual button to toggle dark mode - Replace github logo with icon from font-awesome so that dark mode just works
1 parent fdab60d commit 4e90e5f

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

_layouts/default.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<link rel="stylesheet" href="{{ "/css/rouge-github.css" | prepend: site.baseurl }}">
1616
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
1717
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
18+
<!-- dark mode -->
19+
<script type="module" src="https://cdn.jsdelivr.net/npm/@bufferhead/[email protected]/dist/nightowl.js"></script>
1820

1921
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
2022
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}"

assets/github.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
---
44

55
<section class="greeting">
6-
<h1>
6+
<h1 class="nightowl-daylight">
77
<img id="logo" src="/assets/rust-analyzer.svg" alt="rust analyzer">
88
</h1>
99

@@ -13,7 +13,7 @@ <h1>
1313
</p>
1414

1515
<a class="source" href="https://github.com/rust-analyzer/rust-analyzer">
16-
<img src="/assets/github.svg" alt="GitHub"> Source
16+
<i class="fa fa-github" aria-hidden="true"></i> Source
1717
</a>
1818
</section>
1919

0 commit comments

Comments
 (0)