From 1542ca48780199aac8639ba96acef258e105f9e7 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 9 Feb 2021 10:29:39 +0100 Subject: [PATCH] Highlight.js dark theme --- www/common/diffMarked.js | 2 +- www/common/highlight/styles/dracula.css | 76 +++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 www/common/highlight/styles/dracula.css diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index 2875e88fd..fd0242abf 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -11,7 +11,7 @@ define([ '/common/highlight/highlight.pack.js', '/bower_components/diff-dom/diffDOM.js', '/bower_components/tweetnacl/nacl-fast.min.js', - 'css!/common/highlight/styles/github.css' + 'css!/common/highlight/styles/'+ (window.CryptPad_theme === 'dark' ? 'dracula.css' : 'github.css') ],function ($, ApiConfig, Marked, Hash, Util, h, MT, MediaTag, Messages) { var DiffMd = {}; diff --git a/www/common/highlight/styles/dracula.css b/www/common/highlight/styles/dracula.css new file mode 100644 index 000000000..d591db680 --- /dev/null +++ b/www/common/highlight/styles/dracula.css @@ -0,0 +1,76 @@ +/* + +Dracula Theme v1.2.0 + +https://github.com/zenorocha/dracula-theme + +Copyright 2015, All rights reserved + +Code licensed under the MIT license +http://zenorocha.mit-license.org + +@author Éverton Ribeiro +@author Zeno Rocha + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #282a36; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-section, +.hljs-link { + color: #8be9fd; +} + +.hljs-function .hljs-keyword { + color: #ff79c6; +} + +.hljs, +.hljs-subst { + color: #f8f8f2; +} + +.hljs-string, +.hljs-title, +.hljs-name, +.hljs-type, +.hljs-attribute, +.hljs-symbol, +.hljs-bullet, +.hljs-addition, +.hljs-variable, +.hljs-template-tag, +.hljs-template-variable { + color: #f1fa8c; +} + +.hljs-comment, +.hljs-quote, +.hljs-deletion, +.hljs-meta { + color: #6272a4; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-title, +.hljs-section, +.hljs-doctag, +.hljs-type, +.hljs-name, +.hljs-strong { + font-weight: bold; +} + +.hljs-emphasis { + font-style: italic; +}