add code input component
this involved some refactoring of styles
This commit is contained in:
parent
0a20db91ac
commit
2f2bac9351
@ -1,7 +1,11 @@
|
|||||||
@import 'vars.less';
|
@import 'styles.less';
|
||||||
|
|
||||||
@import (css) url('https://fonts.googleapis.com/css2?family=Rubik:wght@400..700&display=swap');
|
@import (css) url('https://fonts.googleapis.com/css2?family=Rubik:wght@400..700&display=swap');
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: @fonts-sans;
|
font-family: @fonts-sans;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
11
src/lib/components/code-input.svelte
Normal file
11
src/lib/components/code-input.svelte
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<textarea></textarea>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
textarea {
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: .full-without-padding(@padding-lg-y) [];
|
||||||
|
margin: @padding-lg;
|
||||||
|
resize: none;
|
||||||
|
width: .full-without-padding(@padding-lg-x) [];
|
||||||
|
}
|
||||||
|
</style>
|
@ -5,3 +5,9 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id={`pane-${pane}`} hidden={pane !== $navStore} role="tabpanel"><slot /></div>
|
<div id={`pane-${pane}`} hidden={pane !== $navStore} role="tabpanel"><slot /></div>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
div {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import CodeInput from '$lib/components/code-input.svelte';
|
||||||
import Content from '$lib/components/content.svelte';
|
import Content from '$lib/components/content.svelte';
|
||||||
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';
|
||||||
@ -8,27 +9,41 @@
|
|||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>resumarkdown</title>
|
<title>resumarkdown</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
<header>
|
<div>
|
||||||
<Headline>resumarkdown</Headline>
|
<header>
|
||||||
<NavTree>
|
<Headline>resumarkdown</Headline>
|
||||||
<NavItem destination="content">content</NavItem>
|
<NavTree>
|
||||||
<NavItem destination="style">style</NavItem>
|
<NavItem destination="content">content</NavItem>
|
||||||
<NavItem destination="preview">preview</NavItem>
|
<NavItem destination="style">style</NavItem>
|
||||||
</NavTree>
|
<NavItem destination="preview">preview</NavItem>
|
||||||
</header>
|
</NavTree>
|
||||||
<main>
|
</header>
|
||||||
<Content pane="content">
|
<main>
|
||||||
<p>content</p>
|
<Content pane="content">
|
||||||
</Content>
|
<CodeInput />
|
||||||
<Content pane="style">
|
</Content>
|
||||||
<p>style</p>
|
<Content pane="style">
|
||||||
</Content>
|
<CodeInput />
|
||||||
<Content pane="preview">
|
</Content>
|
||||||
<p>preview</p>
|
<Content pane="preview">
|
||||||
</Content>
|
<p>preview</p>
|
||||||
</main>
|
</Content>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
div {
|
||||||
|
align-items: stretch;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
justify-content: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: @padding-md;
|
padding: @padding-md;
|
||||||
|
22
src/styles.less
Normal file
22
src/styles.less
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// colors
|
||||||
|
@color-accent-dark: #a8c3b5;
|
||||||
|
@color-accent-light: #558b6e;
|
||||||
|
@color-danger: #d64933;
|
||||||
|
@color-dark: #2e282a;
|
||||||
|
@color-light: #fbfbfb;
|
||||||
|
|
||||||
|
// fonts
|
||||||
|
@fonts-sans: Rubik, Arial, sans-serif;
|
||||||
|
|
||||||
|
// layout
|
||||||
|
@padding-lg: @padding-lg-y @padding-lg-x;
|
||||||
|
@padding-lg-x: 2em;
|
||||||
|
@padding-lg-y: 1.5em;
|
||||||
|
@padding-md: @padding-md-y @padding-md-x;
|
||||||
|
@padding-md-x: 1em;
|
||||||
|
@padding-md-y: 0.5em;
|
||||||
|
|
||||||
|
// utils
|
||||||
|
.full-without-padding(@padding) {
|
||||||
|
@result: calc(100% - @padding * 2);
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
// colors
|
|
||||||
@color-accent-dark: #a8c3b5;
|
|
||||||
@color-accent-light: #558b6e;
|
|
||||||
@color-danger: #d64933;
|
|
||||||
@color-dark: #2e282a;
|
|
||||||
@color-light: #fbfbfb;
|
|
||||||
|
|
||||||
// fonts
|
|
||||||
@fonts-sans: Rubik, Arial, sans-serif;
|
|
||||||
|
|
||||||
// layout
|
|
||||||
@padding-md: 0.5em 1em;
|
|
@ -8,7 +8,7 @@ const config = {
|
|||||||
// for more information about preprocessors
|
// for more information about preprocessors
|
||||||
preprocess: sveltePreprocess({
|
preprocess: sveltePreprocess({
|
||||||
less: {
|
less: {
|
||||||
prependData: `@import 'src/vars.less';`,
|
prependData: `@import 'src/styles.less';`,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user