Skip to content

Commit 6a54f2c

Browse files
committed
Merge #171: feat: dark mode theme
e4f6251 feat: dark mode theme (Byron Hambly) Pull request description: Looking at the RPC docs on a light background was wrecking my eyes 😅 This PR: - adds dark color theme for users with `prefers-color-scheme: dark` - increases max width to 1200px - replaces logo png with svg - black on light, white on dark theme. Smaller filesize too. - removes `!important` qualifiers that make editing styles more difficult - stores colors in scss variables for ease of maintenance Deployed example at https://elements.delta1.dev ![dark theme RPC doc](https://user-images.githubusercontent.com/351403/214849774-dc25eb02-618c-4baa-9786-e03fb49ecb38.png) ACKs for top commit: delta1: ACK e4f6251; tested locally Tree-SHA512: 8f1c93d208a398fd4c4c0569e6f2e27937024cb3ae68cc11413bc25dbfd2f09876c8b32b15cde4b0133535090fabee344464154ef485ccf839f3f8aa8a546542
2 parents b7ce3f1 + e4f6251 commit 6a54f2c

5 files changed

Lines changed: 371 additions & 129 deletions

File tree

_includes/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<data class="u-url" href="{{ "/" | relative_url }}"></data>
33

44
<div class="wrapper">
5-
<img class="logo-footer" alt="" src="{{ site.url }}/images/elements_logo_no_border.png" />
5+
<img class="logo-footer" alt="" src="{{ site.url }}/images/elements_logo_no_border.svg" />
66
<div class="footer-col-wrapper">
77
<div class="footer-col footer-col-1">
88
<ul class="contact-list">

_includes/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<meta name="viewport" content="width=device-width, initial-scale=1">
55
{%- seo -%}
66
<link href='{{ "/assets/open-sans.css" | relative_url }}' rel='stylesheet' type='text/css'>
7-
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
87
<link rel="stylesheet" href="{{ "/assets/bootstrap-v3.3.7.min.css" | relative_url }}">
98
<script src="{{ "/assets/jquery-v3.3.1.min.js" | relative_url }}"></script>
109
<script src="{{ "/assets/bootstrap-v3.3.7.min.js" | reltive_url }}"></script>
10+
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
1111
{%- feed_meta -%}
1212
</head>

_includes/header.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<header class="site-header" role="banner">
22

33
<div class="wrapper">
4-
<img class="logo-float-left" alt="" src="{{ site.url }}/images/elements_logo_no_border.png" />
4+
<img class="logo-float-left" alt="" src="{{ site.url }}/images/elements_logo_no_border.svg" />
55
{%- assign default_paths = site.pages | map: "path" -%}
66
{%- assign page_paths = site.header_pages | default: default_paths -%}
77
<span><a class="site-title" rel="author" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a></span>
@@ -23,7 +23,7 @@
2323
<!-- Nav links for toggling -->
2424
<div class="collapse navbar-collapse" id="collapsing-nav-bar">
2525
<ul class="nav navbar-nav navbar-right">
26-
<li><a href="/how-it-works">How it works</a></li>
26+
<li><a href="/how-it-works">How it works</a></li>
2727
<li><a href="/features">Features</a></li>
2828
<li><a href="/community">Community</a></li>
2929
<li><a href="/en/doc">RPC Docs</a></li>
@@ -59,7 +59,7 @@
5959
<li role="separator" class="divider"></li>
6060
<li><a href="https://github.com/ElementsProject/elements">Elements on Github</a></li>
6161
</ul>
62-
</li>
62+
</li>
6363
</ul>
6464

6565
</div><!-- /.navbar-collapse -->
@@ -68,7 +68,7 @@
6868

6969
<script>
7070
$(document).ready(function() {
71-
// Assign the 'active' class for currently viewed page
71+
// Assign the 'active' class for currently viewed page
7272

7373
var pathname = window.location.pathname;
7474
// Remove trailng '/'
@@ -83,12 +83,12 @@
8383
mainpathname = pathname.substr(0, secondForwardSlashIndex);
8484
$('.nav > li > a[href="'+mainpathname+'"]').parent().addClass('active');
8585
}
86-
86+
8787
// Top level nav bar item
8888
$('.nav > li > a[href="'+pathname+'"]').parent().addClass('active');
8989

9090
// Nav bar drop down item - must be linked to with the "/" prefix (e.g. /elements-code-tutorial/) in the menu html above
91-
$('.nav > li > ul> li > a[href="'+pathname+'"]').parent().parent().parent().addClass('active');
91+
$('.nav > li > ul> li > a[href="'+pathname+'"]').parent().parent().parent().addClass('active');
9292

9393
// Nav bar drop down sub item
9494
$('.nav > li > ul> li > a[href="'+pathname+'"]').parent().addClass('active');

0 commit comments

Comments
 (0)