From 2554dacc4b59e3ac8d0a4f18224c39b7650aaf0a Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 22 Jan 2021 15:12:11 +0100 Subject: [PATCH] Add custom colortheme --- www/common/LessLoader.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/www/common/LessLoader.js b/www/common/LessLoader.js index cabf5411b..e9b60c381 100644 --- a/www/common/LessLoader.js +++ b/www/common/LessLoader.js @@ -95,6 +95,9 @@ define([ var COLORTHEME = '/customize/src/less2/include/colortheme.less'; var COLORTHEME_DARK = '/customize/src/less2/include/colortheme-dark.less'; + var getColortheme = function () { + return window.CryptPad_theme; + }; var getColorthemeURL = function () { if (window.CryptPad_theme === 'dark') { return COLORTHEME_DARK; } return COLORTHEME; @@ -133,7 +136,13 @@ define([ return doXHR(url, type, function (text, lastModified) { if (col) { console.warn(text, lastModified); - // XXX COLOR: append custom theme here + if (getColortheme() === "custom") { + // XXX COLOR: append custom theme here + var custom = [ + '@cryptpad_text_col: #FF0000;' + ].join('\n'); + text += '\n'+custom; + } } cached.res = [ text, lastModified ]; var queue = cached.queue;