Skip to content

Commit 2d976bc

Browse files
authored
[Enhancements] Update styling (#7)
- Adds updated styling via `custom.scss` and `_brand.yml` - Adds an empty `references.bib`, so that rendering without adding any citations doesn't raise errors. - Notable visual changes to HTML output: - Adds table of contents, by default, to the left side of the document, removing visuals due to "active" (they don't appear to work without some extra JS?) - Adds more emphasis to source code - Adds a border and heading indicating code output - Adds dark mode, toggle - Adds more rules to tables, emphasis to table headings, and adds a bit of color
1 parent 5f67ca2 commit 2d976bc

File tree

5 files changed

+169
-1
lines changed

5 files changed

+169
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ po/*~
6060

6161
# RStudio Connect folder
6262
rsconnect/
63+
64+
/.quarto/
65+
**/*.quarto_ipynb

_brand.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
color:
2+
palette:
3+
cyan: "#3D9BE9"
4+
pink: "#F0325F"
5+
blue: "#003771"
6+
background:
7+
light: white
8+
dark: black
9+
foreground:
10+
light: black
11+
dark: "#ccc"
12+
primary: blue
13+
14+
typography:
15+
fonts:
16+
- family: "Red Hat Display"
17+
source: google
18+
- family: "Merriweather Sans"
19+
source: google
20+
base: "Red Hat Display"
21+
headings:
22+
family: "Merriweather Sans"
23+
color:
24+
light: blue
25+
dark: cyan

_quarto.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ execute:
88
freeze: auto
99

1010
format:
11-
html: default
11+
html:
12+
toc: true
13+
toc-location: left
14+
theme:
15+
light:
16+
- ./custom.scss
17+
dark:
18+
- darkly
19+
- ./custom.scss
1220
pdf:
1321
margin-left: 20mm
1422
margin-top: 30mm

custom.scss

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
/*-- scss:uses --*/
2+
3+
/*-- scss:functions --*/
4+
5+
/*-- scss:defaults --*/
6+
7+
// fonts
8+
$font-family-sans-serif: "Helvetica", "Red Hat Display", sans-serif !default;
9+
$font-family-monospace: "Courier New", "Consolas", monospace !default;
10+
11+
$headings-font-weight: 500 !default;
12+
13+
// colors
14+
// custom variables
15+
$syndemics-blue: #003771;
16+
$syndemics-pink: #f0325f;
17+
$syndemics-cyan: #3d9be9;
18+
$background-light: #cccccc;
19+
$background-dark: #444444;
20+
21+
// default colors
22+
$primary: $syndemics-blue !default;
23+
$secondary: $syndemics-cyan !default;
24+
$light: $background-light !default;
25+
$dark: $background-dark !default;
26+
27+
// options
28+
$enable-rounded: true !default;
29+
30+
/*-- scss:mixins --*/
31+
32+
/*-- scss:rules --*/
33+
34+
:root {
35+
--bs-heading-color-light: #003771;
36+
--bs-heading-color-dark: #3d9be9;
37+
}
38+
39+
body.quarto-light {
40+
--bs-link-hover-color-rgb: #{colorToRGBA(#3d9be9)};
41+
h1,.h1,h2,.h2 {
42+
color: var(--bs-heading-color-light);
43+
}
44+
}
45+
46+
body.quarto-dark {
47+
--bs-link-color-rgb: #{colorToRGBA(#f0325f)};
48+
--bs-link-hover-color-rgb: #{colorToRGBA(#3d9be9)};
49+
h1,.h1,h2,.h2 {
50+
color: var(--bs-heading-color-dark);
51+
}
52+
}
53+
54+
h1.title,.title.h1 {
55+
font-size: calc(1.5rem + 0.9vw);
56+
}
57+
58+
#TOC {
59+
font-weight: 600;
60+
61+
#toc-title {
62+
font-weight: inherit;
63+
}
64+
65+
.header-section-number {
66+
color: var(--bs-body-color) !important;
67+
&:after {
68+
content: "";
69+
}
70+
}
71+
72+
.nav-link:not(:hover) {
73+
color: inherit !important;
74+
border-left: solid 1px var(--bs-body-color);
75+
transition: color 0.5s;
76+
}
77+
78+
.nav-link:hover {
79+
color: var(--quarto-scss-export-syndemics-pink) !important;
80+
border-left: solid 1px var(--quarto-scss-export-syndemics-pink);
81+
}
82+
}
83+
84+
.quarto-alternate-formats h2 {
85+
font-weight: 600 !important;
86+
}
87+
88+
.table {
89+
& > tbody {
90+
border: 2px solid;
91+
}
92+
93+
& col:not(:last-of-type) {
94+
border-right: 2px solid;
95+
}
96+
97+
& tr:first-of-type {
98+
background-color: var(--bs-heading-color-dark);
99+
font-weight: 600;
100+
border-bottom: 2px solid;
101+
border-color: inherit;
102+
103+
& td {
104+
color: black;
105+
}
106+
}
107+
}
108+
109+
pre code {
110+
font-weight: 600;
111+
}
112+
113+
pre:not(.sourceCode) {
114+
border: 1px #ccc solid;
115+
border-radius: 5px;
116+
overflow: visible;
117+
118+
&:before {
119+
position: relative;
120+
top: -0.8em;
121+
left: 0.5em;
122+
background: var(--bs-body-bg);
123+
font-family: sans-serif;
124+
font-weight: 600;
125+
content: " Output ";
126+
}
127+
128+
& code {
129+
margin-top: -1.2em;
130+
margin-left: 0.5em;
131+
}
132+
}

references.bib

Whitespace-only changes.

0 commit comments

Comments
 (0)