Skip to content

Instantly share code, notes, and snippets.

@Yukaii
Last active November 7, 2021 09:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yukaii/946aeee91febde6aecb95a900b315d91 to your computer and use it in GitHub Desktop.
Save Yukaii/946aeee91febde6aecb95a900b315d91 to your computer and use it in GitHub Desktop.
Editor font & codeblock font cutomization for HackMD
/* ==UserStyle==
@name HackMD Style customization
@description Style cutomization on HackMD
@namespace userstyles.yukaii.tw
@version 0.3.0
@author Yukai Huang <hi@yukai.dev> (https://github.com/Yukaii)
@preprocessor stylus
@var text editorFont "Editor Font" Source Code Pro
@var text codeBlockFont "Codeblock Font" Menlo, Monaco, Consolas, "Courier New", monospace
@var checkbox zenMode "Toggle Zen mode" 0
@var checkbox lineNumber "Toggle Line number" 1
@var checkbox focusCurrentLine "Focus line mode" 0
@var checkbox monochromeText "Monochrome text color" 0
==/UserStyle== */
@-moz-document domain("hackmd.io") {
html[lang] .CodeMirror {
font-family: editorFont;
letter-spacing: 0;
}
.markdown-body code.hljs {
font-family: codeBlockFont;
}
if zenMode==1 {
.ui-edit-area {
margin: 0 auto;
width: 80vw;
max-width: 680px;
}
.CodeMirror-lines {
padding-top: 10px;
}
.CodeMirror-gutter.authorship-gutters {
display: none;
}
.authorship-gutter {
display: none;
}
}
if lineNumber==0 {
.CodeMirror-gutter.CodeMirror-linenumbers {
display: none;
}
.CodeMirror-linenumber {
display: none;
}
}
if focusCurrentLine==1 {
.CodeMirror-code > div:not(.CodeMirror-activeline) > .CodeMirror-line {
opacity: 0.8 !important;
filter: saturate(0.5) !important;
}
}
if monochromeText == 1 {
.CodeMirror-line {
filter: saturate(0) !important;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment