Skip to content

Commit 7ebb27c

Browse files
authored
Merge pull request #213 from LunaciaDev/master
2 parents dda89fd + 75feb17 commit 7ebb27c

2 files changed

Lines changed: 11 additions & 63 deletions

File tree

docs/en/advanced/custom-css.md

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -130,46 +130,20 @@ body.dark .main-editor-wrapper .cm-editor .cm-content .typewriter-active-line {
130130
}
131131
```
132132

133-
!!! warning
134-
135-
The example CSS Code Snippets above have been updated and tested with v3.0.1 and so should work with newer versions of Zettlr, but the ones below haven't been updated in some time, and are unlikely to work out of the box.
136-
137-
138133
### Set a maximum width for the text
139134

140135
If you have a large screen, you may find that lines of your text are very long.
141136
If you wish to have shorter lines in the editor, with margins on both sides, you can use the following CSS snippet:
142137

143138
```css
144-
#editor {
145-
--side-margin: calc( 50vw - 30em );
146-
}
147-
148-
#editor .CodeMirror {
149-
margin-left: var(--side-margin);
150-
}
151-
152-
#editor .CodeMirror-scroll {
153-
padding-right: var(--side-margin);
139+
.main-editor-wrapper .cm-content {
140+
max-width: <preferred-line-width>;
141+
margin-right: auto;
154142
}
155-
```
156-
157-
![A preview of Zettlr using above snippet](../img/custom_css_maxwidth.png)
158-
159-
For the distraction free mode, the CSS snippet needs to be modified as follows:
160143

161-
```css
162-
#editor.fullscreen {
163-
--side-margin-fullscreen: calc( 50vw - 30em );
164-
}
165-
166-
#editor.fullscreen .CodeMirror-fullscreen {
167-
margin-left: var(--side-margin-fullscreen) !important;
168-
}
169-
170-
#editor.fullscreen .CodeMirror-fullscreen .CodeMirror-scroll {
171-
padding-right: var(--side-margin-fullscreen) !important;
144+
.main-editor-wrapper .cm-gutters {
145+
margin-left: auto;
172146
}
173147
```
174148

175-
By adjusting the calc functions for the two different modes, the same line width can be achieved with and without the file manager/sidebar.
149+
![A preview of Zettlr using above snippet](../img/custom_css_maxwidth.png)

docs/ru/advanced/custom-css.md

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -130,46 +130,20 @@ body.dark .main-editor-wrapper .cm-editor .cm-content .typewriter-active-line {
130130
}
131131
```
132132

133-
!!! warning
134-
135-
The example CSS Code Snippets above have been updated and tested with v3.0.1 and so should work with newer versions of Zettlr, but the ones below haven't been updated in some time, and are unlikely to work out of the box.
136-
137-
138133
### Set a maximum width for the text
139134

140135
If you have a large screen, you may find that lines of your text are very long.
141136
If you wish to have shorter lines in the editor, with margins on both sides, you can use the following CSS snippet:
142137

143138
```css
144-
#editor {
145-
--side-margin: calc( 50vw - 30em );
139+
.main-editor-wrapper .cm-content {
140+
max-width: <preferred-line-width>;
141+
margin-right: auto;
146142
}
147143

148-
#editor .CodeMirror {
149-
margin-left: var(--side-margin);
150-
}
151-
152-
#editor .CodeMirror-scroll {
153-
padding-right: var(--side-margin);
144+
.main-editor-wrapper .cm-gutters {
145+
margin-left: auto;
154146
}
155147
```
156148

157149
![A preview of Zettlr using above snippet](../img/custom_css_maxwidth.png)
158-
159-
For the distraction free mode, the CSS snippet needs to be modified as follows:
160-
161-
```css
162-
#editor.fullscreen {
163-
--side-margin-fullscreen: calc( 50vw - 30em );
164-
}
165-
166-
#editor.fullscreen .CodeMirror-fullscreen {
167-
margin-left: var(--side-margin-fullscreen) !important;
168-
}
169-
170-
#editor.fullscreen .CodeMirror-fullscreen .CodeMirror-scroll {
171-
padding-right: var(--side-margin-fullscreen) !important;
172-
}
173-
```
174-
175-
By adjusting the calc functions for the two different modes, the same line width can be achieved with and without the file manager/sidebar.

0 commit comments

Comments
 (0)