Skip to content

Commit f5b630d

Browse files
committed
added sass variables + readme update
+ introduced sass variables + added some more readme information
1 parent 24e8cad commit f5b630d

File tree

2 files changed

+63
-23
lines changed

2 files changed

+63
-23
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,34 @@ This theme supports dark and light mode. Currently this will be only switched ba
6969

7070
#### Size
7171

72-
We need about `2kB` extra stuff aside from images and raw html. This is divided up to `1.7kB CSS` and `~300B JS`.
72+
We need about `~2.3KiB` extra stuff aside from images and raw html. This is divided up to `~2.1KiB CSS` and `212B JS`.
73+
74+
Test yourself with `zola build 1>/dev/null; echo "scale=2; $(cat public/**/*.{js,css} | wc -c)/1024" | bc -l`.
7375

7476
#### Syntax Highlighting
7577

7678
As I didn't want to invest any time in creating an own syntax color schema for this theme, I suggest to use `visual-studio-dark`, which is the same one used in the demo page.
7779

80+
#### Customization
81+
82+
You can create your own version of this theme, by simply changing the sass variables in `sass/style.scss` to match your taste.
83+
84+
```scss
85+
/**
86+
* Variables
87+
*/
88+
$base-background: white;
89+
$text-color: black;
90+
$article-tag: green;
91+
$lang-tag: red;
92+
$link-color: blue;
93+
$target-color: yellow;
94+
$separator-decoration: "//////";
95+
```
96+
7897
### TODO
7998

80-
- [ ] introduce sass variables for colors
99+
- [x] introduce sass variables for colors
81100
- [ ] dark/light switch with javascript and store in browser session
82101

83102
## License

sass/style.scss

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
1+
/**
2+
* Variables
3+
*/
4+
$base-background: white;
5+
$text-color: black;
6+
$article-tag: green;
7+
$lang-tag: red;
8+
$link-color: blue;
9+
$target-color: yellow;
10+
$separator-decoration: "//////";
11+
12+
/**
13+
* Mixins
14+
*/
115
@mixin darkmode {
216
filter: invert(1);
317
img {
418
filter: invert(1);
519
}
620
}
721

22+
/**
23+
* Style
24+
*/
825
html {
926
height: 100%;
1027
}
@@ -29,7 +46,7 @@ body[darkmode] {
2946

3047
html,
3148
body {
32-
background: white;
49+
background: $base-background;
3350
}
3451

3552
header {
@@ -55,19 +72,23 @@ hr {
5572
border: 0;
5673

5774
&:before {
58-
content: "//////";
75+
content: $separator-decoration;
5976
}
6077
&:after {
61-
content: "//////";
78+
content: $separator-decoration;
6279
}
6380
&[text]:after {
64-
content: " " attr(text) " //////";
81+
content: " " attr(text) " " $separator-decoration;
6582
}
6683
}
6784

85+
a {
86+
color: $link-color;
87+
}
88+
6889
blockquote {
69-
color: rgba(black, 0.7);
70-
border-left: 2px solid rgba(black, 0.7);
90+
color: rgba($text-color, 0.7);
91+
border-left: 2px solid rgba($text-color, 0.7);
7192
padding: 0 1rem;
7293
margin: 2rem 0;
7394
}
@@ -78,7 +99,7 @@ blockquote {
7899
content: " \00D8 ";
79100
display:inline-block;
80101
margin-left: 10px;
81-
color: black;
102+
color: $text-color;
82103
}
83104
&:last-child:after {
84105
display: none;
@@ -88,18 +109,18 @@ blockquote {
88109

89110
.chips {
90111
span {
91-
background: black;
112+
background: $text-color;
92113
padding: 3px 10px;
93114
border-radius: 1.4rem;
94-
color: white;
115+
color: $base-background;
95116

96117
&.tag {
97-
background-color: rgba(green, 0.8);
118+
background-color: rgba($article-tag, 0.8);
98119
}
99120

100121
&.lang {
101122
cursor: pointer;
102-
background-color: rgba(red, 0.8);
123+
background-color: rgba($lang-tag, 0.8);
103124
}
104125
}
105126

@@ -117,22 +138,22 @@ article {
117138

118139
h3 {
119140
text-decoration: underline;
120-
text-decoration-color: white;
141+
text-decoration-color: $base-background;
121142
text-decoration-thickness: 3px;
122143
transition: text-decoration-color .3s ease;
123144
}
124145

125146
&:hover {
126147
h3 {
127-
text-decoration-color: blue;
148+
text-decoration-color: $link-color;
128149
}
129150
}
130151

131152
time {
132153
position: absolute;
133154
top: 2px;
134155
right: 0;
135-
color: rgba(black, 0.7);
156+
color: rgba($text-color, 0.7);
136157
}
137158

138159
.chips span.lang {
@@ -153,21 +174,21 @@ main.article-content {
153174
max-height: 80vh;
154175

155176
& + em {
156-
color: rgba(black, 0.7);
177+
color: rgba($text-color, 0.7);
157178
text-align: center;
158179
display: block;
159180
}
160181
}
161182

162183
code {
163-
background: black;
164-
color: white;
184+
background: $text-color;
185+
color: $base-background;
165186
padding: 1px 8px;
166187
}
167188

168189
pre {
169-
background: black !important;
170-
color: white;
190+
background: $text-color !important;
191+
color: $base-background;
171192
padding: 1rem;
172193
overflow-x: auto;
173194
overflow-y: visible;
@@ -176,8 +197,8 @@ main.article-content {
176197
.footnote-definition {
177198
padding: 0 1rem;
178199
&:target {
179-
background: yellow;
180-
color: black;
200+
background: $target-color;
201+
color: $text-color;
181202
}
182203
p {
183204
display: inline-block;

0 commit comments

Comments
 (0)