Skip to content

Commit efda2fe

Browse files
authored
Update dashboard styling to be more RMI-like (#177)
* Update dashboard layout colours * Style * Use Roboto font * Update plot colours * Style * Update warning styles
1 parent 837dfb5 commit efda2fe

File tree

10 files changed

+96
-76
lines changed

10 files changed

+96
-76
lines changed

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"type": "module",
7171
"dependencies": {
7272
"@floating-ui/dom": "^1.6.7",
73+
"@fontsource/roboto": "^5.1.1",
7374
"@fortawesome/fontawesome-free": "^6.7.1",
7475
"d3": "^5.16.0",
7576
"d3-array": "^3.2.4",

src/app.postcss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ body {
1818
width: 100%;
1919
background-color: rgb(var(--color-surface-100));
2020
}
21+
22+
:root [data-theme='rmi_theme'] {
23+
--theme-font-family-base: 'Roboto', sans-serif;
24+
--theme-font-family-heading: 'Roboto', sans-serif;
25+
}

src/css/plot_styles.css

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/* src/css/plot_styles.css */
22

3+
strong {
4+
font-weight: 700;
5+
}
6+
37
.d3chart > style {
48
display: none;
59
}
@@ -94,7 +98,7 @@
9498
/* styles for interactive charts ****************/
9599

96100
div.d3chart {
97-
font-family: sans-serif;
101+
font-family: 'Roboto', sans-serif;
98102
font-size: 0.9em;
99103
width: 100%;
100104
max-width: 1400px;
@@ -103,34 +107,34 @@ div.d3chart {
103107
}
104108

105109
div.d3chart .chart_title {
106-
font-family: sans-serif;
110+
font-family: 'Roboto', sans-serif;
107111
font-size: 1em;
108112
text-align: center;
109113
}
110114

111115
div.d3chart .chart_filters {
112-
font-family: sans-serif;
116+
font-family: 'Roboto', sans-serif;
113117
font-size: 0.9em;
114118
text-align: center;
115119
margin: 10px;
116120
}
117121

118122
div.d3chart .chart_caption {
119-
font-family: sans-serif;
123+
font-family: 'Roboto', sans-serif;
120124
font-size: 0.8em;
121125
text-align: center;
122126
}
123127

124128
div.d3chart .chart_source {
125-
font-family: sans-serif;
129+
font-family: 'Roboto', sans-serif;
126130
font-size: 0.7em;
127131
font-style: italic;
128132
padding-top: 5px;
129133
}
130134

131135
div.d3chart svg {
132136
/* border: 1px dashed; */
133-
background-color: #d9e2e8;
137+
background-color: #ffffff;
134138
}
135139

136140
div.d3chart > * {
@@ -140,18 +144,18 @@ div.d3chart > * {
140144

141145
div.d3chart div.d3tooltip {
142146
opacity: 0.9;
143-
background-color: #d9e2e8;
147+
background-color: #ffffff;
144148
color: black;
145149
border-radius: 4px;
146150
padding: 10px;
147151
border: 1px solid;
148-
font-family: sans-serif;
152+
font-family: 'Roboto', sans-serif;
149153
/* position: absolute; */
150154
position: fixed; /* position must be fixed to work in Gitbook */
151155
}
152156

153157
div.d3chart svg text {
154-
font-family: sans-serif;
158+
font-family: 'Roboto', sans-serif;
155159
}
156160

157161
div.d3chart.tech_exposure {
@@ -176,11 +180,11 @@ div.d3chart .axis {
176180

177181
/* axis color */
178182
div.d3chart path.domain {
179-
stroke: #99b1c1;
183+
stroke: #93aec6;
180184
}
181185

182186
div.d3chart .tick line {
183-
stroke: #99b1c1;
187+
stroke: #93aec6;
184188
}
185189

186190
/* d3 data_table styling */
@@ -190,7 +194,7 @@ div.d3chart.data_table th,
190194
div.d3chart.data_table td {
191195
border-collapse: collapse;
192196
padding: 8px;
193-
border-bottom: 1px solid #aaa;
197+
border-bottom: 1px solid #93aec6;
194198
border-bottom: none !important;
195199
text-align: center;
196200
font-size: 1em;
@@ -210,7 +214,7 @@ div.d3chart.included_table {
210214

211215
div.d3chart.included_table table thead tr {
212216
border-top: none !important;
213-
border-bottom: 2px solid #99b1c1 !important;
217+
border-bottom: 1px solid #93aec6 !important;
214218
}
215219

216220
div.d3chart.included_table table,
@@ -225,13 +229,13 @@ div.d3chart.included_table tr {
225229
}
226230

227231
div.d3chart.included_table table tr.summary_row {
228-
border-top: 1px solid #99b1c1 !important;
232+
border-top: 1px solid #93aec6 !important;
229233
border-bottom: none !important;
230234
}
231235

232236
div.d3chart.included_table table td.column_left_border,
233237
div.d3chart.included_table table th.column_left_border {
234-
border-left: 1px solid #99b1c1 !important;
238+
border-left: 1px solid #93aec6 !important;
235239
}
236240

237241
/* sectors color palette */

src/js/createErrorMessageDiv.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ export function createErrorMessageDiv() {
22
let errorMessageDiv = document.createElement('div');
33
errorMessageDiv.setAttribute('role', 'alert');
44
let errorTitle = document.createElement('div');
5-
errorTitle.classList = 'bg-red-500 text-white font-bold rounded-t px-4 py-2';
5+
errorTitle.classList = 'bg-error-500 text-white font-bold rounded-t px-4 py-2';
66
errorTitle.appendChild(document.createTextNode('Something went wrong'));
77
let errorMessage = document.createElement('div');
88
errorMessage.classList =
9-
'border border-t-0 border-red-400 rounded-b bg-red-100 px-4 py-3 text-red-700';
9+
'border border-t-0 border-error-400 rounded-b bg-error-100 px-4 py-3 text-error-700';
1010
errorMessage.appendChild(
1111
document.createTextNode('An error occurred while generating this plot.')
1212
);

src/js/pie_exploded.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class PieExploded {
139139
.attr('class', (d) => (d.data.exploded ? d.data.key : 'non-PACTA'))
140140
.attr('d', arc)
141141
.attr('fill', (d) => (d.data.exploded ? color(d.data.key) : greys(d.data.key)))
142-
.attr('stroke', '#d9e2e8')
142+
.attr('stroke', '#ffffff')
143143
.style('stroke-width', '2px')
144144
.style('opacity', 1)
145145
.on('mouseover', mouseover)

src/rmi_theme.ts

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ export const rmi_theme: CustomThemeConfig = {
1313
'--theme-border-base': '1px',
1414
// =~= Theme On-X Colors =~=
1515
'--on-primary': '0 0 0',
16-
'--on-secondary': '255 255 255',
17-
'--on-tertiary': '255 255 255',
16+
'--on-secondary': '0 0 0',
17+
'--on-tertiary': '0 0 0',
1818
'--on-success': '0 0 0',
1919
'--on-warning': '0 0 0',
20-
'--on-error': '0 0 0',
20+
'--on-error': '255 255 255',
2121
'--on-surface': '255 255 255',
2222
// =~= Theme Colors =~=
2323
// primary | #45CFCC
@@ -31,39 +31,39 @@ export const rmi_theme: CustomThemeConfig = {
3131
'--color-primary-700': '52 155 153', // #349b99
3232
'--color-primary-800': '41 124 122', // #297c7a
3333
'--color-primary-900': '34 101 100', // #226564
34-
// secondary | #58595B
35-
'--color-secondary-50': '230 230 230', // #e6e6e6
36-
'--color-secondary-100': '222 222 222', // #dedede
37-
'--color-secondary-200': '213 214 214', // #d5d6d6
38-
'--color-secondary-300': '188 189 189', // #bcbdbd
39-
'--color-secondary-400': '138 139 140', // #8a8b8c
40-
'--color-secondary-500': '88 89 91', // #58595B
41-
'--color-secondary-600': '79 80 82', // #4f5052
42-
'--color-secondary-700': '66 67 68', // #424344
43-
'--color-secondary-800': '53 53 55', // #353537
44-
'--color-secondary-900': '43 44 45', // #2b2c2d
45-
// tertiary | #FFFFFF
46-
'--color-tertiary-50': '255 255 255', // #ffffff
47-
'--color-tertiary-100': '255 255 255', // #ffffff
48-
'--color-tertiary-200': '255 255 255', // #ffffff
49-
'--color-tertiary-300': '255 255 255', // #ffffff
50-
'--color-tertiary-400': '255 255 255', // #ffffff
51-
'--color-tertiary-500': '255 255 255', // #FFFFFF
52-
'--color-tertiary-600': '230 230 230', // #e6e6e6
53-
'--color-tertiary-700': '191 191 191', // #bfbfbf
54-
'--color-tertiary-800': '153 153 153', // #999999
55-
'--color-tertiary-900': '125 125 125', // #7d7d7d
56-
// success | #99b083
57-
'--color-success-50': '240 243 236', // #f0f3ec
58-
'--color-success-100': '235 239 230', // #ebefe6
59-
'--color-success-200': '230 235 224', // #e6ebe0
60-
'--color-success-300': '214 223 205', // #d6dfcd
61-
'--color-success-400': '184 200 168', // #b8c8a8
62-
'--color-success-500': '153 176 131', // #99b083
63-
'--color-success-600': '138 158 118', // #8a9e76
64-
'--color-success-700': '115 132 98', // #738462
65-
'--color-success-800': '92 106 79', // #5c6a4f
66-
'--color-success-900': '75 86 64', // #4b5640
34+
// secondary | #93aec6
35+
'--color-secondary-50': '239 243 246', // #eff3f6
36+
'--color-secondary-100': '233 239 244', // #e9eff4
37+
'--color-secondary-200': '228 235 241', // #e4ebf1
38+
'--color-secondary-300': '212 223 232', // #d4dfe8
39+
'--color-secondary-400': '179 198 215', // #b3c6d7
40+
'--color-secondary-500': '147 174 198', // #93aec6
41+
'--color-secondary-600': '132 157 178', // #849db2
42+
'--color-secondary-700': '110 131 149', // #6e8395
43+
'--color-secondary-800': '88 104 119', // #586877
44+
'--color-secondary-900': '72 85 97', // #485561
45+
// tertiary | #768B9E
46+
'--color-tertiary-50': '234 238 240', // #eaeef0
47+
'--color-tertiary-100': '228 232 236', // #e4e8ec
48+
'--color-tertiary-200': '221 226 231', // #dde2e7
49+
'--color-tertiary-300': '200 209 216', // #c8d1d8
50+
'--color-tertiary-400': '159 174 187', // #9faebb
51+
'--color-tertiary-500': '118 139 158', // #768B9E
52+
'--color-tertiary-600': '106 125 142', // #6a7d8e
53+
'--color-tertiary-700': '89 104 119', // #596877
54+
'--color-tertiary-800': '71 83 95', // #47535f
55+
'--color-tertiary-900': '58 68 77', // #3a444d
56+
// success | #00994D
57+
'--color-success-50': '217 240 228', // #d9f0e4
58+
'--color-success-100': '204 235 219', // #ccebdb
59+
'--color-success-200': '191 230 211', // #bfe6d3
60+
'--color-success-300': '153 214 184', // #99d6b8
61+
'--color-success-400': '77 184 130', // #4db882
62+
'--color-success-500': '0 153 77', // #00994D
63+
'--color-success-600': '0 138 69', // #008a45
64+
'--color-success-700': '0 115 58', // #00733a
65+
'--color-success-800': '0 92 46', // #005c2e
66+
'--color-success-900': '0 75 38', // #004b26
6767
// warning | #ffe480
6868
'--color-warning-50': '255 251 236', // #fffbec
6969
'--color-warning-100': '255 250 230', // #fffae6
@@ -75,23 +75,23 @@ export const rmi_theme: CustomThemeConfig = {
7575
'--color-warning-700': '191 171 96', // #bfab60
7676
'--color-warning-800': '153 137 77', // #99894d
7777
'--color-warning-900': '125 112 63', // #7d703f
78-
// error | #df897b
79-
'--color-error-50': '250 237 235', // #faedeb
80-
'--color-error-100': '249 231 229', // #f9e7e5
81-
'--color-error-200': '247 226 222', // #f7e2de
82-
'--color-error-300': '242 208 202', // #f2d0ca
83-
'--color-error-400': '233 172 163', // #e9aca3
84-
'--color-error-500': '223 137 123', // #df897b
85-
'--color-error-600': '201 123 111', // #c97b6f
86-
'--color-error-700': '167 103 92', // #a7675c
87-
'--color-error-800': '134 82 74', // #86524a
88-
'--color-error-900': '109 67 60', // #6d433c
78+
// error | #AB3C2C
79+
'--color-error-50': '242 226 223', // #f2e2df
80+
'--color-error-100': '238 216 213', // #eed8d5
81+
'--color-error-200': '234 206 202', // #eaceca
82+
'--color-error-300': '221 177 171', // #ddb1ab
83+
'--color-error-400': '196 119 107', // #c4776b
84+
'--color-error-500': '171 60 44', // #AB3C2C
85+
'--color-error-600': '154 54 40', // #9a3628
86+
'--color-error-700': '128 45 33', // #802d21
87+
'--color-error-800': '103 36 26', // #67241a
88+
'--color-error-900': '84 29 22', // #541d16
8989
// surface | #003B63
90-
'--color-surface-50': '217 226 232', // #d9e2e8
91-
'--color-surface-100': '204 216 224', // #ccd8e0
92-
'--color-surface-200': '191 206 216', // #bfced8
93-
'--color-surface-300': '153 177 193', // #99b1c1
94-
'--color-surface-400': '77 118 146', // #4d7692
90+
'--color-surface-50': '255 255 255', // #ffffff
91+
'--color-surface-100': '255 255 255', // #ffffff
92+
'--color-surface-200': '244 247 249', // #f4f7f9
93+
'--color-surface-300': '153 177 193', // #e9eff4
94+
'--color-surface-400': '77 118 146', // #dfe7ee
9595
'--color-surface-500': '0 59 99', // #003B63
9696
'--color-surface-600': '0 53 89', // #003559
9797
'--color-surface-700': '0 44 74', // #002c4a

src/routes/+layout.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
import { storePopup } from '@skeletonlabs/skeleton';
2323
storePopup.set({ computePosition, autoUpdate, flip, shift, offset, arrow });
2424
25+
//fonts
26+
import '@fontsource/roboto/400.css';
27+
import '@fontsource/roboto/700.css';
28+
2529
async function downloadArchive() {
2630
try {
2731
const response = await fetch('data/archive.zip');

src/routes/company_view.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@
365365
<select class="select max-w-48 variant-outline-surface" id="asset_class_selector_landing">
366366
<option value="Not_selected">Please select</option>
367367
</select>
368-
<button class="btn variant-filled-surface" id="go_button_landing">Go!</button>
368+
<button class="btn variant-filled-secondary" id="go_button_landing">Go!</button>
369369
</div>
370370
</div>
371371
</div>
@@ -473,7 +473,7 @@
473473
</div>
474474
</div>
475475
<div
476-
class="alert-message sm:col-span-10 bg-blue-100 border-t border-b border-blue-500 text-blue-700 px-4 py-3 hidden"
476+
class="alert-message sm:col-span-10 bg-warning-300 border-t border-b border-warning-700 text-warning-900 px-4 py-3 hidden"
477477
role="alert"
478478
id="alert-message-parameters"
479479
>
@@ -512,7 +512,7 @@
512512
</div>
513513

514514
<div
515-
class="alert-message bg-blue-100 border-t border-b border-blue-500 text-blue-700 px-4 py-3 hidden"
515+
class="alert-message bg-warning-300 border-t border-b border-warning-700 text-warning-900 px-4 py-3 hidden"
516516
role="alert"
517517
id="alert-message"
518518
>

src/routes/sector_view.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@
435435
<select class="select max-w-48 variant-outline-surface" id="asset_class_selector_landing">
436436
<option value="Not_selected">Please select</option>
437437
</select>
438-
<button class="btn variant-filled-surface" id="go_button_landing">Go!</button>
438+
<button class="btn variant-filled-secondary" id="go_button_landing">Go!</button>
439439
</div>
440440
</div>
441441
</div>
@@ -580,7 +580,7 @@
580580
</div>
581581
</div>
582582
<div
583-
class="alert-message sm:col-span-10 bg-blue-100 border-t border-b border-blue-500 text-blue-700 px-4 py-3 hidden"
583+
class="alert-message sm:col-span-10 bg-warning-300 border-t border-b border-warning-700 text-warning-900 px-4 py-3 hidden"
584584
role="alert"
585585
id="alert-message-parameters"
586586
>
@@ -646,7 +646,7 @@
646646
</div>
647647

648648
<div
649-
class="alert-message bg-blue-100 border-t border-b border-blue-500 text-blue-700 px-4 py-3 hidden"
649+
class="alert-message bg-warning-300 border-t border-b border-warning-700 text-warning-900 px-4 py-3 hidden"
650650
role="alert"
651651
id="alert-message"
652652
>

0 commit comments

Comments
 (0)