Skip to content

Commit

Permalink
Add Dark Mode (#1490)
Browse files Browse the repository at this point in the history
* Issue ##1382
- init commit
- add darkmode.css file and include

* Issue ##1382
- add darkmode icon
- add darkmmode JS file after body

* Issue ##1382: work on JS and CSS

* Issue ##1382
- futher changes to dark mode CSS for index
- futher changes to dark mode JS for index

* Issue ##1382
- add hover state styles
- complete most of index page

* Issue ##1382
- Get page layout script tag path to work
- clean out CSS to nest under body.dark-mode

* Issue ##1382
- add styles for hello-world, routing, generator
- hello-world not possible to style iframe

* Issue #1382
- complete all CSS for all Getting Started pages

* Issue #1382
- add all script tags
- finish JS file
- finish all CSS for pages

* issue #1382
- fix whitespace

* issue #1382
- add css to search bar drop down
- rearrange css file and add comments

* issue #1382
- add check for local storage

* issue #1382 -add css to add header html

* issue #1382
- add hover color on search bar results
- fix search bar width on FR, DE, RU, UZ
pages caused by adding moon icon to navbar

* issue #1382
- remove error line css
- add system style check
- remove local storage use until toggled

* issue #1382
- clean up comments in theme js
- wrap system theme check in function

* Issue #1490
- remove bands on dropdowns
- slight fix to first "installing" drop down

* Issue #1490
- rejig JS - add listener to mediaQuery
- make latest change be the override

* Issue #1490
 - fix forgotten merge conflict line in header uz & ru
  • Loading branch information
chrisdel101 committed May 2, 2024
1 parent f2889fe commit a09123f
Show file tree
Hide file tree
Showing 26 changed files with 368 additions and 3 deletions.
1 change: 1 addition & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +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/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
3 changes: 3 additions & 0 deletions _includes/header/header-de.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-en.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,8 @@
</li>
-->
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-es.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-fr.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-it.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-ja.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-ko.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-pt-br.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-ru.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-sk.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-th.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,8 @@
</li>
-->
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-tr.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,8 @@
</li>
-->
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-uk.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-uz.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-zh-cn.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions _includes/header/header-zh-tw.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,8 @@
</ul>
</li>
</ul>
<div id="theme-icon-container" class="theme-toggle default-theme" title="toggle darkmode">
<i class="fa fa-moon-o fa-2x"></i>
</div>
</div>
</header>
2 changes: 2 additions & 0 deletions _layouts/3x-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
</section>

{% include footer/footer-{{ page.lang }}.html %}
<script src="/js/theme.js"></script>


</body>

Expand Down
1 change: 1 addition & 0 deletions _layouts/4x-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
</section>

{% include footer/footer-{{ page.lang }}.html %}
<script src="/js/theme.js"></script>

</body>

Expand Down
1 change: 1 addition & 0 deletions _layouts/5x-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
</section>

{% include footer/footer-{{ page.lang }}.html %}
<script src="/js/theme.js"></script>

</body>

Expand Down
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 src="../js/theme.js"></script>
</body>

</html>
2 changes: 2 additions & 0 deletions _layouts/middleware.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
{% else %}
<h3>ERROR: No source specified for README {{page.module}}</h3>
{% endif %}
<script src="/js/theme.js"></script>

</div>
</div>
1 change: 1 addition & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
</section>

{% include footer/footer-{{ page.lang }}.html %}
<script src="/js/theme.js"></script>

</body>

Expand Down
2 changes: 0 additions & 2 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,7 @@ footer {
.menu ul.dropit-submenu {
background-color: #fcfcfa;
border: 1px solid #b2b2b2;
padding: 6px 0;
margin: 0 0 0 1px;
border-radius: 3px;
box-shadow: 0px 1px 3px rgba(0,0,0,0.15);
}

Expand Down

0 comments on commit a09123f

Please sign in to comment.