Skip to content

Commit 1512192

Browse files
author
Ozan Tellioglu
committed
Style Settings Plugin Support
1 parent a77f558 commit 1512192

File tree

1 file changed

+57
-8
lines changed

1 file changed

+57
-8
lines changed

styles.css

+57-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,55 @@
1+
/* @settings
2+
3+
name: Ozan's Image in Editor Plugin
4+
id: oz-image-in-editor-plugin
5+
settings:
6+
7+
-
8+
id: oz-img-in-editor-max-transclusion-height
9+
title: Transclusion Embed Maximum Height
10+
description: Set the max height of transclusion render in editor as px
11+
type: variable-number
12+
default: 600
13+
format: px
14+
-
15+
id: oz-img-in-editor-max-msg-height
16+
title: MSG Embed Maximum Height
17+
description: Set the max height of msg render in editor as px
18+
type: variable-number
19+
default: 300
20+
format: px
21+
-
22+
id: oz-img-in-editor-img-size-xx-small
23+
title: Alt Text "#xx-small" Maximum Image Width
24+
description: Set the max width of images with "#xx-small" alt text
25+
type: variable-number
26+
default: 25
27+
format: "%"
28+
-
29+
id: oz-img-in-editor-img-size-x-small
30+
title: Alt Text "#x-small" Maximum Image Width
31+
description: Set the max width of images with "#x-small" alt text
32+
type: variable-number
33+
default: 50
34+
format: "%"
35+
-
36+
id: oz-img-in-editor-img-size-small
37+
title: Alt Text "#small" Maximum Image Width
38+
description: Set the max width of images with "#small" alt text
39+
type: variable-number
40+
default: 75
41+
format: "%"
42+
*/
43+
44+
.theme-light,
45+
.theme-dark {
46+
--oz-img-in-editor-max-msg-height: 300px;
47+
--oz-img-in-editor-max-transclusion-height: 600px;
48+
--oz-img-in-editor-img-size-xx-small: 25%;
49+
--oz-img-in-editor-img-size-x-small: 50%;
50+
--oz-img-in-editor-img-size-small: 75%;
51+
}
52+
153
.CodeMirror-linewidget img {
254
margin-top: 5px;
355
margin-bottom: 5px;
@@ -13,7 +65,7 @@
1365
.oz-transclusion-widget-cm6 {
1466
padding: 3px 3px 3px 19px;
1567
border: 0.7px solid var(--text-muted);
16-
max-height: 600px;
68+
max-height: var(oz-img-in-editor-max-transclusion-height);
1769
overflow: auto;
1870
border-radius: 7px;
1971
margin-top: 5px;
@@ -190,20 +242,17 @@ div.oz-transclusion-widget-cm6 pre {
190242

191243
div.oz-image-widget > img[alt$='#small'],
192244
div.oz-image-widget-cm6 > img[alt$='#small'] {
193-
max-width: 75% !important;
194-
min-width: 200pt !important;
245+
max-width: var(--oz-img-in-editor-img-size-small) !important;
195246
}
196247

197248
div.oz-image-widget > img[alt$='#x-small'],
198249
div.oz-image-widget-cm6 > img[alt$='#x-small'] {
199-
max-width: 50% !important;
200-
min-width: 100pt !important;
250+
max-width: var(--oz-img-in-editor-img-size-x-small) !important;
201251
}
202252

203253
div.oz-image-widget > img[alt$='#xx-small'],
204254
div.oz-image-widget-cm6 > img[alt$='#xx-small'] {
205-
max-width: 25% !important;
206-
min-width: 50pt !important;
255+
max-width: var(--oz-img-in-editor-img-size-xx-small) !important;
207256
}
208257

209258
/* Style For CM6 */
@@ -286,7 +335,7 @@ div.oz-pdf-widget-cm6 + br {
286335
}
287336

288337
.oz-custom-html-widget-cm6 .msg-handler-plugin-renderer {
289-
max-height: 300px;
338+
max-height: var(--oz-img-in-editor-max-msg-height);
290339
overflow-y: scroll;
291340
border: 0.1px solid var(--text-muted);
292341
padding: 10px;

0 commit comments

Comments
 (0)