MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / createTheme

Method createTheme

src/lib/acode.js:160–184  ·  view source on GitHub ↗
({
			styles,
			dark = false,
			highlightStyle,
			extensions = [],
		} = {})

Source from the content-addressed store, hash-verified

158 };
159
160 const createTheme = ({
161 styles,
162 dark = false,
163 highlightStyle,
164 extensions = [],
165 } = {}) => {
166 const ext = [];
167
168 if (styles && typeof styles === "object") {
169 ext.push(cmView.EditorView.theme(styles, { dark: !!dark }));
170 }
171
172 const resolvedHighlight = createHighlightStyle(highlightStyle);
173 if (resolvedHighlight) {
174 ext.push(cmLanguage.syntaxHighlighting(resolvedHighlight));
175 }
176
177 if (Array.isArray(extensions)) {
178 ext.push(...extensions);
179 } else if (extensions) {
180 ext.push(extensions);
181 }
182
183 return ext;
184 };
185
186 const editorThemesModule = {
187 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected