add some ✨ reactivity ✨
This commit is contained in:
parent
fe46c54496
commit
4d6cdf8f78
@ -1,4 +1,8 @@
|
|||||||
<textarea></textarea>
|
<script lang="ts">
|
||||||
|
export let code: string;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<textarea bind:value={code}></textarea>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
textarea {
|
textarea {
|
||||||
|
@ -4,6 +4,9 @@
|
|||||||
import Headline from '$lib/components/headline.svelte';
|
import Headline from '$lib/components/headline.svelte';
|
||||||
import NavItem from '$lib/components/nav-item.svelte';
|
import NavItem from '$lib/components/nav-item.svelte';
|
||||||
import NavTree from '$lib/components/nav-tree.svelte';
|
import NavTree from '$lib/components/nav-tree.svelte';
|
||||||
|
|
||||||
|
let markdown: string = '';
|
||||||
|
let stylesheet: string = '';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
@ -20,18 +23,30 @@
|
|||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
<Content pane="content">
|
<Content pane="content">
|
||||||
<CodeInput />
|
<CodeInput bind:code={markdown} />
|
||||||
</Content>
|
</Content>
|
||||||
<Content pane="style">
|
<Content pane="style">
|
||||||
<CodeInput />
|
<CodeInput bind:code={stylesheet} />
|
||||||
</Content>
|
</Content>
|
||||||
<Content pane="preview">
|
<Content pane="preview">
|
||||||
<p>preview</p>
|
<dl>
|
||||||
|
<dt>markdown:</dt>
|
||||||
|
<dd>{markdown !== '' ? markdown : '???'}</dd>
|
||||||
|
<dt>stylesheet:</dt>
|
||||||
|
<dd>{stylesheet !== '' ? stylesheet : '???'}</dd>
|
||||||
|
</dl>
|
||||||
</Content>
|
</Content>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
// util
|
||||||
|
.margin-v(@v) {
|
||||||
|
margin-bottom: @v;
|
||||||
|
margin-top: @v;
|
||||||
|
}
|
||||||
|
|
||||||
|
// styles
|
||||||
div {
|
div {
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -40,12 +55,16 @@
|
|||||||
justify-content: start;
|
justify-content: start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dd {
|
||||||
|
.margin-v(@padding-lg-y);
|
||||||
|
}
|
||||||
|
|
||||||
|
dl {
|
||||||
|
margin: 0;
|
||||||
|
padding: @padding-xl;
|
||||||
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
|
||||||
margin: 0;
|
|
||||||
padding: @padding-md;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user