Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- add darkmode icon
- add darkmmode JS file after body
  • Loading branch information
chrisdel101 committed Apr 16, 2024
1 parent d643ddc commit 74a2d6f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 14 deletions.
2 changes: 1 addition & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="og:image" content="https://expressjs.com/images/express-facebook-share.png">
<link rel="icon" type="image/png" href="/images/favicon.png" />
<link rel="stylesheet" href="/css/style.css?_={{ site.time | date: '%s' }}">
<link rel="stylesheet" href="/css/darkmode.css?_={{ site.time | date: '%s' }}">
<link rel="stylesheet" href="/css/theme.css?_={{ site.time | date: '%s' }}">
<link rel="stylesheet" href="/css/dropit.css">
<link rel="stylesheet" href="/css/prism.css">
<link rel="stylesheet" href="/css/font-awesome.min.css">
Expand Down
5 changes: 4 additions & 1 deletion _includes/header/header-en.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>
<section id="logo"><a href="/" class="express">Express</a>
</section>
<div id="navbar">
<div id="navbar">
<input id="q" placeholder="🔎 search">
<ul id="navmenu">
<li><a href="/" id="home-menu"{% if page.menu == 'home' %} class="active"{% endif %}>Home</a></li>
Expand Down Expand Up @@ -174,5 +174,8 @@
</li>
-->
</ul>
<div id="theme-icon-container" class="theme-toggle" title="switch to dark mode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
2 changes: 1 addition & 1 deletion _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{ content }}

{% include footer/footer-{{ page.lang }}.html %}

<script data-cfasync="false" src="../js/theme.js"></script>
</body>

</html>
11 changes: 0 additions & 11 deletions css/darkmode.css

This file was deleted.

26 changes: 26 additions & 0 deletions css/theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
:root {
--main_dark_bg: #010409;
--second_dark_bg: #0d1117;
--dark_text: #e6edf3;
}
#theme-icon-container {
float : right;
background-color: var(--second_dark_bg);
color:white;
min-width: 50px;
}
.dark-mode-body {
background: var(--main_dark_bg);
--dark_text: whitesmoke;
background: var(--main_dark_bg);
color: var(--dark_text);
}
#blm-banner.dark-mode {
background-color: var(--main_dark_bg);
/* color: var(--dark_text); */
}
header {
background-color: var(--second_dark_bg);
color: var(--dark_text);

}
4 changes: 4 additions & 0 deletions js/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

// theme toggle
const darkModeToggle = document.querySelector('.theme-toggle');
console.log(darkModeToggle);

0 comments on commit 74a2d6f

Please sign in to comment.