Modularise stylesheet

This commit is contained in:
Sam 2024-08-07 15:32:21 +01:00
parent 36d489eb8c
commit 87727c3b3d
5 changed files with 316 additions and 344 deletions

190
static/css/articles.css Normal file
View File

@ -0,0 +1,190 @@
.page-container {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.main-content {
flex: 1;
}
.article-container {
display: flex;
justify-content: center;
}
.page-container {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.page-content {
color: var(--text-color);
padding-top: var(--content-padding);
padding: var(--content-padding);
padding-left: var(--content-padding);
padding-right: var(--content-padding);
max-width: 1000px;
line-height: var(--line-height);
text-align: left;
}
.page-content h1 {
color: var(--heading1-color);
}
.home-page-content {
line-height: 2;
margin-bottom: 30px;
margin-top: 30px;
}
.home-page-content h1 {
text-align: center;
font-size: 32px !important;
margin-bottom: 120px;
}
.home-page-content h3 {
font-weight: normal;
font-size: 28px;
text-align: center;
margin-bottom: 60px;
}
.home-page-content h4 {
font-size: 18px;
text-align: center;
}
.home-page-content h5 {
font-weight: normal;
font-size: 16px;
text-align: center;
margin-bottom: 60px;
margin-top: 60px;
}
.home-page-content p {
font-weight: normal;
font-size: 16px;
text-align: center;
margin-bottom: 80px;
margin-left: 10vw;
margin-right: 10vw;
}
.profile-img {
margin-right: 20px;
margin-left: 20px;
}
.profile-img img {
width: 300px;
height: auto;
}
figcaption h4 {
font-size: 10px;
padding-bottom: var(--element-padding);
}
.main-article {
padding: var(--content-padding);
width: var(--article-max-width);
line-height: 1.5;
text-align: left;
border-left: var(--border-width) var(--border-style) var(--border-color);
border-right: var(--border-width) var(--border-style) var(--border-color);
}
.main-article h1 {
color: var(--heading1-color);
font-size: var(--heading1-font-size);
}
.main-article h2,
h3 {
margin-bottom: var(--article-margin);
margin-top: var(--heading-margin);
color: var(--heading2-color);
}
.main-article ul,
ol {
margin-bottom: var(--article-margin);
margin-left: var(--article-margin);
}
.main-article li {
margin: 5px;
}
.main-article img {
max-width: 100%;
}
.article-card-flex-container {
margin-left: var(--content-margin);
margin-right: var(--content-margin);
margin-bottom: var(--content-margin);
display: flex;
flex-wrap: wrap;
justify-content: left;
line-height: var(--line-height);
text-align: left;
}
.article-card {
margin: var(--element-margin);
background-color: black;
width: 200px;
min-height: 100%;
border-radius: var(--radius);
transition: background-color 0.3s ease;
text-decoration: none; /* Remove underline */
position: relative;
}
.article-card-text p,
.article-text a {
color: var(--subtext-color);
margin-bottom: var(--element-margin);
}
.article-card-summary h3 {
color: var(--heading3-color);
margin: var(--article-margin);
font-size: 16px;
font-family: Arial, Helvetica, sans-serif;
}
.article-card-summary p {
color: var(--subtext-color);
margin: var(--article-margin);
}
.article-card-info {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.article-card-thumbnail {
max-width: 100%;
border-top-left-radius: var(--radius);
border-top-right-radius: var(--radius);
}
.article-card-author-row {
font-size: 10px;
position: absolute;
bottom: 0;
width: 100%;
margin: var(--element-margin);
}
.article-card:hover {
background-color: var(--summary-container-hover-bg);
}

44
static/css/codeblock.css Normal file
View File

@ -0,0 +1,44 @@
/* Code block */
pre {
overflow-x: auto;
}
.highlight pre {
background: none !important;
}
.codeblock {
position: relative;
background-color: var(--codeblock-bg-color);
width: 100%;
padding: var(--element-padding);
margin-top: 20px;
margin-bottom: 20px;
border-radius: var(--radius);
border: var(--border-width) var(--border-style) var(--border-color);
font-size: var(--code-block-font-size);
}
/* Code block language label */
.codeblock::before {
font-family: var(--code-font-family);
content: attr(data-lang);
position: absolute;
color: var(--heading1-color);
right: 5px;
top: 0px;
font-size: var(--code-block-font-size);
}
code {
font-family: var(--code-font-family);
}
/* Styles for inline <code> */
:not(pre) > code {
color: #aaa4a0;
background-color: var(--inline-code-bg-color);
padding: 5px;
border-radius: 2px;
font-size: var(--code-block-font-size);
}

View File

@ -63,6 +63,22 @@
}
}
/* Style for WebKit browsers (Chrome, Safari, etc.) */
*::-webkit-scrollbar {
height: 5px;
border-radius: 6px;
background: #1f1f28;
}
*::-webkit-scrollbar-thumb {
border-radius: 6px;
background: #585653;
}
*::-webkit-scrollbar-thumb:hover {
background: #454445; /* Background color on hover */
}
body {
font-family: var(--font-family);
background-color: var(--background-color);
@ -70,27 +86,6 @@ body {
color: var(--text-color);
}
.page-container {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.main-content {
flex: 1;
}
.article-container {
display: flex;
justify-content: center;
}
.page-container {
display: flex;
flex-direction: column;
min-height: 100vh;
}
a {
text-decoration: none;
color: var(--link-color);
@ -101,201 +96,11 @@ a:hover {
text-decoration: underline;
}
.page-content {
color: var(--text-color);
padding-top: var(--content-padding);
padding: var(--content-padding);
padding-left: var(--content-padding);
padding-right: var(--content-padding);
max-width: 1000px;
line-height: var(--line-height);
text-align: left;
}
.page-content h1 {
color: var(--heading1-color);
}
.home-page-content {
line-height: 2;
margin-bottom: 30px;
margin-top: 30px;
}
.home-page-content h1 {
text-align: center;
font-size: 32px !important;
margin-bottom: 120px;
}
.home-page-content h3 {
font-weight: normal;
font-size: 28px;
text-align: center;
margin-bottom: 60px;
}
.home-page-content h4 {
font-size: 18px;
text-align: center;
}
.home-page-content h5 {
font-weight: normal;
font-size: 16px;
text-align: center;
margin-bottom: 60px;
margin-top: 60px;
}
.home-page-content p {
font-weight: normal;
font-size: 16px;
text-align: center;
margin-bottom: 80px;
margin-left: 10vw;
margin-right: 10vw;
}
.profile-img {
margin-right: 20px;
margin-left: 20px;
}
.profile-img img {
width: 300px;
height: auto;
}
figcaption h4 {
font-size: 10px;
padding-bottom: var(--element-padding);
}
@media (max-width: 800px) {
.home-page {
flex-direction: column;
align-items: center;
}
.profile-img {
margin-right: 0px;
order: 1;
height: auto;
}
.profile-img img {
width: 200px;
height: auto;
}
.home-page-content {
order: 2;
}
}
.main-article {
padding: var(--content-padding);
width: var(--article-max-width);
line-height: 1.5;
text-align: left;
border-left: var(--border-width) var(--border-style) var(--border-color);
border-right: var(--border-width) var(--border-style) var(--border-color);
}
.main-article h1 {
color: var(--heading1-color);
font-size: var(--heading1-font-size);
}
.main-article h2,
h3 {
margin-bottom: var(--article-margin);
margin-top: var(--heading-margin);
color: var(--heading2-color);
}
.main-article ul,
ol {
margin-bottom: var(--article-margin);
margin-left: var(--article-margin);
}
.main-article li {
margin: 5px;
}
.main-article img {
max-width: 100%;
}
time {
color: var(--subtext-color);
margin-bottom: var(--article-margin);
}
.article-card-flex-container {
margin-left: var(--content-margin);
margin-right: var(--content-margin);
margin-bottom: var(--content-margin);
display: flex;
flex-wrap: wrap;
justify-content: left;
line-height: var(--line-height);
text-align: left;
}
.article-card {
margin: var(--element-margin);
background-color: black;
width: 200px;
min-height: 100%;
border-radius: var(--radius);
transition: background-color 0.3s ease;
text-decoration: none; /* Remove underline */
position: relative;
}
.article-card-text p,
.article-text a {
color: var(--subtext-color);
margin-bottom: var(--element-margin);
}
.article-card-summary h3 {
color: var(--heading3-color);
margin: var(--article-margin);
font-size: 16px;
font-family: Arial, Helvetica, sans-serif;
}
.article-card-summary p {
color: var(--subtext-color);
margin: var(--article-margin);
}
.article-card-info {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.article-card-thumbnail {
max-width: 100%;
border-top-left-radius: var(--radius);
border-top-right-radius: var(--radius);
}
.article-card-author-row {
font-size: 10px;
position: absolute;
bottom: 0;
width: 100%;
margin: var(--element-margin);
}
.article-card:hover {
background-color: var(--summary-container-hover-bg);
}
/* Charts */
.chart-flex-container {
display: flex;
@ -357,136 +162,3 @@ footer a:hover {
.author-row time {
margin: 2px;
}
article p {
margin-bottom: var(--article-margin);
}
article em,
article strong {
color: var(--heading-color);
}
/* table of contents */
#tocWrapper {
margin-bottom: 20px;
}
#TableOfContents li::marker {
content: none;
margin: 0px;
}
#TableOfContents li {
margin: 0px;
}
#TableOfContents a {
font-size: 14px;
}
#TableOfContents ul {
margin: 0px;
}
/* Code block */
pre {
overflow-x: auto;
}
.highlight pre {
background: none !important;
}
/* Style for WebKit browsers (Chrome, Safari, etc.) */
*::-webkit-scrollbar {
height: 5px;
border-radius: 6px;
background: #1f1f28;
}
*::-webkit-scrollbar-thumb {
border-radius: 6px;
background: #585653;
}
*::-webkit-scrollbar-thumb:hover {
background: #454445; /* Background color on hover */
}
.codeblock {
position: relative;
background-color: var(--codeblock-bg-color);
width: 100%;
padding: var(--element-padding);
margin-top: 20px;
margin-bottom: 20px;
border-radius: var(--radius);
border: var(--border-width) var(--border-style) var(--border-color);
font-size: var(--code-block-font-size);
}
/* Code block language label */
.codeblock::before {
content: attr(data-lang);
position: absolute;
color: var(--heading1-color);
right: 5px;
top: 0px;
font-size: var(--code-block-font-size);
}
/* Styles for inline <code> */
:not(pre) > code {
color: #aaa4a0;
background-color: var(--inline-code-bg-color);
padding: 5px;
border-radius: 2px;
font-size: var(--code-block-font-size);
}
#jsonTableContainer {
max-width: 150%;
}
/* Tables */
table {
width: 100%;
border-collapse: collapse;
color: var(--table-font-color);
margin-bottom: var(--article-margin);
}
th {
background-color: var(--table-header-bg);
padding: 5px;
text-align: left;
font-size: var(--table-header-font-size);
}
td {
padding: 5px;
text-align: left;
max-width: 90px;
}
@media only screen and (max-width: 800px) {
#scrollable {
max-width: 90px;
max-height: 100%;
margin: 0;
padding: 0;
overflow: auto;
white-space: nowrap;
}
}
tr:nth-child(even) {
background-color: var(--table-even-row-bg-color);
font-size: var(--table-row-font-size);
}
tr:nth-child(odd) {
background-color: var(--table-odd-row-bg-color);
font-size: var(--table-row-font-size);
}

45
static/css/tables.css Normal file
View File

@ -0,0 +1,45 @@
/* Tables */
#jsonTableContainer {
max-width: 150%;
}
table {
width: 100%;
border-collapse: collapse;
color: var(--table-font-color);
margin-bottom: var(--article-margin);
}
th {
background-color: var(--table-header-bg);
padding: 5px;
text-align: left;
font-size: var(--table-header-font-size);
}
td {
padding: 5px;
text-align: left;
max-width: 90px;
}
@media only screen and (max-width: 800px) {
#scrollable {
max-width: 90px;
max-height: 100%;
margin: 0;
padding: 0;
overflow: auto;
white-space: nowrap;
}
}
tr:nth-child(even) {
background-color: var(--table-even-row-bg-color);
font-size: var(--table-row-font-size);
}
tr:nth-child(odd) {
background-color: var(--table-odd-row-bg-color);
font-size: var(--table-row-font-size);
}

21
static/css/toc.css Normal file
View File

@ -0,0 +1,21 @@
/* table of contents */
#tocWrapper {
margin-bottom: 20px;
}
#TableOfContents li::marker {
content: none;
margin: 0px;
}
#TableOfContents li {
margin: 0px;
}
#TableOfContents a {
font-size: 14px;
}
#TableOfContents ul {
margin: 0px;
}