prettifying

This commit is contained in:
Yanick Champoux 2020-07-28 14:38:40 -04:00
parent e87c9a5ae4
commit afe2c3bef5
5 changed files with 40 additions and 9 deletions

View File

@ -3,6 +3,7 @@
<input class="reset" type="button" value="reset" on:click={reset} /> <input class="reset" type="button" value="reset" on:click={reset} />
<ShipSpecs /> <ShipSpecs />
<Propulsion <Propulsion
ftl={$ship.ftl} ftl={$ship.ftl}
engine={$ship.engine} engine={$ship.engine}
@ -99,7 +100,7 @@
main { main {
display: grid; display: grid;
width: 60em; width: 60em;
grid-template-columns: 4fr 1fr 1fr; grid-template-columns: 1fr 14em 8em;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }

View File

@ -14,6 +14,12 @@
</script> </script>
<style> <style>
div > :global(*) {
margin-left: 1em;
}
div > label {
margin-left: 0em;
}
label { label {
font-size: var(--font-scale-8); font-size: var(--font-scale-8);
font-weight: lighter; font-weight: lighter;

View File

@ -1,8 +1,23 @@
<fieldset> <div>
<legend>{label}</legend> <h2>{label}</h2>
<slot /> <hr/>
</fieldset> </div>
<slot />
<script> <script>
export let label; export let label;
</script> </script>
<style>
div {
display: flex;
grid-column: 1 / span 3 !important;
align-items: baseline;
gap: 1em;
}
hr {
flex: 1;
heigth: 0px;
}
</style>

View File

@ -1,9 +1,7 @@
<div class="ship-item"> <div><slot /></div>
<slot />
<div class="mass" bind:this={mass_el}>{ mass }</div> <div class="mass" bind:this={mass_el}>{ mass }</div>
<div class="cost" bind:this={cost_el}>{ cost }</div> <div class="cost" bind:this={cost_el}>{ cost }</div>
</div>
<script> <script>
import { tick } from 'svelte'; import { tick } from 'svelte';
@ -27,6 +25,14 @@
</script> </script>
<style> <style>
div {
margin-bottom: 1em;
}
.cost,.mass { padding: 0px 2em; text-align: right; }
.cost { grid-column: 3 }
.mass { grid-column: 2 }
.ship-item { .ship-item {
display: flex; display: flex;
} }
@ -35,7 +41,6 @@
flex: 1; flex: 1;
} }
.cost,.mass { width: 4em; flex: inherit; }
img { img {
width: 0.75em; width: 0.75em;
} }

View File

@ -60,6 +60,10 @@
font-size: smaller; font-size: smaller;
} }
.mass,div.cost {
padding: 0px 2em; justify-self: right;
}
.mass { .mass {
grid-column: 2; grid-column: 2;
} }