File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 5555<!-- svelte-ignore a11y_no_static_element_interactions -->
5656<div
5757 class =" container"
58+ style ="--editor-font-size: {workspace .fontSize }px"
5859 bind:this ={container }
5960 onpointerdown ={() => {
6061 workspace .enable_tab_indent ();
121122 .fake-content {
122123 padding : 0 1rem ;
123124 }
125+
126+ .container :global(.cm-editor .cm-scroller ) {
127+ font-size : var (--editor-font-size , var (--sk-font-size-mono ));
128+ }
124129 </style >
Original file line number Diff line number Diff line change 186186 />
187187 </label >
188188
189+ <label class =" option" >
190+ <span >Font Size</span >
191+ <input
192+ type =" number"
193+ min =" 10"
194+ max =" 128"
195+ value ={workspace .fontSize }
196+ onchange ={(ev ) => (workspace .fontSize = ev .currentTarget .valueAsNumber )}
197+ />
198+ </label >
199+
189200 {#if download }
190201 <button onclick ={download }>Download app</button >
191202 {/if }
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ export class Workspace {
117117 #files = $state . raw < Item [ ] > ( [ ] ) ;
118118 #current = $state . raw ( ) as File ;
119119 #vim = $state ( false ) ;
120+ #fontSize = $state ( 14 ) ;
120121 #aliases = $state . raw ( undefined ) as undefined | Record < string , string > ;
121122 #tailwind = $state ( false ) ;
122123
@@ -292,6 +293,7 @@ export class Workspace {
292293 untrack ( ( ) => {
293294 view . setState ( this . #get_state( untrack ( ( ) => this . #current) ) ) ;
294295 this . vim = localStorage . getItem ( 'vim' ) === 'true' ;
296+ this . fontSize = Number ( localStorage . getItem ( 'fontSize' ) ) || 14 ;
295297 } ) ;
296298 }
297299
@@ -552,6 +554,15 @@ export class Workspace {
552554 }
553555 }
554556
557+ get fontSize ( ) {
558+ return this . #fontSize;
559+ }
560+
561+ set fontSize ( value : number ) {
562+ this . #fontSize = value ;
563+ localStorage . setItem ( 'fontSize' , value . toString ( ) ) ;
564+ }
565+
555566 #create_directories( item : Item ) {
556567 // create intermediate directories as necessary
557568 const parts = item . name . split ( '/' ) ;
You can’t perform that action at this time.
0 commit comments