Improve default template and css

This commit is contained in:
ChaoticByte 2025-07-11 22:39:47 +02:00
parent d550911864
commit bebf4fc986
No known key found for this signature in database
2 changed files with 41 additions and 54 deletions

View file

@ -10,12 +10,11 @@
</head> </head>
<body> <body>
{{ if .Entry -}} {{ if .Entry -}}
<div class="homebtn"><a href="/">home</a></div>
<div class="main"> <div class="main">
<h1>{{ .EntryTitle }}</h1> <h1>{{ .EntryTitle }}</h1>
<div class="content"> <div class="content">{{ .Entry }}</div>
{{ .Entry }} <br>
</div> <p><a href="/">&lt; home</a></p>
</div> </div>
{{- else -}} {{- else -}}
<div class="home-main"> <div class="home-main">

View file

@ -1,65 +1,57 @@
/* Copyright (c) 2024 Julian Müller (ChaoticByte) */ /* Copyright (c) 2024 Julian Müller (ChaoticByte) */
:root {
--color-text: black;
--color-footer: #00000080;
--color-search-box-placeholder: #00000060;
--color-search-box-border: #00000040;
--background: #dfd4d0;
--font-family: sans-serif;
}
body { body {
margin: 0;
padding: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; margin: 0;
width: 100vw; padding: 0;
min-height: 100vh; min-height: 100vh;
font-family: sans-serif; font-family: var(--font-family);
background: var(--background);
} }
a:hover, a:focus { text-decoration: underline; } a:hover, a:focus { text-decoration: underline; }
a { a {
color: black; color: var(--color-text);
text-decoration: none; text-decoration: none;
outline: none; outline: none;
} }
footer { footer {
margin-top: auto;
padding: 1rem;
box-sizing: border-box;
display: flex; display: flex;
justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: auto;
box-sizing: border-box;
padding: 1rem;
} }
footer > div { footer > div {
margin: 0 .5rem; margin: 0 .5rem;
} }
footer, footer * { footer, footer * {
color: #00000080 !important; color: var(--color-footer) !important;
font-size: .9rem; font-size: .9rem;
text-align: center;
}
.homebtn {
position: absolute;
top: 1rem;
left: 1rem;
}
.main {
margin: 2rem 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.main > h1, .content {
width: 70vw;
max-width: 50rem;
} }
.main > h1 { .main > h1 {
font-size: 1.4rem; font-size: 1.4rem;
margin-top: 1.5rem; margin-top: .6rem;
margin-bottom: .5rem; margin-bottom: 1.5rem;
text-align: center; }
.main > h1, .content {
max-width: 42rem;
} }
.content { white-space: pre-line; } .content { white-space: pre-line; }
.home-main, .main {
.home-main {
width: 100%;
padding: 2rem; padding: 2rem;
box-sizing: border-box; box-sizing: border-box;
}
.home-main {
width: fit-content;
min-width: 30rem;
gap: 1rem; gap: 1rem;
} }
.about { .about {
@ -67,6 +59,8 @@ footer, footer * {
} }
.about > h1 { .about > h1 {
font-size: 1.6rem; font-size: 1.6rem;
margin-top: .4rem;
margin-bottom: 1.5rem;
} }
.description { .description {
white-space: pre-line; white-space: pre-line;
@ -79,29 +73,23 @@ footer, footer * {
.toc, #search-results { gap: .2rem; } .toc, #search-results { gap: .2rem; }
#search-box { #search-box {
width: 100%; width: 100%;
height: 2rem;
border: none; border: none;
outline: none; outline: none;
border-bottom: 1px solid #00000040; border-bottom: 1px solid var(--color-search-box-border);
height: 2rem; background: transparent;
font-size: 1rem; font-size: 1rem;
} }
#search-box:active, #search-box:focus, #search-box:hover { #search-box::placeholder {
border-bottom: 1px solid black; color: var(--color-search-box-placeholder);
}
#search-box:not(:placeholder-shown), #search-box:active, #search-box:focus, #search-box:hover {
border-bottom: 1px solid var(--color-text);
} }
.hidden { display: none !important; } .hidden { display: none !important; }
@media only screen and (max-width: 750px) { @media only screen and (max-width: 750px) {
.main { margin-top: 4rem; }
.main > h1 {
margin-top: unset;
}
.main > h1, .content { .main > h1, .content {
width: 90vw; width: 100%;
max-width: unset; max-width: unset;
} }
.homebtn {
left: unset;
right: 1rem;
}
} }