Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dark theme support with @media queries #121

Open
wants to merge 108 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
3eccfd9
add a file for colours
godalming123 Aug 18, 2021
b62ebbc
make colors acurate to theme
godalming123 Aug 18, 2021
efa26df
update
godalming123 Aug 18, 2021
33cb3c5
update
godalming123 Aug 18, 2021
867c2ea
improve formatting
godalming123 Aug 18, 2021
e469ee7
add a separate luminosity and color for code text
godalming123 Aug 18, 2021
0632aaa
update colours to use my colours which are based on system theme
godalming123 Aug 18, 2021
15ed1ec
make dark the deafualt theme
godalming123 Aug 18, 2021
c447e05
use :root instead of body for variables
godalming123 Aug 19, 2021
422ba53
fix bug
godalming123 Aug 19, 2021
5e1d834
fix bug
godalming123 Aug 19, 2021
4532be5
fix bug
godalming123 Aug 19, 2021
d4918ba
fix bug
godalming123 Aug 19, 2021
9a5c455
use :root instead of body for variables
godalming123 Aug 19, 2021
05f1dee
fix bug
godalming123 Aug 19, 2021
24abc38
add separate color fo bold text
godalming123 Aug 19, 2021
2751878
add separate color for bold text
godalming123 Aug 19, 2021
30113f5
use h1 color for bold text
godalming123 Aug 19, 2021
617d8fe
use h1 color for bold as well
godalming123 Aug 19, 2021
863a69e
fix bold text
godalming123 Aug 19, 2021
270d920
mention support for dark or light theme in example
godalming123 Aug 19, 2021
c4b52a6
reformat + fix theme not changing glitch
godalming123 Aug 19, 2021
adebd90
fix bug
godalming123 Aug 19, 2021
ac573d2
add theme change transition
godalming123 Aug 19, 2021
fa9b1c0
add color for table headers
godalming123 Aug 19, 2021
9fbe6c3
use color for table header
godalming123 Aug 19, 2021
c34d31a
use color for hovered a's
godalming123 Aug 19, 2021
8538622
add a color for hovered a's
godalming123 Aug 19, 2021
8c2157a
highlight the fact that theme supports dark mode
godalming123 Aug 19, 2021
d74e21b
mention dark mode support in readme
godalming123 Aug 19, 2021
ff71602
add more colors for code
godalming123 Aug 19, 2021
0cdf753
use more coding colors
godalming123 Aug 19, 2021
fdbf80c
add color for buttons im main section
godalming123 Aug 19, 2021
89d00f3
style more colors for code blocks
godalming123 Aug 19, 2021
7ea0d5a
style more colors with code colors
godalming123 Aug 19, 2021
f86a2de
fix bug
godalming123 Aug 19, 2021
f883d36
fix colors
godalming123 Aug 19, 2021
fce833f
fix color bug where code blocks weren't rounded
godalming123 Aug 19, 2021
76a95d9
fix bug
godalming123 Aug 19, 2021
31403aa
fix bug
godalming123 Aug 19, 2021
c3d11e1
fix bug
godalming123 Aug 19, 2021
e3a07be
fix more colors for code blocks
godalming123 Aug 19, 2021
20d476f
use separtate color for a tag
godalming123 Aug 19, 2021
0246867
add colors for main buttons
godalming123 Aug 19, 2021
c2b9bdb
add separate colors for buttons
godalming123 Aug 19, 2021
9e7e592
finish making buttons colors
godalming123 Aug 19, 2021
6935f9b
fix bugs
godalming123 Aug 19, 2021
9924095
fix bugs
godalming123 Aug 19, 2021
9546cab
add color for dark hovered main buttons
godalming123 Aug 19, 2021
f0cb11b
increase brightness of a tags especially in dark mode
godalming123 Aug 20, 2021
94ad1b3
add color for table item splitter
godalming123 Aug 20, 2021
99e0c03
use color for table splitter
godalming123 Aug 20, 2021
93efb84
add color for hr
godalming123 Aug 20, 2021
1bc811b
add demonstration of kbd element on index.md file so I can style it p…
godalming123 Aug 20, 2021
46cdf01
color for kbd elements
godalming123 Aug 20, 2021
b49610a
make border-bottom darker for kbd elements in dark mode
godalming123 Aug 20, 2021
cbd6dd2
fix bugs
godalming123 Aug 20, 2021
8f25ebf
add color for small element inside a element
godalming123 Aug 20, 2021
a078b5f
fix bugs
godalming123 Aug 20, 2021
ed7a407
add support for dt element
godalming123 Aug 20, 2021
da8fc71
add support for blockqoute
godalming123 Aug 20, 2021
d32a97b
add color for section element
godalming123 Aug 20, 2021
c19c70e
actually theme section
godalming123 Aug 20, 2021
ea5957a
make variable names clearer
godalming123 Aug 20, 2021
ffdf942
make colors clearer
godalming123 Aug 20, 2021
020222b
use @mixins for color styles and only apply dark color style if media…
godalming123 Aug 20, 2021
0f1c05e
fix bugs
godalming123 Aug 20, 2021
643ff01
try to fix bug
godalming123 Aug 20, 2021
e31eb23
add coding colors
godalming123 Aug 20, 2021
5e3cf22
add code colors + fix github glitch
godalming123 Aug 22, 2021
b19bf6c
init
godalming123 Aug 23, 2021
d379440
remove dark-colors file
godalming123 Aug 23, 2021
3e1647d
reindent
godalming123 Aug 23, 2021
3508efd
try to add themeing from config.yaml
godalming123 Aug 23, 2021
0ed3173
fix bug
godalming123 Aug 23, 2021
59ff590
fix bugs
godalming123 Aug 23, 2021
c4051fc
fix bugs so option deafualts to auto
godalming123 Aug 23, 2021
0f9f4be
fix bugs
godalming123 Aug 23, 2021
7aed3b8
fix bug
godalming123 Aug 23, 2021
ccc3840
fix bugs
godalming123 Aug 23, 2021
9270f7d
try and fix bugs
godalming123 Aug 23, 2021
fa2cba9
fix bugs
godalming123 Aug 23, 2021
a027b8e
test light theme
godalming123 Aug 23, 2021
5c851b9
fix ptint media on dark mode
godalming123 Aug 23, 2021
753edb6
change color-schem to auto
godalming123 Aug 23, 2021
3d7cddd
test
godalming123 Aug 23, 2021
a87ef58
try and fix theme not deafualting to auto
godalming123 Aug 23, 2021
1f450b7
fix bug
godalming123 Aug 23, 2021
c683ce4
add back the color scheme definition in config so it works
godalming123 Aug 23, 2021
a7c7d9a
add support for a color scheme that deafualts to dark if the device d…
godalming123 Aug 24, 2021
01e88d8
fix mistype
godalming123 Aug 24, 2021
6120daa
try and make color-scheme deafualt to auto
Aug 26, 2021
83b0df4
try and make it work with blank color-scheme in config.yaml
Aug 26, 2021
415d27f
see if new approach still works when color-scheme is defined
Aug 26, 2021
ed94f3a
try deferent approch
Aug 26, 2021
1509274
try more types
Aug 26, 2021
25358a3
Merge branch 'master' into support-for-changing-theme-in-_config.yaml
Aug 26, 2021
eeeb034
Merge pull request #1 from godalming123/support-for-changing-theme-in…
Aug 26, 2021
71bdcd4
remove unnesersary line
Aug 26, 2021
b0bdba4
use bdhu suggestions
Aug 29, 2021
b1e8e69
fix spelling and grammer
Nov 18, 2021
3c60bc0
update usage instructions
Dec 21, 2021
4c92f90
fix bugs
Dec 21, 2021
2a261a3
Update _config.yml
Dec 21, 2021
ef51851
fix spelling errer
Dec 21, 2021
9631428
move replace statement forward
Dec 21, 2021
1d17d3d
fix preview link
May 7, 2023
f357095
fix some awful style choices
May 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![.github/workflows/ci.yaml](https://github.com/pages-themes/minimal/actions/workflows/ci.yaml/badge.svg)](https://github.com/pages-themes/minimal/actions/workflows/ci.yaml) [![Gem Version](https://badge.fury.io/rb/jekyll-theme-minimal.svg)](https://badge.fury.io/rb/jekyll-theme-minimal)

*Minimal is a Jekyll theme for GitHub Pages. You can [preview the theme to see what it looks like](http://pages-themes.github.io/minimal), or even [use it today](#usage).*
*Minimal is a Jekyll theme for GitHub Pages that supports dark mode based on device color scheme. You can [preview the theme to see what it looks like](https://godalming123.github.io/minimal/), or even [use it today](#usage).*

![Thumbnail of Minimal](thumbnail.png)

Expand All @@ -13,7 +13,7 @@ To use the Minimal theme:
1. Add the following to your site's `_config.yml`:

```yml
remote_theme: pages-themes/minimal@v0.2.0
remote_theme: "godalming123/minimal"
plugins:
- jekyll-remote-theme # add this line to the plugins list if you already have one
```
Expand All @@ -40,6 +40,7 @@ Additionally, you may choose to set the following optional variables:
```yml
show_downloads: ["true" or "false" (unquoted) to indicate whether to provide a download URL]
google_analytics: [Your Google Analytics tracking ID]
color-scheme: ["dark", "light", "auto" or "auto-default-dark" auto is the default setting and changes theme based on device theme, auto-default-dark is the same except if you device does not support changing theme based on device theme it will default to dark and the others are fairly self explanetory.]
```

### Stylesheet
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ description: Minimal is a theme for GitHub Pages.
show_downloads: true
google_analytics:
theme: jekyll-theme-minimal
#color-scheme: auto-default-dark
11 changes: 9 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

{% seo %}
<link rel="stylesheet" href="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
{% seo %}

{%if site.color-scheme %}
<link rel="stylesheet" href="{{ "/assets/css/colors-ColorScheme.css?v=" | replace: "ColorScheme", site.color-scheme | append: site.github.build_revision | relative_url }}">
{% else %}
<link rel="stylesheet" href="{{ "/assets/css/colors-auto.css?v=" | append: site.github.build_revision | relative_url }}">
{% endif %}

<link rel="stylesheet" href="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->
Expand Down
124 changes: 124 additions & 0 deletions _sass/colors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
H -> hue
L -> luminosity
S -> saturation
clr -> color
bg -> background
hvr -> hover
*/

// colors that do not change depending on dark/light theme (each color catogry goes from brighter to darker)
:root {
// red colors
--code-d14: #d14;
--code-aa0000: #aa0000;
--code-990000: #990000;
// cyan colors
--code-009999: #009999;
--code-008080: #008080;
--code-3c5d5d: #3c5d5d;
// green colors
--code-009926: #009926;
// pink colors
--code-990073: #990073;
--code-800080: #800080;
// purple colors
--code-445588: #445588;
// blue colors
--code-000080: #000080;
// grey colors
--code-aaaaaa: #aaaaaa;
--code-999999: #999999;
--code-888888: #888888;
--code-555555: #555555;
}

@mixin colors {
// buttons
--L-a-text-hover-change: 0.8; // the number that --L-a-text gets changed by when it is hovered eg a button has 30% luminosity when left it luminosity is then timesed by 0.8 when the button is hovered
--clr-a-text: hsl(200, 100%, var(--L-a-text));
--clr-a-text-hvr: hsl(200, 100%, calc(var(--L-a-text) * var(--L-a-text-hover-change)));
--clr-buttons-main-bg: hsl(0, 0%, var(--L-buttons-main-bg));//the buttons in the main section at the top titled "download zip" "download tarbell" "veiw on github"
--clr-buttons-main-border: hsl(0, 0%, var(--L-buttons-main-border));
--clr-buttons-main-text: hsl(0, 0%, var(--L-buttons-main-text));
--clr-buttons-main-text-hover: hsl(0, 6%, var(--L-buttons-main-text-hover));
// headers + text
--clr-h1: hsl(0, 0%, var(--L-h1-and-bold));
--clr-h2: hsl(0, 0%, var(--L-h2));
--clr-h-3-6: hsl(0, 0%, var(--L-h-3-6));
--clr-text: hsl(0, 0%, var(--L-text));
// code blocks
--clr-code-text: hsl(0, 0%, var(--L-code-text));
--clr-code-bg: hsl(0, 0%, var(--L-code-bg));
--clr-code-border: hsl(0, 0%, var(--L-code-border));
--clr-code-bold-text: hsl(0, 0%, var(--L-code-bold-text));
//kbd these are keyboard shortcuts eg <kbd>CMD+R</kbd>
--clr-kbd-bg: hsl(210, 25%, var(--L-kbd-bg));
--clr-kbd-border: hsl(212.7, 10.7%, var(--L-kbd-border));
--clr-kbd-border-bottom-and-shadow: hsl(210, 8.2%, var(--L-kbd-border-bottom-and-shadow));// akbd elemnts border bottom and its shadow color
--clr-kbd-text: hsl(210, 11.7%, var(--L-kbd-text));
// miselainies
--clr-bg: hsl(0, 0%, var(--L-bg));//the bg of the page
--clr-visual-separation: hsl(0, 0%, var(--L-splitter-blockquote-and-section));//a color for the lines that split tables, appear on the left pf blockquotes and mark new sections
--clr-small-in-a: hsl(0, 0%, var(--L-small-in-a));//the color for small elements in a's this color is used on the veiw on github button above the download buttons
--clr-table-header-and-dt: hsl(0, 0%, var(--L-table-header-and-dt)); //more info on dt's https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_dd_test
}

@mixin light-colors {
// buttons
--L-a-text: 35%;
--L-buttons-main-bg: 96%;
--L-buttons-main-border: 88%;
--L-buttons-main-text: 40%;
--L-buttons-main-text-hover: 38%;
// headers + text
--L-h1-and-bold: 13%;
--L-h2: 22%;
--L-h-3-6: 29%;
--L-text-bold: 36%;
--L-text: 45%;
// code blocks
--L-code-text: 20%;
--L-code-bg: 97%;
--L-code-border: 90%;
--L-code-bold-text: 0%;
//kbd these are keyboard shortcuts eg <kbd>CMD+R</kbd>
--L-kbd-bg: 98%;
--L-kbd-border: 80%;
--L-kbd-border-bottom-and-shadow: 62%;
--L-kbd-text: 30%;
// misilainius
--L-bg: 100%;
--L-splitter-blockquote-and-section: 90%;//for elements like hr + blockquote
--L-small-in-a: 47%;
--L-table-header-and-dt: 27%; //more on dt's https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_dd_test
}

@mixin dark-colors {
// buttons
--L-a-text: 60%;
--L-buttons-main-bg: 17%;
--L-buttons-main-border: 26%;
--L-buttons-main-text: 76%;
--L-buttons-main-text-hover: 80%;
// headers + text
--L-h1-and-bold: 90%;
--L-h2: 83%;
--L-h-3-6: 76%;
--L-text: 70%;
// code blocks
--L-code-text: 80%;
--L-code-bg: 3%;
--L-code-border: 5%;
--L-code-bold-text: 100%;
//kbd these are keyboard shortcuts eg <kbd>CMD+R</kbd>
--L-kbd-bg: 30%;
--L-kbd-border: 45%;
--L-kbd-border-bottom-and-shadow: 55%;
--L-kbd-text: 100%;
// misilainius
--L-splitter-blockquote-and-section: 15%;// for elements like hr and blockquote
--L-bg: 10%;
--L-small-in-a: 60%;
--L-table-header-and-dt: 90%; //more on dt's https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_dd_test
}
Loading