style: borderless and paddingless code editor

This commit is contained in:
Elian Doran
2025-12-15 08:05:18 +02:00
parent 3e19a163c2
commit 43b6440bf9
2 changed files with 9 additions and 5 deletions

View File

@@ -521,9 +521,7 @@ body.mobile .dropdown .dropdown-submenu > span {
.cm-editor {
height: 100%;
outline: none !important;
border-radius: 6px;
overflow: hidden;
margin: 4px;
font-size: var(--monospace-font-size);
}
@@ -629,6 +627,10 @@ pre:not(.hljs) {
padding: var(--padding-size);
}
pre:has(> .cm-editor) {
padding: 0;
}
pre > button.copy-button {
position: absolute;
top: var(--copy-button-margin-size);

View File

@@ -1,10 +1,12 @@
import { useEffect, useRef, useState } from "preact/hooks";
import "./code.css";
import { CodeEditor } from "./Code";
import CodeMirror from "@triliumnext/codemirror";
import { useEffect, useRef, useState } from "preact/hooks";
import server from "../../../services/server";
import { useTriliumEvent } from "../../react/hooks";
import { TypeWidgetProps } from "../type_widget";
import { CodeEditor } from "./Code";
export default function BackendLog({ ntxId, parentComponent }: TypeWidgetProps) {
const [ content, setContent ] = useState<string>();
@@ -40,5 +42,5 @@ export default function BackendLog({ ntxId, parentComponent }: TypeWidgetProps)
preferPerformance
/>
</div>
)
);
}