Skip to content

Commit d8b881e

Browse files
authored
Dark Mode thanks to Merge faculerena (PR #26)
2 parents 929f8cd + 12eff99 commit d8b881e

5 files changed

Lines changed: 134 additions & 25 deletions

File tree

_includes/headerDefault.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
{%- assign default_paths = site.pages | map: "path" -%}
23
{%- assign page_paths = site.header_pages | default: default_paths -%}
34

@@ -16,4 +17,5 @@
1617
{%- endfor -%}
1718
</div>
1819
</nav>
19-
{%- endif -%}
20+
{%- endif -%}
21+

css/main.css

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,34 @@
11
:root{
2-
--shadow-color: hsl(184 25% 6% / 1);
3-
--border-color: hsl(184 25% 75% / 1)
2+
3+
--shadow-color: var(--background-color2);
4+
--border-color: var(--background-color2);
5+
}
6+
7+
8+
9+
/* Colores en variables + dark mode */
10+
html {
11+
--light-text-color: rgb(72, 72, 74);
12+
--link-color: rgb(0, 112, 201);
13+
--background-color: rgb(255, 255, 255);
14+
--main-text-color: rgb(51, 51, 51);
15+
--background-color2: rgb(255, 255, 255);
16+
--background-color3 : #fff;
17+
--logo: #231f20;
18+
}
19+
20+
21+
22+
@media (prefers-color-scheme: dark) {
23+
html {
24+
--light-text-color: rgb(199, 199, 204);
25+
--link-color: rgb(100, 210, 255);
26+
--background-color: rgb(28, 28, 30);
27+
--background-color2: rgb(15, 15, 20);
28+
--main-text-color: rgb(229, 229, 234);
29+
--background-color3: #b4b4b4;
30+
--logo: #b4b4b4;
31+
}
432
}
533

634
/** Reset some basic elements */
@@ -11,8 +39,8 @@ body, h1, h2, h3, h4, h5, h6, p, blockquote, pre, hr, dl, dd, ol, ul, figure {
1139

1240
/** Basic styling */
1341
body {
14-
background-color: #fdfdfd;
15-
color: #111;
42+
background-color: var(--background-color);
43+
color: var(--main-text-color);
1644
display: flex;
1745
flex-direction: column;
1846
font: 400 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
@@ -27,9 +55,6 @@ body {
2755
-webkit-font-feature-settings: "kern" 1;
2856
-webkit-text-size-adjust: 100%;
2957
}
30-
31-
32-
3358

3459
/** Set `margin-bottom` to maintain vertical rhythm */
3560
h1, h2, h3, h4, h5, h6, p, blockquote, pre, ul, ol, dl, figure, .highlight {
@@ -61,24 +86,27 @@ li > ul, li > ol { margin-bottom: 0; }
6186
h1, h2, h3, h4, h5, h6 { font-weight: 400; }
6287

6388
/** Links */
64-
a { color: #2a7ae2; text-decoration: none; }
65-
a:visited { color: #1756a9; }
89+
a { color: var(--link-color); text-decoration: none; }
90+
a:visited { color:var(--link-color); }
6691
a:hover { color: #111; text-decoration: underline; }
6792
.social-media-list a:hover { text-decoration: none; }
6893
.social-media-list a:hover .username { text-decoration: underline; }
6994

7095
/** Blockquotes */
7196
blockquote {
72-
color: #828282;
73-
border-left: 4px solid #e8e8e8;
97+
color: var(--background-color2);
98+
border-left: 4px solid var(--background-color);
7499
padding-left: 15px;
75100
font-size: 18px; letter-spacing: -1px; font-style: italic; }
76101
blockquote > :last-child { margin-bottom: 0; }
77102

78103
/** Code formatting */
79-
pre, code { font-size: 15px; border: 1px solid #e8e8e8; border-radius: 3px; background-color: #eef; }
104+
pre, code { font-size: 15px; border: 1px solid var(--background-color2); border-radius: 3px; background-color: var(--background-color2) }
80105

81-
code { padding: 1px 5px; }
106+
code {
107+
padding: 1px 5px;
108+
background-color: var(--background-color2)
109+
}
82110

83111
pre { padding: 8px 12px; overflow-x: auto; }
84112
pre > code { border: 0; padding-right: 0; padding-left: 0; }
@@ -101,19 +129,18 @@ pre > code { border: 0; padding-right: 0; padding-left: 0; }
101129
.social-media-list li + li { padding-top: 5px; }
102130

103131
/** Tables */
104-
table { margin-bottom: 30px; width: 100%; text-align: left; color: #3f3f3f; border-collapse: collapse; border: 1px solid #e8e8e8; }
105-
table tr:nth-child(even) { background-color: #f7f7f7; }
132+
table { margin-bottom: 30px; width: 100%; text-align: left; color: #3f3f3f; border-collapse: collapse; border: 1px solid var(--light-text-color); }
133+
table tr:nth-child(even) { background-color: var(--light-text-color); }
106134
table th, table td { padding: 10px 15px; }
107-
table th { background-color: #f0f0f0; border: 1px solid #dedede; border-bottom-color: #c9c9c9; }
108-
table td { border: 1px solid #e8e8e8; }
135+
table th { background-color: var(--background-color);; border: 1px solid var(--light-text-color); border-bottom-color: #c9c9c9; }
136+
table td { border: 1px solid var(--light-text-color); }
109137

110138
/** Site header */
111139
.site-header {
112-
background-color: #fdfdfd;
140+
background-color: var(--background-color);
113141
padding: 10px;
114142
border-top: 5px solid hsl(184 75% 15% / 1);
115143
border-bottom: 1px solid var(--border-color);
116-
box-shadow: 0px -2px 10px 0px var(--shadow-color);
117144
min-height: 55.95px;
118145
position: fixed;
119146
top: 0px;
@@ -126,7 +153,7 @@ table td { border: 1px solid #e8e8e8; }
126153
.site-nav { float: right; line-height: 54px; }
127154
.site-nav .nav-trigger { display: none; }
128155
.site-nav .menu-icon { display: none; }
129-
.site-nav .page-link { color: #111; line-height: 1.5; }
156+
.site-nav .page-link { color: var(--main-text-color); line-height: 1.5; }
130157
.site-nav .page-link:not(:last-child) { margin-right: 20px; }
131158
@media screen and (max-width: 600px) { .site-nav { position: absolute; top: 9px; right: 15px; background-color: #fdfdfd;
132159
border: 1px solid var(--border-color); border-radius: 5px; text-align: right; }
@@ -193,7 +220,7 @@ table td { border: 1px solid #e8e8e8; }
193220
@media screen and (max-width: 800px) { .post-content h4 { font-size: 18px; } }
194221

195222
/** Syntax highlighting styles */
196-
.highlight { background: #fff; }
223+
.highlight { color: #fff; }
197224
.highlighter-rouge .highlight { background: #eef; }
198225
.highlight .c { color: #998; font-style: italic; }
199226
.highlight .err { color: #a61717; background-color: #e3d2d2; }

css/tallerIndex.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111

1212
.index-taller-item{
13-
background-color: #e4e4e4;
13+
background-color: var(--background-color);
1414
border-radius: 5px;
1515
text-align: center;
1616
padding: 1em;

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
title: Comisión de Estudiantes de Computación
44
paginate_path: "/blog/page:num"
55
---
6+
<html>
67
<h2 class="post-list-heading">Noticias</h2>
78
<ul class="post-list">
89
{% for post in paginator.posts %}
@@ -38,4 +39,5 @@ <h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
3839
<span>Next &raquo;</span>
3940
{% endif %}
4041
</div>
41-
{% endif %}
42+
{% endif %}
43+
</html>

0 commit comments

Comments
 (0)