forked from esm7/obsidian-rtl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.css
202 lines (177 loc) · 6.64 KB
/
styles.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
@media print {
span.cm-tab {
width: 50px !important;
display: inline-block;
}
.is-auto .esm-ltr {
direction: ltr;
text-align-last: left;
}
.is-auto .esm-rtl {
direction: rtl;
text-align: right;
}
}
/* List indent fix */
.is-mobile .is-rtl .HyperMD-list-line, .is-mobile .HyperMD-list-line[dir="rtl"] {
text-indent: 0px !important;
padding-left: 0 !important;
}
.CodeMirror-rtl pre {
text-indent: 0px !important;
}
/* Embedded links always LTR */
.embedded-backlinks {
direction: ltr;
}
/* Patch YAML RTL */
/* In a preview that is strictly RTL (is-rtl) and the settings ask to right-aline YAML (rtl-yaml), set a YAML block to RTL. */
.is-rtl.rtl-yaml code.language-yaml {
text-align: right;
}
/* Then move the 'copy' button to the left */
.is-rtl.rtl-yaml code.language-yaml + button.copy-code-button {
right: unset;
left: 0;
}
/* In a preview that is auto (is-auto), and the YAML was detected as RTL (esm-rtl), set the 'copy' button to the left */
.is-auto .esm-rtl.language-yaml + button.copy-code-button {
right: unset;
left: 0;
}
/* In RTL, or in Auto with a first line that is RTL, set the flair (where it says e.g. 'yaml' in Edit mode) to the left */
.is-rtl div:has(.HyperMD-codeblock-begin) .code-block-flair,
.is-auto div:has(.HyperMD-codeblock-begin + .HyperMD-codeblock[dir="rtl"]) .code-block-flair {
right: unset;
left: 6px;
}
/* RTL and Auto callout titles that are detected as RTL - set to the right */
.is-rtl .callout-title:has(.esm-rtl),
.is-auto .callout-title:has(.esm-rtl) {
direction: rtl;
}
.is-auto .callout-content .esm-rtl {
direction: rtl;
}
/* When an RTL callout title was set to the right, left-justify its edit block button */
.is-rtl div.cm-callout:has(.callout-title .esm-rtl) .edit-block-button,
.is-auto div.cm-callout:has(.callout-title .esm-rtl) .edit-block-button {
right: unset;
left: var(--size-2-2);
}
.markdown-source-view .cm-line[dir="rtl"] .task-list-label {
margin-left: 0;
margin-right: -3px;
}
/* Better spacing between bullet and text */
.outliner-plugin-better-bullets .markdown-source-view.is-rtl .cm-formatting-list-ul,
.outliner-plugin-better-bullets .markdown-source-view .cm-line[dir="rtl"] .cm-formatting-list-ul {
margin-right: 0;
margin-left: 0.3em;
}
.markdown-source-view.is-rtl .is-collapsed .collapse-indicator svg.svg-icon,
.markdown-source-view .cm-line[dir="rtl"] .is-collapsed .collapse-indicator svg.svg-icon {
transform: rotate(90deg);
}
/* Styling for collapse indicator on the headings */
.markdown-source-view.is-rtl .cm-line .cm-fold-indicator .collapse-indicator,
.markdown-source-view .cm-line[dir="rtl"] .cm-fold-indicator .collapse-indicator {
padding-right: 0;
padding-left: 6px;
right: -16px;
}
/* Styling for collapse indicator on the lists */
.markdown-source-view.is-rtl .cm-line:not(.cm-active):not(.HyperMD-header):not(.HyperMD-task-line) .cm-fold-indicator .collapse-indicator,
.markdown-source-view .cm-line[dir="rtl"]:not(.cm-active):not(.HyperMD-header):not(.HyperMD-task-line) .cm-fold-indicator .collapse-indicator {
padding-right: 0;
padding-left: 18px;
right: -16px;
}
/* Styling for tags in RTL */
.markdown-source-view.is-rtl .cm-line .cm-hashtag.cm-hashtag-begin,
.markdown-source-view .cm-line[dir="rtl"] .cm-hashtag.cm-hashtag-begin {
border-top-right-radius: var(--tag-radius);
border-bottom-right-radius: var(--tag-radius);
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left: none;
border-right: var(--tag-border-width) solid var(--tag-border-color);
padding-right: var(--tag-padding-x);
padding-left: 0;
}
.markdown-source-view.is-rtl .cm-line .cm-hashtag.cm-hashtag-end,
.markdown-source-view .cm-line[dir="rtl"] .cm-hashtag.cm-hashtag-end {
border-top-left-radius: var(--tag-radius);
border-bottom-left-radius: var(--tag-radius);
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-right: none;
border-left: var(--tag-border-width) solid var(--tag-border-color);
padding-left: var(--tag-padding-x);
padding-right: 0;
}
.markdown-preview-view.is-auto .esm-rtl,
.kanban-plugin__board .esm-rtl,
.kanban-plugin__drag-container .esm-rtl {
direction: rtl;
text-align: right;
}
/* Moving bullets to right side of the page and adding enough space between the bullet and the text */
.markdown-preview-view.is-auto .esm-rtl > .list-bullet,
.markdown-preview-view.is-rtl .list-bullet {
float: right;
margin-right: -12px;
}
/* Fixing indentation guides in nested lists */
.markdown-preview-view.is-auto.show-indentation-guide li.esm-rtl > ul::before,
.markdown-preview-view.is-auto.show-indentation-guide li.esm-rtl > ol::before {
left: auto;
right: -15px;
}
/* Moving the collapse indicator to right side of the page */
.markdown-preview-view.is-auto .esm-rtl > .collapse-indicator,
.markdown-preview-view.is-rtl .collapse-indicator {
float: right;
}
/* Moving the collapse indicator icon on the right of the text with enough space between */
.markdown-preview-view.is-auto .esm-rtl > .list-collapse-indicator,
.markdown-preview-view.is-rtl .list-collapse-indicator {
margin-right: -48px;
padding-left: 18px;
}
/* Moving the heading collapse indicator on the right of the text. Without
This the collapse indicator will be over the heading text */
.markdown-preview-view.is-auto .esm-rtl > .heading-collapse-indicator,
.markdown-preview-view.is-rtl .heading-collapse-indicator {
margin-right: -22px;
}
/* Mirroring collapse icon for nested lists so it points to rtl text not outside of page */
.markdown-preview-view.is-auto .esm-rtl > .collapse-icon .is-collapsed svg.svg-icon,
.markdown-preview-view.is-auto .esm-rtl.is-collapsed > .collapse-icon svg.svg-icon,
.markdown-preview-view.is-rtl .collapse-icon .is-collapsed svg.svg-icon {
transform: rotate(90deg);
}
/* Mirroring collapse icon for headings so it points to rtl text not outside of page */
.markdown-preview-view .is-collapsed .esm-rtl > .collapse-icon svg.svg-icon,
.markdown-preview-view.is-rtl .collapse-icon svg.svg-icon {
transform: rotate(90deg);
}
/* Reverting the margin so the text won't stick to the checkbox */
.markdown-preview-view.is-auto .esm-rtl > .task-list-item-checkbox,
.markdown-preview-view.is-rtl .task-list-item-checkbox {
margin-left: 6px;
margin-right: 0;
}
.markdown-preview-view.is-auto .esm-ltr {
direction: ltr;
text-align-last: left;
}
/* Helper styles for debugging */
/* .cm-line[dir="rtl"] { */
/* border-right: dashed; */
/* border-right-color: blue; */
/* } */
/* .cm-line[dir="ltr"] { */
/* border-right: dashed; */
/* border-right-color: red; */
/* } */