Fix theming and fix theme switcher bug (#14)
* Fix theming and fix theme switcher bug * Fix css comment and remove old js
This commit is contained in:
@@ -15,10 +15,15 @@ Yo yo yo
|
|||||||
- a
|
- a
|
||||||
- list
|
- list
|
||||||
|
|
||||||
|
1. This
|
||||||
|
2. is
|
||||||
|
3. a
|
||||||
|
4. numbered
|
||||||
|
5. list
|
||||||
|
|
||||||
```py
|
```py
|
||||||
Codeblocks look like this
|
Codeblocks look like this
|
||||||
|
|
||||||
def print():
|
def print():
|
||||||
print('Hello world!')
|
print('Hello world!')
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -20,5 +20,4 @@ Codeblocks look like this
|
|||||||
|
|
||||||
def print():
|
def print():
|
||||||
print('Hello world!')
|
print('Hello world!')
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -20,5 +20,4 @@ Codeblocks look like this
|
|||||||
|
|
||||||
def print():
|
def print():
|
||||||
print('Hello world!')
|
print('Hello world!')
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
html {
|
html {
|
||||||
background: #171717 !important;
|
background: #121212 !important;
|
||||||
color: white !important;
|
color: #e2e2e2 !important;
|
||||||
}
|
}
|
||||||
.header {
|
|
||||||
background-color: #1b1c1d !important;
|
.header,
|
||||||
color: white !important;
|
code,
|
||||||
|
pre {
|
||||||
|
background-color: #1f1f1f !important;
|
||||||
|
color: #e2e2e2 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: Check if this is needed or not */
|
/* TODO: Check if this is needed or not */
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ html {
|
|||||||
|
|
||||||
/* HEADER */
|
/* HEADER */
|
||||||
.header {
|
.header {
|
||||||
background-color: #bbb;
|
background-color: rgb(238, 238, 238);
|
||||||
|
box-shadow: rgba(0, 0, 0, 0.5) 0px 1px 2px 0px;
|
||||||
color: black;
|
color: black;
|
||||||
height: 70px;
|
height: 70px;
|
||||||
left: 0;
|
left: 0;
|
||||||
@@ -86,6 +87,7 @@ html {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** COMMON **/
|
||||||
/* TAGS */
|
/* TAGS */
|
||||||
.post-tags {
|
.post-tags {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
@@ -105,6 +107,24 @@ html {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* CODE BLOCKS */
|
||||||
|
code,
|
||||||
|
pre {
|
||||||
|
background-color: #eee !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
font-size: 0.95rem;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
box-decoration-break: clone;
|
||||||
|
padding: 0 3px;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
/* SINGLE */
|
/* SINGLE */
|
||||||
#content {
|
#content {
|
||||||
width: 810px;
|
width: 810px;
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ function ready() {
|
|||||||
toggleIcon = document.querySelector('#dark-theme-toggle span');
|
toggleIcon = document.querySelector('#dark-theme-toggle span');
|
||||||
darkThemeCss = document.getElementById("dark-theme");
|
darkThemeCss = document.getElementById("dark-theme");
|
||||||
|
|
||||||
// TODO: Fetch programatically by user's system preference
|
|
||||||
const savedTheme = localStorage.getItem(THEME_PREF_STORAGE_KEY) ||
|
const savedTheme = localStorage.getItem(THEME_PREF_STORAGE_KEY) ||
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark': 'light';
|
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark': 'light');
|
||||||
setTheme(savedTheme);
|
setTheme(savedTheme);
|
||||||
document.getElementById('dark-theme-toggle').addEventListener('click', () => {
|
document.getElementById('dark-theme-toggle').addEventListener('click', () => {
|
||||||
if (toggleIcon.className === THEME_TO_ICON_CLASS.dark) {
|
if (toggleIcon.className === THEME_TO_ICON_CLASS.dark) {
|
||||||
|
|||||||
Reference in New Issue
Block a user