Relative typography for the dashboard

Signed-off-by: Romein van Buren <romein@vburen.nl>
This commit is contained in:
Romein van Buren 2022-07-12 11:34:04 +02:00
parent 8b922477d9
commit 0ff2202da0
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
3 changed files with 19 additions and 12 deletions

View File

@ -10,22 +10,20 @@
export let weight = 600; export let weight = 600;
</script> </script>
<Tile {title} {subtitle} {color} {date}> <Tile {title} {subtitle} {color} {date} {center}>
<div class="value {color}" class:center style:font-weight={weight}> <div class="value {color}" style:font-weight={weight} class:center>
{value} {value}
</div> </div>
</Tile> </Tile>
<style> <style>
.value { .value {
font-size: 3rem; font-size: 3vw;
font-weight: 600; font-weight: 600;
margin-top: auto;
} }
.value.center { .value.center {
height: 100%; margin: auto 0;
display: flex;
justify-content: center;
align-items: center;
} }
</style> </style>

View File

@ -3,6 +3,7 @@
export let subtitle; export let subtitle;
export let color; export let color;
export let date; export let date;
export let center = false;
</script> </script>
<div class="tile {color}"> <div class="tile {color}">
@ -26,7 +27,7 @@
</div> </div>
{/if} {/if}
<div class="content"><slot /></div> <div class="content" class:center><slot /></div>
</div> </div>
<style> <style>
@ -60,25 +61,33 @@
} }
.desc { .desc {
font-size: 1.3rem;
margin-bottom: 1rem; margin-bottom: 1rem;
display: flex; display: flex;
} }
.desc .title { .desc .title {
font-weight: 300; font-weight: 300;
font-size: 1.7vw;
} }
.desc .subtitle { .desc .subtitle {
font-weight: 100; font-weight: 200;
font-size: 1.5vw;
} }
.desc .time { .desc .time {
opacity: 0.6; opacity: 0.6;
margin-left: auto; margin-left: auto;
font-size: 1.3vw;
} }
.content { .content {
flex-grow: 1; flex-grow: 1;
display: flex;
}
.content.center {
justify-content: center;
align-items: center;
} }
</style> </style>

View File

@ -56,14 +56,14 @@ async function build({ server, settings }) {
}); });
const { output } = await bundle.generate({ const { output } = await bundle.generate({
sourcemap: true, sourcemap: false,
format: 'iife', format: 'iife',
name: 'app', name: 'app',
file: 'public/build/bundle.js', file: 'public/build/bundle.js',
}); });
return { return {
map: output[0].map.toUrl(), map: output[0].map ? output[0].map.toUrl() : '',
code: output[0].code, code: output[0].code,
css: cssOutput.css, css: cssOutput.css,
}; };