Skip to content

Commit

Permalink
Adjust styling of cells and outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzhang committed Nov 30, 2021
1 parent 591c34f commit 53a66b7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/components/Notebook.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/>
{/each}
<CellDivider
visible={notebook.length === 0}
on:create={(event) => {
notebook.addCell({
type: event.detail.type,
Expand Down
10 changes: 8 additions & 2 deletions src/components/cell/CellDivider.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import FaPlus from "svelte-icons/fa/FaPlus.svelte";
const dispatch = createEventDispatcher();
export let visible: boolean = false;
</script>

<div class="divider">
<div class="divider" class:visible>
<hr />
<button on:click={() => dispatch("create", { type: "code" })} tabindex="-1">
<div class="h-3 w-3 mr-[4px]"><FaPlus /></div>
Expand All @@ -23,10 +25,14 @@

<style lang="postcss">
.divider {
@apply relative flex justify-center items-center transition-opacity
@apply h-2 relative flex justify-center items-center transition-opacity
opacity-0 hover:opacity-100 focus:opacity-100;
}
.divider.visible {
@apply opacity-100;
}
.divider > hr {
@apply absolute w-full border-dotted border-gray-300;
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/cell/CellOutput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@

<style lang="postcss">
.error {
@apply mb-1 p-3 rounded-sm bg-pink-100 border border-pink-300 font-mono;
@apply mb-1 p-3 rounded-sm bg-pink-100 font-mono;
}
.output {
@apply mb-1 p-3 rounded-sm border border-slate-200;
@apply p-3 rounded-sm;
}
.output.stale {
@apply border-yellow-200 opacity-50;
Expand Down Expand Up @@ -77,7 +77,7 @@
}
.markdown-output {
@apply px-2.5 font-serif text-base max-w-2xl leading-snug;
@apply px-2.5 font-serif text-base text-[1.02rem] max-w-2xl leading-snug;
}
.markdown-output :global(h1) {
Expand Down
2 changes: 2 additions & 0 deletions src/components/cell/output/FullView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
<div class="flex flex-col space-y-3">
{#each Object.entries(value) as [name, values] (name)}
<RelationView {name} {values} />
{:else}
<span class="italic text-sm font-light">(there's nothing here yet...)</span>
{/each}
</div>
2 changes: 1 addition & 1 deletion src/components/cell/output/RelationView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$: displaying = Math.min(values.length, 5); // hide long lists
</script>

<div class="font-mono text-gray-700">
<div class="font-mono text-[0.95rem] text-gray-700">
<span class="text-gray-500">Table</span>&lbrace;<span class="font-bold"
>{name}</span
>&rbrace; <span class="text-gray-400">:=</span>
Expand Down

0 comments on commit 53a66b7

Please sign in to comment.