diff --git a/apps/remix-ide/src/app/tabs/theme-module.js b/apps/remix-ide/src/app/tabs/theme-module.js index 0e29f5a83f..d3f5e9a98c 100644 --- a/apps/remix-ide/src/app/tabs/theme-module.js +++ b/apps/remix-ide/src/app/tabs/theme-module.js @@ -2,10 +2,6 @@ import { Plugin } from '@remixproject/engine' import { EventEmitter } from 'events' import QueryParams from '../../lib/query-params' import * as packageJson from '../../../../../package.json' -import ReactDOM from 'react-dom' -// eslint-disable-next-line no-use-before-define -import React from 'react' -import yo from 'yo-yo' const _paq = window._paq = window._paq || [] const themes = [ @@ -68,7 +64,11 @@ export class ThemeModule extends Plugin { if (this.active) { const nextTheme = this.themes[this.active] // Theme document.documentElement.style.setProperty('--theme', nextTheme.quality) - const theme = yo`` + + const theme = document.createElement('link') + theme.setAttribute('rel', 'stylesheet') + theme.setAttribute('href', nextTheme.url) + theme.setAttribute('id', 'theme-link') theme.addEventListener('load', () => { if (callback) callback() }) @@ -91,9 +91,10 @@ export class ThemeModule extends Plugin { if (!this.forced) this._deps.config.set('settings/theme', next) document.getElementById('theme-link').remove() const theme = document.createElement('link') - theme.rel = 'stylesheet' - theme.id = 'theme-link' - theme.href = nextTheme.url + + theme.setAttribute('rel', 'stylesheet') + theme.setAttribute('href', nextTheme.url) + theme.setAttribute('id', 'theme-link') theme.addEventListener('load', () => { this.emit('themeLoaded', nextTheme) this.events.emit('themeLoaded', nextTheme)