mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-24 05:57:17 -04:00
better theme style handling
This commit is contained in:
@@ -6,19 +6,6 @@ import HeadCommonNew from '../../components/HeadCommonNew.astro';
|
||||
<html lang="en" class="dark">
|
||||
<head>
|
||||
<!-- <HeadCommonNew /> -->
|
||||
<style>
|
||||
:root {
|
||||
--background: #222;
|
||||
--lineBackground: #22222299;
|
||||
--foreground: #fff;
|
||||
--caret: #ffcc00;
|
||||
--selection: rgba(128, 203, 196, 0.5);
|
||||
--selectionMatch: #036dd626;
|
||||
--lineHighlight: #00000050;
|
||||
--gutterBackground: transparent;
|
||||
--gutterForeground: #8a919966;
|
||||
}
|
||||
</style>
|
||||
<title>Strudel Vanilla REPL</title>
|
||||
<script src="@strudel/repl"></script>
|
||||
</head>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { hash2code, logger } from '@strudel.cycles/core';
|
||||
import { activateTheme, initTheme } from '@strudel/codemirror';
|
||||
import './vanilla.css';
|
||||
|
||||
let editor;
|
||||
@@ -16,7 +15,6 @@ const initialSettings = {
|
||||
fontFamily: 'monospace',
|
||||
fontSize: 18,
|
||||
};
|
||||
initTheme(initialSettings.theme);
|
||||
|
||||
async function run() {
|
||||
const repl = document.getElementById('editor');
|
||||
@@ -129,6 +127,4 @@ setFormValues(form, initialSettings);
|
||||
form.addEventListener('change', () => {
|
||||
const values = getFormValues(form, initialSettings);
|
||||
editor?.updateSettings(values);
|
||||
// TODO: only activateTheme when it changes
|
||||
activateTheme(values.theme);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user