1
0

add some reactivity

This commit is contained in:
Nicola Clark 2024-10-11 22:45:07 -05:00
parent fe46c54496
commit 4d6cdf8f78
Signed by: nicola
GPG Key ID: 3E1710E7FF08956C
2 changed files with 32 additions and 9 deletions

View File

@ -1,4 +1,8 @@
<textarea></textarea>
<script lang="ts">
export let code: string;
</script>
<textarea bind:value={code}></textarea>
<style lang="less">
textarea {

View File

@ -4,6 +4,9 @@
import Headline from '$lib/components/headline.svelte';
import NavItem from '$lib/components/nav-item.svelte';
import NavTree from '$lib/components/nav-tree.svelte';
let markdown: string = '';
let stylesheet: string = '';
</script>
<svelte:head>
@ -20,18 +23,30 @@
</header>
<main>
<Content pane="content">
<CodeInput />
<CodeInput bind:code={markdown} />
</Content>
<Content pane="style">
<CodeInput />
<CodeInput bind:code={stylesheet} />
</Content>
<Content pane="preview">
<p>preview</p>
<dl>
<dt>markdown:</dt>
<dd>{markdown !== '' ? markdown : '???'}</dd>
<dt>stylesheet:</dt>
<dd>{stylesheet !== '' ? stylesheet : '???'}</dd>
</dl>
</Content>
</main>
</div>
<style lang="less">
// util
.margin-v(@v) {
margin-bottom: @v;
margin-top: @v;
}
// styles
div {
align-items: stretch;
display: flex;
@ -40,12 +55,16 @@
justify-content: start;
}
dd {
.margin-v(@padding-lg-y);
}
dl {
margin: 0;
padding: @padding-xl;
}
main {
flex-grow: 1;
}
p {
margin: 0;
padding: @padding-md;
}
</style>