Fix CkEditor scrollbar

pull/1/head
yflory 4 years ago
parent 42dfa9a941
commit 8edd6b791d

@ -3,6 +3,29 @@ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license 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 body
{ {
/* Font */ /* Font */

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

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

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

Loading…
Cancel
Save