diff --git a/plugs/markdown/preview.ts b/plugs/markdown/preview.ts
index c4c6ea30..e470d0e1 100644
--- a/plugs/markdown/preview.ts
+++ b/plugs/markdown/preview.ts
@@ -35,6 +35,7 @@ export async function updateMarkdownPreview() {
},
});
const customStyles = await editor.getUiOption("customStyles");
+ const toolbar = renderToolbar();
await editor.showPanel(
"rhs",
2,
@@ -45,12 +46,27 @@ export async function updateMarkdownPreview() {
${customStyles ?? ""}
-
${html}
+ ${toolbar}${html}
`,
js,
);
}
+function renderToolbar(): string {
+ return ``;
+}
+
export async function previewClickHandler(e: any) {
const [eventName, arg] = JSON.parse(e);
// console.log("Got click", eventName, arg);
diff --git a/web/styles/main.scss b/web/styles/main.scss
index 744b9b18..b450e4b3 100644
--- a/web/styles/main.scss
+++ b/web/styles/main.scss
@@ -226,4 +226,22 @@ body {
padding: 0;
margin: 0;
}
-}
\ No newline at end of file
+}
+
+.sb-preview {
+ position: relative;
+}
+
+.sb-markdown-toolbar {
+ position: absolute;
+ opacity: 0;
+ transition: opacity 0.2s;
+ width: 100%;
+ display: flex;
+ justify-content: flex-end;
+ box-sizing: border-box;
+}
+
+.sb-markdown-toolbar:hover {
+ opacity: 1;
+}