Skip to content

Commit

Permalink
Add dark mode according to the system settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ramezanpour committed Oct 6, 2023
1 parent 436d392 commit 3d58adc
Show file tree
Hide file tree
Showing 4 changed files with 227 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.7.2)
activesupport (6.1.7.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
coffee-script (2.4.1)
Expand Down Expand Up @@ -205,14 +206,12 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.8.4)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.19.0)
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
nokogiri (1.13.10-arm64-darwin)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
Expand Down Expand Up @@ -250,9 +249,10 @@ GEM
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
webrick (1.8.1)
zeitwerk (2.6.12)

PLATFORMS
ruby
arm64-darwin-21

DEPENDENCIES
github-pages
Expand Down
193 changes: 193 additions & 0 deletions css/highlight-dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
.highlight pre {
background-color: #272822;
}
.highlight .hll {
background-color: #272822;
}
.highlight .c {
color: #75715e;
} /* Comment */
.highlight .err {
color: #960050;
background-color: #1e0010;
} /* Error */
.highlight .k {
color: #66d9ef;
} /* Keyword */
.highlight .l {
color: #ae81ff;
} /* Literal */
.highlight .n {
color: #f8f8f2;
} /* Name */
.highlight .o {
color: #f92672;
} /* Operator */
.highlight .p {
color: #f8f8f2;
} /* Punctuation */
.highlight .cm {
color: #75715e;
} /* Comment.Multiline */
.highlight .cp {
color: #75715e;
} /* Comment.Preproc */
.highlight .c1 {
color: #75715e;
} /* Comment.Single */
.highlight .cs {
color: #75715e;
} /* Comment.Special */
.highlight .ge {
font-style: italic;
} /* Generic.Emph */
.highlight .gs {
font-weight: bold;
} /* Generic.Strong */
.highlight .kc {
color: #66d9ef;
} /* Keyword.Constant */
.highlight .kd {
color: #66d9ef;
} /* Keyword.Declaration */
.highlight .kn {
color: #f92672;
} /* Keyword.Namespace */
.highlight .kp {
color: #66d9ef;
} /* Keyword.Pseudo */
.highlight .kr {
color: #66d9ef;
} /* Keyword.Reserved */
.highlight .kt {
color: #66d9ef;
} /* Keyword.Type */
.highlight .ld {
color: #e6db74;
} /* Literal.Date */
.highlight .m {
color: #ae81ff;
} /* Literal.Number */
.highlight .s {
color: #e6db74;
} /* Literal.String */
.highlight .na {
color: #a6e22e;
} /* Name.Attribute */
.highlight .nb {
color: #f8f8f2;
} /* Name.Builtin */
.highlight .nc {
color: #a6e22e;
} /* Name.Class */
.highlight .no {
color: #66d9ef;
} /* Name.Constant */
.highlight .nd {
color: #a6e22e;
} /* Name.Decorator */
.highlight .ni {
color: #f8f8f2;
} /* Name.Entity */
.highlight .ne {
color: #a6e22e;
} /* Name.Exception */
.highlight .nf {
color: #a6e22e;
} /* Name.Function */
.highlight .nl {
color: #f8f8f2;
} /* Name.Label */
.highlight .nn {
color: #f8f8f2;
} /* Name.Namespace */
.highlight .nx {
color: #a6e22e;
} /* Name.Other */
.highlight .py {
color: #f8f8f2;
} /* Name.Property */
.highlight .nt {
color: #f92672;
} /* Name.Tag */
.highlight .nv {
color: #f8f8f2;
} /* Name.Variable */
.highlight .ow {
color: #f92672;
} /* Operator.Word */
.highlight .w {
color: #f8f8f2;
} /* Text.Whitespace */
.highlight .mf {
color: #ae81ff;
} /* Literal.Number.Float */
.highlight .mh {
color: #ae81ff;
} /* Literal.Number.Hex */
.highlight .mi {
color: #ae81ff;
} /* Literal.Number.Integer */
.highlight .mo {
color: #ae81ff;
} /* Literal.Number.Oct */
.highlight .sb {
color: #e6db74;
} /* Literal.String.Backtick */
.highlight .sc {
color: #e6db74;
} /* Literal.String.Char */
.highlight .sd {
color: #e6db74;
} /* Literal.String.Doc */
.highlight .s2 {
color: #e6db74;
} /* Literal.String.Double */
.highlight .se {
color: #ae81ff;
} /* Literal.String.Escape */
.highlight .sh {
color: #e6db74;
} /* Literal.String.Heredoc */
.highlight .si {
color: #e6db74;
} /* Literal.String.Interpol */
.highlight .sx {
color: #e6db74;
} /* Literal.String.Other */
.highlight .sr {
color: #e6db74;
} /* Literal.String.Regex */
.highlight .s1 {
color: #e6db74;
} /* Literal.String.Single */
.highlight .ss {
color: #e6db74;
} /* Literal.String.Symbol */
.highlight .bp {
color: #f8f8f2;
} /* Name.Builtin.Pseudo */
.highlight .vc {
color: #f8f8f2;
} /* Name.Variable.Class */
.highlight .vg {
color: #f8f8f2;
} /* Name.Variable.Global */
.highlight .vi {
color: #f8f8f2;
} /* Name.Variable.Instance */
.highlight .il {
color: #ae81ff;
} /* Literal.Number.Integer.Long */

.highlight .gh {
} /* Generic Heading & Diff Header */
.highlight .gu {
color: #75715e;
} /* Generic.Subheading & Diff Unified/Comment? */
.highlight .gd {
color: #f92672;
} /* Generic.Deleted & Diff Deleted */
.highlight .gi {
color: #a6e22e;
} /* Generic.Inserted & Diff Inserted */
File renamed without changes.
34 changes: 29 additions & 5 deletions css/ramezanpour.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
@import "github.css";
@import "highlight-light.css" (prefers-color-scheme: light);
@import "highlight-dark.css" (prefers-color-scheme: dark);

:root {
--first: #145da0;
--second: #2e8bc0;
--black: #333;
--code: #f5f5f5;
}

@media (prefers-color-scheme: dark) {
body {
background-color: #111;
color: var(--black);
}
:root {
--first: #17b890;
--second: #9dc5bb;
--black: #ccc;
--code: #222;
}
}

h1,
h2,
h3,
h4,
h5,
h6 {
color: var(--black);
}

.container {
Expand Down Expand Up @@ -84,7 +108,7 @@ h1 a:hover {
.content pre {
padding: 10px;
border-radius: 5px;
background-color: #f5f5f5;
background-color: var(--code);
}

pre {
Expand All @@ -94,7 +118,7 @@ pre {
}

code {
background-color: #f5f5f5;
background-color: var(--code);
border-radius: 3px;
padding: 3px;
font-size: 120%;
Expand Down Expand Up @@ -122,9 +146,9 @@ footer.main-footer {

blockquote {
padding-left: 7px;
border-left: 3px solid #777;
border-left: 3px solid var(--first);
font-style: italic;
color: #777;
color: var(--black);
}

.home {
Expand Down

0 comments on commit 3d58adc

Please sign in to comment.