Skip to content

Commit

Permalink
adding dark mode option
Browse files Browse the repository at this point in the history
  • Loading branch information
holger1411 committed Apr 20, 2023
1 parent d9397ad commit 1e099c2
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 10 deletions.
3 changes: 3 additions & 0 deletions src/_data/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"colorMode": "light"
}
2 changes: 1 addition & 1 deletion src/_includes/layouts/blank.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html class="h-100" lang="{{ metadata.language }}">
<html class="h-100" lang="{{ metadata.language }}" data-bs-theme="{{ global.colorMode }}">

<head>
{% include 'snippets/head.njk' %}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/blog.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html class="h-100" lang="{{ metadata.language }}">
<html class="h-100" lang="{{ metadata.language }}" data-bs-theme="{{ global.colorMode }}">

<head>
{% include 'snippets/head.njk' %}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/code.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html class="h-100" lang="{{ metadata.language }}">
<html class="h-100" lang="{{ metadata.language }}" data-bs-theme="{{ global.colorMode }}">

<head>
{% include 'snippets/head.njk' %}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/default.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html class="h-100" lang="{{ metadata.language }}">
<html class="h-100" lang="{{ metadata.language }}" data-bs-theme="{{ global.colorMode }}">

<head>
{% include 'snippets/head.njk' %}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/post.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html class="h-100" lang="{{ metadata.language }}">
<html class="h-100" lang="{{ metadata.language }}" data-bs-theme="{{ global.colorMode }}">

<head>
{% include 'snippets/head.njk' %}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/snippets/blogsidebar.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="bg-light p-4 rounded">
<div class="p-4">
<h3>Sidebar</h3>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/snippets/postloop.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="col-12">
{%- for post in posts %}
<div class="py-5 border-bottom">
<a href="{{ post.url | url }}" class="text-decoration-none text-dark"><h2 class="display-4">{{ post.data.title}}</h2></a>
<a href="{{ post.url | url }}"><h2 class="display-4">{{ post.data.title}}</h2></a>
<p>Published
<time datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate }}</time>
</p>
Expand Down
4 changes: 2 additions & 2 deletions src/_includes/snippets/tagslist.njk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% for tag in collections.tagList %}
{% set tagUrl %}/tags/{{ tag.tagName | slug }}/{% endset %}
<a href="{{ '/tags/' | url }}{{ tag.tagName | slug }}" class="btn btn-outline-dark btn-sm me-2">{{ tag.tagName }}
<span class="ms-1 badge bg-dark">
<a href="{{ '/tags/' | url }}{{ tag.tagName | slug }}" class="btn btn-outline-secondary btn-sm me-2">{{ tag.tagName }}
<span class="ms-1 badge bg-primary">
{{ tag.tagCount }}
</span>
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ layout: layouts/blank.njk
</div>
</div>

<div class="wrapper position-relative my-vh-5 bg-light">
<div class="wrapper position-relative my-vh-5 bg-light text-dark">
<div class="bg-white w-50 h-100 position-absolute d-none d-lg-block"></div>
<div class="container position-relative py-vh-4">
<div class="row justify-content-between d-flex align-items-stretch py-vh-2">
Expand Down

1 comment on commit 1e099c2

@vercel
Copy link

@vercel vercel bot commented on 1e099c2 Apr 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

11straps – ./

11straps.vercel.app
11straps-office12.vercel.app
11straps-git-main-office12.vercel.app

Please sign in to comment.