Render custom css in public view
This commit is contained in:
parent
1cf547dd2e
commit
c07ae23f8a
|
@ -10,6 +10,7 @@ import { setupSearchFilters } from '../setupListeners/search';
|
||||||
|
|
||||||
export function renderAll() {
|
export function renderAll() {
|
||||||
renderTheme();
|
renderTheme();
|
||||||
|
renderCustomCSS();
|
||||||
renderDictionaryDetails();
|
renderDictionaryDetails();
|
||||||
renderPartsOfSpeech();
|
renderPartsOfSpeech();
|
||||||
sortWords();
|
sortWords();
|
||||||
|
@ -21,6 +22,20 @@ export function renderTheme() {
|
||||||
document.body.id = theme + 'Theme';
|
document.body.id = theme + 'Theme';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function renderCustomCSS() {
|
||||||
|
const { customCSS } = window.currentDictionary.settings;
|
||||||
|
const stylingId = 'customCSS';
|
||||||
|
const stylingElement = document.getElementById(stylingId);
|
||||||
|
if (!stylingElement) {
|
||||||
|
const styling = document.createElement('style');
|
||||||
|
styling.id = stylingId;
|
||||||
|
styling.innerHTML = customCSS;
|
||||||
|
document.body.appendChild(styling);
|
||||||
|
} else {
|
||||||
|
stylingElement.innerHTML = customCSS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function renderDictionaryDetails() {
|
export function renderDictionaryDetails() {
|
||||||
renderName();
|
renderName();
|
||||||
showSection('description');
|
showSection('description');
|
||||||
|
|
Loading…
Reference in New Issue