Render custom css in public view
This commit is contained in:
parent
c8d9901a1e
commit
ef49386b1f
|
@ -10,6 +10,7 @@ import { setupSearchFilters } from '../setupListeners/search';
|
|||
|
||||
export function renderAll() {
|
||||
renderTheme();
|
||||
renderCustomCSS();
|
||||
renderDictionaryDetails();
|
||||
renderPartsOfSpeech();
|
||||
sortWords();
|
||||
|
@ -21,6 +22,20 @@ export function renderTheme() {
|
|||
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() {
|
||||
renderName();
|
||||
showSection('description');
|
||||
|
|
Loading…
Reference in New Issue