Style improvements website (#138)

* Improve general CSS for website

* Update github flow
This commit is contained in:
Hendrik Kleinwaechter
2023-07-07 13:38:56 +02:00
committed by GitHub
parent cc96559b6b
commit 62a9e9a000
3 changed files with 87 additions and 71 deletions

View File

@@ -19,7 +19,6 @@ jobs:
mv kindlegen /usr/bin mv kindlegen /usr/bin
cd book cd book
make bake make bake
make website
- name: Release baked book to S3 - name: Release baked book to S3
uses: shallwefootball/s3-upload-action@master uses: shallwefootball/s3-upload-action@master
with: with:
@@ -28,7 +27,13 @@ jobs:
aws_bucket: ${{ secrets.AWS_BUCKET_BOOK }} aws_bucket: ${{ secrets.AWS_BUCKET_BOOK }}
source_dir: book/release source_dir: book/release
destination_dir: release destination_dir: release
- name: Release website - name: Bake the website
uses: xu-cheng/texlive-action/full@v1
with:
run: |
apk add make zip tidyhtml
make website
- name: Release baked website to S3
uses: shallwefootball/s3-upload-action@master uses: shallwefootball/s3-upload-action@master
with: with:
aws_key_id: ${{ secrets.AWS_KEY_ID }} aws_key_id: ${{ secrets.AWS_KEY_ID }}

View File

@@ -229,8 +229,6 @@ website:
mv $(WEBSITE_DIR)/book.html $(WEBSITE_DIR)/index.html mv $(WEBSITE_DIR)/book.html $(WEBSITE_DIR)/index.html
sed -r -i -e 's|<title></title>|<title>The Sourdough Framework</title>|g' $(WEBSITE_DIR)/index.html sed -r -i -e 's|<title></title>|<title>The Sourdough Framework</title>|g' $(WEBSITE_DIR)/index.html
# Debug Stuff from now on # Debug Stuff from now on
.PHONY: show_tools_version .PHONY: show_tools_version
show_tools_version: # Show version of tools used on the build machine show_tools_version: # Show version of tools used on the build machine

View File

@@ -1,25 +1,15 @@
/* @import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;700;900&family=Ubuntu+Mono&display=swap');
Color scheme
#bab5a9;
#d5e3c6
*/
/* ************** */
/* *** Fonts *** */
/* ************** */
/* Font size tricks from https://www.madebymike.com.au/writing/precise-control-responsive-typography/
* The font size will be adjusted to the screen size.
* */
:root{ :root{
font-size: 16px; --ff-sans: 'Raleway', sans-serif;
--ff-mono: 'Ubuntu Mono', monospace;
--fw-regular: 400;
--fw-medium: 500;
--fw-bold: 700;
--fw-black: 900;
--f-lh: 28px;
} }
/* the min width is calculated as:
* font-size / ( number of viewport units / 100 )
* it means 16 / (1.5/100)
*/
@media (min-width: 1200px){ @media (min-width: 1200px){
:root { :root {
font-size: 1.5vw; font-size: 1.5vw;
@@ -39,11 +29,11 @@ Color scheme
/* ************** */ /* ************** */
body{ body{
/* max-width:52rem; */
margin:0; margin:0;
padding:0; padding:0;
/* display:grid; */ font-family: var(--ff-sans);
/* grid-auto-rows: auto; */ font-weight: var(--fw-medium);
font-size: 16px;
} }
@media screen and (min-width: 57rem) { @media screen and (min-width: 57rem) {
@@ -81,7 +71,6 @@ figure pre.listings{font-size: 1em;}
.chapterToc, .sectionToc, .subsectionToc{margin:0;padding:0;} .chapterToc, .sectionToc, .subsectionToc{margin:0;padding:0;}
nav.TOC{ nav.TOC{
padding:0.5rem;
font-size:0; /* trick to remove vertical space above TOC entries */ font-size:0; /* trick to remove vertical space above TOC entries */
} }
@@ -92,6 +81,46 @@ nav.TOC span{
display:block; display:block;
margin-top:0; margin-top:0;
font-size:0.8rem; font-size:0.8rem;
padding:0.5rem;
display: flex;
justify-content: flex-start;
}
/* HACKZS since table of contents number is not in HTML Tag */
/* nav.TOC span {
letter-spacing: 10px;
}
nav.TOC span a {
letter-spacing: normal;
flex-grow: 1;
}
nav.TOC span.sectionToc {
letter-spacing: normal;
}
nav.TOC span.sectionToc a {
margin-left: 10px;
}
nav.TOC span.subsectionToc {
letter-spacing: normal;
}
nav.TOC span.subsectionToc a {
margin-left: 10px;
}
/* END HACKZS */
nav.TOC span a {
flex-grow: 1;
}
nav.TOC span a:only-child {
margin-left: 10px;
} }
nav.TOC a, nav.TOC a:visited{ nav.TOC a, nav.TOC a:visited{
@@ -103,64 +132,48 @@ nav.TOC a, nav.TOC a:visited{
/* ************** */ /* ************** */
/* body{background-color:#dce8d0;} */ body{
/* It seems that dark background is better to my eyes */ background-color:#F5F2EF;
body{background-color:#B8CDA3;} }
a {
color: #5D9FF0;
}
main.main-content, div.footnotes, main.titlepage{ main.main-content, div.footnotes, main.titlepage{
background-color:white; background-color:white;
} }
nav.TOC,nav.TOC a, nav.TOC a:visited{ nav.TOC,nav.TOC a, nav.TOC a:visited{
background-color:#22211f; background-color:#F5F2EF;
color:#cec1aa; color:#000000;
} }
nav.TOC span:hover, nav.TOC span:hover *{ nav.TOC span:hover, nav.TOC span:hover *{
background-color:#66635d; background-color:#dad5ca;
} }
figure.texsource, figure.shellcommand, figure.htmlsource, figure.luasource, figure.textsource{ figure.texsource, figure.shellcommand, figure.htmlsource, figure.luasource, figure.textsource{
border:1px solid #cec1aa; border:1px solid #cec1aa;
background-color:#d5e3c6; background-color:#d5e3c6;
} }
/* ***************** */ .main-content {
/* *** Dark mode *** */ line-height: var(--f-lh);
/* ***************** */
/* Code from https://ar.al/2021/08/24/implementing-dark-mode-in-a-handful-of-lines-of-css-with-css-filters/ */
@media (prefers-color-scheme: dark) {
/* Invert all elements on the body while attempting to not alter the hue substantially. */
body {
filter: invert(100%) hue-rotate(180deg);
} }
/* Workarounds and optical adjustments. */ div.footnotes {
border: none;
/* Firefox workaround: Set the background colour for the html
element separately because, unlike other browsers, Firefox
doesnt apply the filter to the root elements background. */
html {
background-color: #111;
} }
/* Do not invert media (revert the invert). */ .footnote-mark {
img, video, iframe { margin-right: 3px;
filter: invert(100%) hue-rotate(180deg);
} }
table.tabular {
/* Re-enable code block backgrounds. */ width: 100%;
pre {
filter: invert(6%);
} }
/* Improve contrast on list item markers. */ .chapterHead .titlemark {
li::marker { display: block;
color: #666;
}
} }