update font size

This commit is contained in:
Elizabeth Hunt 2024-03-04 17:00:28 -07:00
parent d74523d15d
commit ccc1e182cf
Signed by: simponic
GPG Key ID: 52B3774857EB24B1
2 changed files with 25 additions and 1 deletions

11
src/css/editor.css Normal file
View File

@ -0,0 +1,11 @@
@import url("./colors.css");
.code {
width: 100%;
font-size: 1.5rem;
}
.syntax-error {
color: var(--red);
background-color: var(--yellow);
}

View File

@ -19,7 +19,13 @@ import {
} from "../components"; } from "../components";
import { Coord2D, Direction } from "../interfaces"; import { Coord2D, Direction } from "../interfaces";
import { openModal, closeModal } from "../utils"; import { openModal, closeModal } from "../utils";
import { EditorState, StateField, StateEffect, Range } from "@codemirror/state"; import {
EditorState,
StateField,
StateEffect,
Range,
Extension,
} from "@codemirror/state";
import { Decoration, EditorView, keymap } from "@codemirror/view"; import { Decoration, EditorView, keymap } from "@codemirror/view";
import { defaultKeymap } from "@codemirror/commands"; import { defaultKeymap } from "@codemirror/commands";
import rainbowBrackets from "rainbowbrackets"; import rainbowBrackets from "rainbowbrackets";
@ -48,6 +54,12 @@ const highlightExtension = StateField.define({
}, },
provide: (f) => EditorView.decorations.from(f), provide: (f) => EditorView.decorations.from(f),
}); });
const FontSizeTheme = EditorView.theme({
$: {
fontSize: "20pt",
},
});
const FontSizeThemeExtension: Extension = [FontSizeTheme];
export class LambdaFactory extends Entity { export class LambdaFactory extends Entity {
private static spriteSpec: SpriteSpec = SPRITE_SPECS.get( private static spriteSpec: SpriteSpec = SPRITE_SPECS.get(
@ -218,6 +230,7 @@ export class LambdaFactory extends Entity {
keymap.of(defaultKeymap), keymap.of(defaultKeymap),
rainbowBrackets(), rainbowBrackets(),
highlightExtension, highlightExtension,
FontSizeThemeExtension,
], ],
}); });