Skip to content

Commit

Permalink
Add the default series of themes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MetroWind committed Sep 28, 2024
1 parent 835307b commit febc177
Show file tree
Hide file tree
Showing 8 changed files with 247 additions and 0 deletions.
10 changes: 10 additions & 0 deletions statics/theme-selector.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function selectTheme(new_theme)
{
fetch(SELECT_THEME_ENDPOINT, {
method: "POST",
body: JSON.stringify({theme: new_theme})
}).then((_) => location.reload());
}

const theme_selector = document.getElementById("SelectTheme");
theme_selector.addEventListener("change", () => selectTheme(theme_selector.value));
48 changes: 48 additions & 0 deletions themes/generic/0-reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
56 changes: 56 additions & 0 deletions themes/generic/1-styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
body
{
line-height: 1.5;
}

h1, h2, h3, h4, h5, h6
{
margin: 1.5em 0;
}

h1
{
font-size: 1.728rem;
}

h2
{
font-size: 1.44rem;
}

h3
{
font-size: 1.2rem;
}

p
{
margin: 1em 0;
}

em
{
font-style: italic;
}

ul
{
list-style: square outside;
}

ol
{
list-style: decimal outside;
}

ul, ol
{
margin-left: 1.5em;
}

code, pre
{
font-family: monospace;
white-space: pre-wrap;
word-break: break-all;
}
Empty file added themes/generic/info.yaml
Empty file.
1 change: 1 addition & 0 deletions themes/planck-light/info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
parent: planck
8 changes: 8 additions & 0 deletions themes/planck-light/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
:root
{
--color-bg: #c4cdd3;
--color-fg: #4c5256;
--color-alt-bg: #a9b5bd;
--color-accent: #616b72;
--color-thin: #83919a;
}
1 change: 1 addition & 0 deletions themes/planck/info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
parent: generic
123 changes: 123 additions & 0 deletions themes/planck/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
@import url("../../statics/fonts/iosevka-etoile/IosevkaEtoile.css");
@import url("../../statics/fonts/iosevka/IosevkaSS10.css");

body
{
background-color: var(--color-bg);
color: var(--color-fg);
font-family: "Iosevka Etoile Web", "Source Han Sans", "Noto Sans CJK", sans-serif;
font-size: 19px;
}

nav
{
background-color: var(--color-alt-bg);
font-size: 80%;
padding: 4px 1em;
}

a
{
color: var(--color-accent);
text-decoration: underline;
}

a:hover
{
color: var(--color-bg);
background-color: var(--color-accent);
}

code, pre
{
font-family: "Iosevka SS10 Web", monospace;
font-size: 95%;
}

p
{
margin: unset;
text-indent: 1.5em;
}

p:first-of-type, pre p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p
{
text-indent: unset;
}

.paragraph > p
{
text-indent: 1.5em;
}

.paragraph:first-of-type > p
{
text-indent: unset;
}

#Post[lang^="zh-"] p, #Post[lang="zh"] p
{
text-indent: 2em;
}

#Post[lang^="zh-"] li > p, #Post[lang="zh"] li > p
{
text-indent: unset;
}

main, #BlogTitle
{
max-width: 700px;
margin: 0 auto;
}

#BlogTitle
{
font-size: 2rem;
font-style: italic;
}

#PostList
{
text-align: center;
list-style: none;
}

#PostList > li
{
margin: 3.5em 0;
}

h1.PostTitle
{
margin: 0.75em 0;
}

h1.PostTitle > a
{
text-decoration: none;
}

#Post > h1
{
text-align: center;
margin: 2.5em 0 1em 0;
}

#Post > #Metadata
{
color: var(--color-thin);
font-size: 0.8rem;
text-align: center;
font-weight: bold;
}

#Post[lang^="zh-"], #Post[lang="zh"]
{
line-height: 1.65;
}

#Post[lang^="zh-"] ul, #Post[lang^="zh-"] ol, #Post[lang="zh"] ul, #Post[lang="zh"] ol
{
margin-left: 2em;
}

0 comments on commit febc177

Please sign in to comment.