mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
Desktop: Resolves #11279: Remove left/right edge margin around editor content when disabled in settings (#11290)
This commit is contained in:
parent
f7f4a50d35
commit
2974465882
@ -378,6 +378,8 @@ const CodeMirror = (props: NoteBodyEditorProps, ref: ForwardedRef<NoteBodyEditor
|
||||
katexEnabled: Setting.value('markdown.plugin.katex'),
|
||||
themeData: {
|
||||
...styles.globalTheme,
|
||||
marginLeft: 0,
|
||||
marginRight: 0,
|
||||
monospaceFont: Setting.value('style.editor.monospaceFontFamily'),
|
||||
},
|
||||
automatchBraces: Setting.value('editor.autoMatchingBraces'),
|
||||
|
10
packages/editor/CodeMirror/theme.ts
vendored
10
packages/editor/CodeMirror/theme.ts
vendored
@ -79,6 +79,10 @@ const createTheme = (theme: EditorTheme): Extension[] => {
|
||||
// be at least this specific.
|
||||
const selectionBackgroundSelector = '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground';
|
||||
|
||||
// Matches the editor only when there are no gutters (e.g. line numbers) added by
|
||||
// plugins
|
||||
const editorNoGuttersSelector = '&:not(:has(> .cm-scroller > .cm-gutters))';
|
||||
|
||||
const baseHeadingStyle = {
|
||||
fontWeight: 'bold',
|
||||
fontFamily: theme.fontFamily,
|
||||
@ -180,6 +184,12 @@ const createTheme = (theme: EditorTheme): Extension[] => {
|
||||
marginRight: 'auto',
|
||||
} : undefined,
|
||||
|
||||
// Allows editor content to be left-aligned with the toolbar on desktop.
|
||||
// See https://github.com/laurent22/joplin/issues/11279
|
||||
[`${editorNoGuttersSelector} .cm-line`]: theme.isDesktop ? {
|
||||
paddingLeft: 0,
|
||||
} : undefined,
|
||||
|
||||
// Override the default URL style when the URL is within a link
|
||||
'& .tok-url.tok-link, & .tok-link.tok-meta, & .tok-link.tok-string': {
|
||||
opacity: 0.6,
|
||||
|
Loading…
Reference in New Issue
Block a user