File tree Expand file tree Collapse file tree 3 files changed +48
-60
lines changed Expand file tree Collapse file tree 3 files changed +48
-60
lines changed Original file line number Diff line number Diff line change 3
3
import CodeMirror from " ../../../src/CodeMirror.svelte" ;
4
4
</script >
5
5
6
+ <style >
7
+ .codemirror-container {
8
+ position : relative ;
9
+ width : 100% ;
10
+ height : 100% ;
11
+ border : none ;
12
+ line-height : 1.5 ;
13
+ overflow : hidden ;
14
+ }
15
+
16
+ .codemirror-container :global(.CodeMirror ) {
17
+ height : 100% ;
18
+ background : transparent ;
19
+ font : 400 14px /1.7 var (--font-mono );
20
+ color : var (--base );
21
+ }
22
+
23
+ .codemirror-container.flex :global(.CodeMirror ) {
24
+ height : auto ;
25
+ }
26
+
27
+ .codemirror-container.flex :global(.CodeMirror-lines ) {
28
+ padding : 0 ;
29
+ }
30
+
31
+ .codemirror-container :global(.CodeMirror-gutters ) {
32
+ padding : 0 16px 0 8px ;
33
+ border : none ;
34
+ }
35
+
36
+ .codemirror-container :global(.error-loc ) {
37
+ position : relative ;
38
+ border-bottom : 2px solid #da106e ;
39
+ }
40
+
41
+ .codemirror-container :global(.error-line ) {
42
+ background-color : rgba (200 , 0 , 0 , 0.05 );
43
+ }
44
+ </style >
45
+
6
46
<svelte:head >
7
47
<title >svelte-codemirror example</title >
8
48
</svelte:head >
9
49
10
- <CodeMirror />
50
+ <div class =" codemirror-container" >
51
+ <CodeMirror />
52
+ </div >
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " svelte-codemirror" ,
3
- "version" : " 1.0.2 " ,
3
+ "version" : " 1.0.3 " ,
4
4
"description" : " An svelte v3 component for embedding codemirrorjs" ,
5
5
"main" : " src/CodeMirror.svelte" ,
6
6
"svelte" : " src/CodeMirror.svelte" ,
Original file line number Diff line number Diff line change 199
199
</script >
200
200
201
201
<style >
202
- .codemirror-container {
203
- position : relative ;
204
- width : 100% ;
205
- height : 100% ;
206
- border : none ;
207
- line-height : 1.5 ;
208
- overflow : hidden ;
209
- }
210
-
211
- .codemirror-container :global(.CodeMirror ) {
212
- height : 100% ;
213
- background : transparent ;
214
- font : 400 14px /1.7 var (--font-mono );
215
- color : var (--base );
216
- }
217
-
218
- .codemirror-container.flex :global(.CodeMirror ) {
219
- height : auto ;
220
- }
221
-
222
- .codemirror-container.flex :global(.CodeMirror-lines ) {
223
- padding : 0 ;
224
- }
225
-
226
- .codemirror-container :global(.CodeMirror-gutters ) {
227
- padding : 0 16px 0 8px ;
228
- border : none ;
229
- }
230
-
231
- .codemirror-container :global(.error-loc ) {
232
- position : relative ;
233
- border-bottom : 2px solid #da106e ;
234
- }
235
-
236
- .codemirror-container :global(.error-line ) {
237
- background-color : rgba (200 , 0 , 0 , 0.05 );
238
- }
239
-
240
202
textarea {
241
203
visibility : hidden ;
242
204
}
259
221
tab-size : 2 ;
260
222
-moz-tab-size : 2 ;
261
223
}
262
-
263
- .flex pre {
264
- padding : 0 0 0 4px ;
265
- height : auto ;
266
- }
267
224
</style >
268
225
269
- <div
270
- class =" codemirror-container"
271
- class:flex
272
- bind:offsetWidth ={w }
273
- bind:offsetHeight ={h }>
274
- <textarea tabindex ="0" bind:this ={refs .editor } readonly value ={code } />
275
-
276
- {#if ! CodeMirror }
277
- <pre style ="position: absolute; left: 0; top: 0" >{code }</pre >
278
-
279
- <!-- <div style="position: absolute; width: 100%; bottom: 0">
280
- <Message kind="info">loading editor...</Message>
281
- </div> -->
282
- {/if }
283
- </div >
226
+ <textarea tabindex ="0" bind:this ={refs .editor } readonly value ={code } />
227
+ {#if ! CodeMirror }
228
+ <pre style ="position: absolute; left: 0; top: 0" >{code }</pre >
229
+ {/if }
You can’t perform that action at this time.
0 commit comments