Ely Office: six offline-first desktop apps in Rust and GPUI
ElyDoc, ElyTable, ElyShow (LibreOfficeKit), ElyPDF (MuPDF), ElyTree (Git), ElyMark (Milkdown and CodeMirror in CEF). ElyMail and ElyAgent follow.
This commit is contained in:
817 files changed
+143101
No files matched your search
@@ -0,0 +1,22 @@
|
||||
// The writing view: focus, typewriter, width, font, size (MARK-09).
|
||||
|
||||
let typewriter = false
|
||||
|
||||
/** Applies `look`; the Markdown never changes. */
|
||||
export function apply(look) {
|
||||
const root = document.documentElement
|
||||
root.dataset.focus = look.focus
|
||||
root.dataset.width = look.width
|
||||
root.dataset.font = look.font
|
||||
root.dataset.typewriter = look.typewriter
|
||||
typewriter = look.typewriter
|
||||
const sheet =
|
||||
document.getElementById('ely-look') ??
|
||||
document.head.appendChild(Object.assign(document.createElement('style'), { id: 'ely-look' }))
|
||||
sheet.textContent = `:root { --ely-text-scale: ${look.size / 100}; }`
|
||||
}
|
||||
|
||||
/** Typewriter scrolling: the caret's line stays mid-view. */
|
||||
export function follow(editor) {
|
||||
if (typewriter) editor?.center?.()
|
||||
}
|
||||
Reference in new issue
Block a user