1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Desktop: Fixes #5461: Editor max width was not always applied in Rich Text editor

This commit is contained in:
Laurent Cozic
2021-09-19 12:03:16 +01:00
parent 0d40026d8b
commit 6d981864ef
4 changed files with 15 additions and 6 deletions

View File

@ -9,6 +9,7 @@ function formatCssSize(v: any): string {
export interface Options {
contentMaxWidth?: number;
contentMaxWidthTarget?: string;
}
export default function(theme: any, options: Options = null) {
@ -21,8 +22,9 @@ export default function(theme: any, options: Options = null) {
const fontFamily = '\'Avenir\', \'Arial\', sans-serif';
const maxWidthTarget = options.contentMaxWidthTarget ? options.contentMaxWidthTarget : '#rendered-md';
const maxWidthCss = options.contentMaxWidth ? `
#rendered-md {
${maxWidthTarget} {
max-width: ${options.contentMaxWidth}px;
margin-left: auto;
margin-right: auto;