new style, dark style

This commit is contained in:
veclav talica 2024-02-10 20:48:22 +05:00
parent 7807619d58
commit 952a773875
2 changed files with 32 additions and 9 deletions

View File

@ -1,8 +1,26 @@
@media (prefers-color-scheme: dark) {
:root {
--bg-color: #111;
--fg-color: #fff;
--link-color: dodgerblue;
}
}
* {
color: var(--fg-color);
text-decoration: none;
}
a {
color: var(--link-color);
}
html { html {
font-size: 20px; font-size: 20px;
font-family: "Charter","Georgia",'Times New Roman',serif; font-family: "Charter","Georgia",'Times New Roman',serif;
} }
body { body {
background-color: var(--bg-color);
line-height: 1.3; line-height: 1.3;
} }
article, .container { article, .container {
@ -29,7 +47,7 @@ html {
margin: 0.9em 0px 0.9em; margin: 0.9em 0px 0.9em;
} }
pre, code { pre, code {
background-color: #eeeeff; background-color: var(--bg-color);
line-height: normal; line-height: normal;
overflow: auto; overflow: auto;
font-size: 0.8em; font-size: 0.8em;
@ -46,7 +64,7 @@ html {
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;
font-size: 0.8em; font-size: 0.8em;
background-color: #f0f0f0; background-color: var(--bg-color);
border: 1px solid #bbbbdd; border: 1px solid #bbbbdd;
} }
nav li:first-child { nav li:first-child {
@ -66,10 +84,10 @@ html {
background-color: #e0e0e0; background-color: #e0e0e0;
} }
nav a:link { nav a:link {
color: #44d; color: var(--link-color);
} }
nav a:visited { nav a:visited {
color: #44d; color: var(--link-color);
} }
nav a.here { nav a.here {
background-color: #e0e0e0; background-color: #e0e0e0;

View File

@ -2,8 +2,7 @@
HEAD_EMBED = """ HEAD_EMBED = """
<div class="container"> <div class="container">
<header> <nav class="custom-nav">
<nav>
<ul> <ul>
<li><a href="/"><strong>mjestečko</strong></a></li> <li><a href="/"><strong>mjestečko</strong></a></li>
<li><a href="https://git.poto.cafe/veclavtalica/mjestecko">source</a></li> <li><a href="https://git.poto.cafe/veclavtalica/mjestecko">source</a></li>
@ -11,14 +10,14 @@ HEAD_EMBED = """
<li><a href="/articles/mjestečko.html">about</a></li> <li><a href="/articles/mjestečko.html">about</a></li>
</ul> </ul>
</nav> </nav>
</header>
""" """
NOTICE = """ NOTICE = """
<footer> <footer>
<a href="#top">Back to top </a> <a href="#top">Take me home </a>
</footer> </footer>
""" """
TAIL_EMBED = """ TAIL_EMBED = """
@ -54,5 +53,11 @@ WEEKDAYS = {
6: "Sunday" 6: "Sunday"
} }
def mixin_tag(content: str, tag: str) -> str:
return f"""<{tag}>
{content}</{tag}>
"""
def wrap_page(page: str) -> str: def wrap_page(page: str) -> str:
return HEAD_EMBED + page + NOTICE + TAIL_EMBED return HEAD_EMBED + mixin_tag(page, "main") + NOTICE + TAIL_EMBED