move css variable injection to themes
+ prepare new HeadCommon in extra file
This commit is contained in:
parent
49906e98b7
commit
8959c630ae
6 changed files with 103 additions and 8 deletions
|
|
@ -1,7 +1,3 @@
|
|||
:root {
|
||||
--foreground: white;
|
||||
}
|
||||
|
||||
body,
|
||||
input {
|
||||
font-family: monospace;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { logger, getDrawContext, silence, controls, evalScope, hash2code, code2hash } from '@strudel.cycles/core';
|
||||
import { StrudelMirror } from '@strudel/codemirror';
|
||||
import { StrudelMirror, initTheme, activateTheme } from '@strudel/codemirror';
|
||||
import { transpiler } from '@strudel.cycles/transpiler';
|
||||
import {
|
||||
getAudioContext,
|
||||
|
|
@ -24,6 +24,7 @@ const initialSettings = {
|
|||
fontFamily: 'monospace',
|
||||
fontSize: 18,
|
||||
};
|
||||
initTheme(initialSettings.theme);
|
||||
|
||||
async function run() {
|
||||
const container = document.getElementById('code');
|
||||
|
|
@ -196,4 +197,6 @@ form.addEventListener('change', () => {
|
|||
const values = getFormValues(form, initialSettings);
|
||||
// console.log('values', values);
|
||||
editor.updateSettings(values);
|
||||
// TODO: only activateTheme when it changes
|
||||
activateTheme(values.theme);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue