Fix CkEditor scrollbar

This commit is contained in:
yflory 2021-02-05 11:46:51 +01:00
parent 42dfa9a941
commit 8edd6b791d
4 changed files with 32 additions and 3 deletions

View file

@ -3,6 +3,29 @@ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
html {
scrollbar-color: rgba(0,0,0,0.2) transparent;
scrollbar-width: thin;
}
body::-webkit-scrollbar {
width: 6px;
background-color: #FFF !important;
}
body::-webkit-scrollbar-thumb {
width: 6px;
background-color: rgba(0,0,0,0.2) !important;
}
html.cp-dark {
scrollbar-color: rgba(255,255,255,0.2) transparent;
}
html.cp-dark ::-webkit-scrollbar {
background-color: #222 !important; /* should match the value un pad/inner.js */
}
html.cp-dark ::-webkit-scrollbar-thumb {
background-color: rgba(255,255,255,0.2) !important;
}
body
{
/* Font */

View file

@ -40,6 +40,7 @@ define([
Mermaid = _Mermaid;
Mermaid.initialize({
gantt: { axisFormat: '%m-%d', },
theme: window.CryptPad_theme === 'dark' ? 'dark' : undefined,
"themeCSS": mermaidThemeCSS,
});
}

View file

@ -116,6 +116,7 @@ body.cp-app-pad {
background-color: @bg-color;
justify-content: center;
iframe {
background-color: transparent;
flex: 1;
min-width: 0;
order: 1;

View file

@ -1217,12 +1217,16 @@ define([
$contentContainer.prepend(h('div#cp-app-pad-toc'));
$ckeToolbar.find('.cke_button__image_icon').parent().hide();
var $iframe = $('iframe').contents();
if (window.CryptPad_theme === 'dark') {
var $iframe = $('iframe').contents();
$iframe.find('html').css({
'background-color': '#222', // XXX
$iframe.find('html').addClass('cp-dark').css({
'background-color': '#222', // XXX make sure it's the same in www/pad/app-pad.less
'color': '#aaa' // XXX
});
} else {
$iframe.find('html').css({
'background-color': '#FFF'
});
}
}).nThen(waitFor());