diff --git a/app/_static/highlight.css b/app/_static/highlight.css index a8a85cf8..1f45d7a4 100644 --- a/app/_static/highlight.css +++ b/app/_static/highlight.css @@ -5,9 +5,13 @@ github.com style (c) Vasily Polovnyov */ :root { --color-text-primary: #333; + --color-diff-add: #dfd; + --color-diff-remove: #fdd; } [data-theme="dark"] { --color-text-primary: #c9d1d9; + --color-diff-add: #484; + --color-diff-remove: #844; } .hljs { @@ -89,11 +93,11 @@ github.com style (c) Vasily Polovnyov } .hljs-deletion { - background: #fdd; + background: var(--color-diff-remove); } .hljs-addition { - background: #dfd; + background: var(--color-diff-add); } .hljs-emphasis { diff --git a/app/_static/markdown.css b/app/_static/markdown.css index e8fd08a8..48c82c4a 100644 --- a/app/_static/markdown.css +++ b/app/_static/markdown.css @@ -253,7 +253,6 @@ content: normal; } .markdown-body code { - font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 0; padding-top: 0.2em; padding-bottom: 0.2em; @@ -303,9 +302,27 @@ box-sizing: border-box; padding: 0; } +.task-list-item input[type="checkbox"]:checked { + filter: invert() brightness(2.5) invert(); +} .task-list-item input[type="radio"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; padding: 0; } +.octicon { + fill: var(--color-text-primary); +} +.mermaid { + display: flex; + justify-content: center; +} +.mermaid > svg { + max-width: none !important; +} +.dot { + display: flex; + justify-content: center; + align-items: center; +} diff --git a/autoload/mkdp/autocmd.vim b/autoload/mkdp/autocmd.vim index 9f1aa77e..f86e4e30 100644 --- a/autoload/mkdp/autocmd.vim +++ b/autoload/mkdp/autocmd.vim @@ -1,6 +1,7 @@ " init preview key action function! mkdp#autocmd#init() abort - execute 'augroup MKDP_REFRESH_INIT' . bufnr('%') + let s:bufnum = bufnr('%') + execute 'augroup MKDP_REFRESH_INIT' . s:bufnum autocmd! " refresh autocmd if g:mkdp_refresh_slow @@ -10,13 +11,13 @@ function! mkdp#autocmd#init() abort endif " autoclose autocmd if g:mkdp_auto_close - autocmd BufHidden call mkdp#rpc#preview_close() + autocmd BufHidden call mkdp#rpc#preview_close(s:bufnum) endif " server close autocmd autocmd VimLeave * call mkdp#rpc#stop_server() augroup END endfunction -function! mkdp#autocmd#clear_buf() abort - execute 'autocmd! ' . 'MKDP_REFRESH_INIT' . bufnr('%') +function! mkdp#autocmd#clear_buf(bufnum) abort + execute 'autocmd! ' . 'MKDP_REFRESH_INIT' . a:bufnum endfunction diff --git a/autoload/mkdp/rpc.vim b/autoload/mkdp/rpc.vim index b257571a..20477940 100644 --- a/autoload/mkdp/rpc.vim +++ b/autoload/mkdp/rpc.vim @@ -109,18 +109,18 @@ function! mkdp#rpc#preview_refresh() abort endif endfunction -function! mkdp#rpc#preview_close() abort +function! mkdp#rpc#preview_close(bufnum) abort if s:is_vim if s:mkdp_channel_id !=# v:null - call mkdp#rpc#notify(s:mkdp_channel_id, 'close_page', { 'bufnr': bufnr('%') }) + call mkdp#rpc#notify(s:mkdp_channel_id, 'close_page', { 'bufnr': a:bufnum }) endif else if s:mkdp_channel_id !=# -1 - call rpcnotify(s:mkdp_channel_id, 'close_page', { 'bufnr': bufnr('%') }) + call rpcnotify(s:mkdp_channel_id, 'close_page', { 'bufnr': a:bufnum }) endif endif let b:MarkdownPreviewToggleBool = 0 - call mkdp#autocmd#clear_buf() + call mkdp#autocmd#clear_buf(a:bufnum) endfunction function! mkdp#rpc#open_browser() abort