diff --git a/src/css/code.css b/src/css/code.css index aeaa534c..8ec63f84 100644 --- a/src/css/code.css +++ b/src/css/code.css @@ -1,22 +1,9 @@ -.code { - @apply my-5; - @apply relative; - color: var(--code-fg); -} - .code pre { - @apply p-5; - @apply rounded-lg; - @apply whitespace-pre; - @apply font-mono; + @apply -mx-[2rem]; + @apply rounded-xl; + @apply my-8; + padding: 2rem; background-color: var(--code-bg); -} - -.code:before { - content: attr(data-lang); - color: var(--lang-color); - @apply absolute; - @apply right-3; - @apply top-2; - @apply text-xs; + color: var(--code-fg); + max-height: 800px; } diff --git a/src/css/prism-dark.css b/src/css/prism-dark.css index 13fe1230..6aa0dea2 100644 --- a/src/css/prism-dark.css +++ b/src/css/prism-dark.css @@ -2,8 +2,8 @@ .code { --lang-color: #8d8c8c; - --code-bg: #2d2d2d; - --code-fg: #ccc; + --code-bg: rgb(18, 18, 38); + --code-fg: #fff; } .token.comment, diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx new file mode 100644 index 00000000..5fdaf048 --- /dev/null +++ b/src/pages/_document.tsx @@ -0,0 +1,24 @@ +import { Html, Head, Main, NextScript } from "next/document" + +export default function Document() { + return ( + + + + + + + +
+ + + + ) +} diff --git a/src/pages/dashboard/[subdomain]/editor.tsx b/src/pages/dashboard/[subdomain]/editor.tsx index 9ce1bd60..7b9cdeef 100644 --- a/src/pages/dashboard/[subdomain]/editor.tsx +++ b/src/pages/dashboard/[subdomain]/editor.tsx @@ -129,13 +129,17 @@ export default function SubdomainEditor() { [uploadFile] ) - const { editorRef } = useEditor({ + const { editorRef, view } = useEditor({ value: values.content, onChange: handleEditorContentChange, onDropFile: handleDropFile, placeholder: "Start writing here..", }) + const focusEditor = () => { + view?.focus() + } + return ( @@ -220,6 +224,11 @@ export default function SubdomainEditor() { type="text" name="title" value={values.title} + onKeyDown={(e) => { + if (e.key === "Enter") { + focusEditor() + } + }} onChange={(e) => updateValue("title", e.target.value)} className="h-12 ml-1 inline-flex items-center border-none text-3xl font-bold w-full focus:outline-none" placeholder="Title goes here.." diff --git a/tailwind.config.js b/tailwind.config.js index 394f0958..fbab0bec 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -15,6 +15,9 @@ module.exports = { spacing: { sidebar: `240px`, }, + fontFamily: { + mono: `IBM Plex Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace`, + }, }, }, variants: {},