feat: Improve CSS + add fonts

This commit is contained in:
Alexis Fourmaux 2025-05-13 01:03:45 +02:00
parent ea79a6fbf6
commit 22a753478c
19 changed files with 708 additions and 307 deletions

View file

@ -1,7 +1,9 @@
@use 'fonts';
@use 'theme';
*, *::before, *::after {
*,
*::before,
*::after {
box-sizing: border-box;
}
@ -14,18 +16,13 @@ body {
color: var(--text);
background-color: var(--base);
font-size: 1rem;
font-weight: light;
line-height: 1.75;
}
main {
display: flex;
align-items: center;
flex-direction: column;
}
article {
max-width: min(50rem, 90%);
max-width: min(700px, 95%);
margin-left: auto;
margin-right: auto;
}
section {
@ -38,12 +35,13 @@ section {
h1 {
font-size: 2rem;
font-weight: bold;
font-weight: medium;
margin-top: 2rem;
margin-bottom: 1rem;
&.title {
font-size: 2.5rem;
font-weight: bolder;
font-size: 3rem;
font-weight: 900;
margin-bottom: 0;
color: var(--maroon);
}
@ -52,37 +50,44 @@ h1 {
h2 {
font-size: 1.5rem;
margin-bottom: 1rem;
font-weight: bold;
font-weight: medium;
}
h3 {
font-size: 1.2rem;
margin-bottom: .6rem;
font-weight: bold;
font-weight: medium;
}
h4 {
font-size: 1.1rem;
font-weight: bold;
font-weight: medium;
}
h5 {
font-size: 1rem;
font-weight: bold;
font-weight: medium;
}
h6 {
font-size: .9rem;
font-weight: bold;
font-weight: medium;
}
p, h1, h2, h3, h4, h5, h6 {
p,
h1,
h2,
h3,
h4,
h5,
h6 {
overflow-wrap: break-word;
}
p {
margin-top: 1.25rem;
margin-bottom: 1.25rem;
&.subtitle {
color: var(--subtext0);
margin-top: 0;
@ -96,12 +101,20 @@ a {
text-decoration-color: color-mix(in srgb, var(--blue), transparent 40%);
text-decoration-thickness: 0.01rem;
text-underline-offset: 0.3rem;
&:hover {
color: var(--sky);
}
&:visited {
color: var(--lavender);
}
&.zola-anchor {
color: var(--text);
text-decoration-color: var(--text);
margin-left: .5rem;
}
}
li {
@ -121,18 +134,23 @@ video {
}
pre {
font-family: fonts.$mono-font;
padding: 1.25rem;
border-radius: var(--standard-border-radius);
border-style: solid;
border-color: var(--surface0);
border-width: 0.15rem;
& > code {
line-height: initial;
overflow-x: scroll;
&>code {
background-color: initial;
border: initial;
}
}
code {
font-family: fonts.$mono-font;
background-color: var(--mantle);
padding: .2rem;
border-radius: .3rem;
@ -148,6 +166,7 @@ table {
margin-bottom: 1.5rem;
margin-left: auto;
margin-right: auto;
overflow-x: scroll;
}
td,
@ -168,40 +187,39 @@ th {
border: none
}
tr:first-child > td:first-child {
tr:first-child>td:first-child {
border-top-left-radius: var(--standard-border-radius);
}
tr:first-child > td:last-child {
tr:first-child>td:last-child {
border-top-right-radius: var(--standard-border-radius);
}
tr:last-child > td:first-child {
tr:last-child>td:first-child {
border-bottom-left-radius: var(--standard-border-radius);
}
tr:last-child > td:last-child {
tr:last-child>td:last-child {
border-bottom-right-radius: var(--standard-border-radius);
}
tr > td:last-child {
tr>td:last-child {
border-right-width: .15rem;
}
tr:first-child > td {
tr:first-child>td {
border-top-width: .15rem;
}
tr > td:first-child {
tr>td:first-child {
border-left-width: .15rem;
}
tr:last-child > td {
tr:last-child>td {
border-bottom-width: .15rem;
}
tr:nth-child(even) td {
/* Set every other cell slightly darker. Improves readability. */
background-color: var(--mantle);
}
@ -212,4 +230,64 @@ hr {
width: 50%;
margin-left: auto;
margin-right: auto;
border-style: solid;
border-radius: 1rem;
border-width: 1px;
}
blockquote {
position: relative;
margin-inline: 0;
margin-block-end: 2rem;
padding-inline-start: 2em;
overflow: hidden;
quotes: "" "" "" "";
&::before,
&::after {
position: absolute;
}
&::before {
content: "";
left: .2rem;
font-size: 2rem;
color: var(--overlay1);
}
&::after {
content: "";
left: .6rem;
top: 2rem;
width: 1px;
height: 100%;
background-color: var(--overlay1);
}
}
cite {
&::before {
content: "~ "
}
font-style: italic;
color: var(--subtext0);
}
footer.footnotes {
font-size: .8rem;
color: var(--subtext1);
margin-top: 3rem;
border-top: 1px solid var(--surface0);
&>ol.footnotes-list>li {
margin-top: 1rem;
&>p {
margin: {
top: .4rem;
bottom: .4rem;
}
}
}
}

View file

@ -1,3 +1,87 @@
$text-font: "Ubuntu Nerd Font", Arial, Helvetica, sans-serif;
$title-font: "Ubuntu Nerd Font", Arial, Helvetica, sans-serif;
$mono-font: "UbuntuMono Nerd Font", monospace;
@font-face {
font-family: "Ubuntu";
src: url("fonts/Ubuntu/Ubuntu-B.ttf") format(truetype);
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: "Ubuntu";
src: url("fonts/Ubuntu/Ubuntu-BI.ttf") format(truetype);
font-weight: 700;
font-style: italic;
}
@font-face {
font-family: "Ubuntu";
src: url("fonts/Ubuntu/Ubuntu-R.ttf") format(truetype);
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "Ubuntu";
src: url("fonts/Ubuntu/Ubuntu-RI.ttf") format(truetype);
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: "Ubuntu";
src: url("fonts/Ubuntu/Ubuntu-M.ttf") format(truetype);
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: "Ubuntu";
src: url("fonts/Ubuntu/Ubuntu-MI.ttf") format(truetype);
font-weight: 500;
font-style: italic;
}
@font-face {
font-family: "Ubuntu";
src: url("fonts/Ubuntu/Ubuntu-L.ttf") format(truetype);
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: "Ubuntu";
src: url("fonts/Ubuntu/Ubuntu-LI.ttf") format(truetype);
font-weight: 300;
font-style: italic;
}
@font-face {
font-family: "Ubuntu Mono";
src: url("fonts/Ubuntu/UbuntuMono-B.ttf") format(truetype);
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: "Ubuntu Mono";
src: url("fonts/Ubuntu/UbuntuMono-BI.ttf") format(truetype);
font-weight: 700;
font-style: italic;
}
@font-face {
font-family: "Ubuntu Mono";
src: url("fonts/Ubuntu/UbuntuMono-R.ttf") format(truetype);
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "Ubuntu Mono";
src: url("fonts/Ubuntu/UbuntuMono-RI.ttf") format(truetype);
font-weight: 400;
font-style: italic;
}
$text-font: "Ubuntu", Helvetica, sans-serif;
$title-font: "Ubuntu", Helvetica, sans-serif;
$mono-font: "Ubuntu Mono", monospace;