Показать сообщение отдельно
  #8 (permalink)  
Старый 18.05.2018, 17:10
Аспирант
Отправить личное сообщение для Vadim Zhizherin Посмотреть профиль Найти все сообщения от Vadim Zhizherin
 
Регистрация: 04.05.2018
Сообщений: 35

что не так? не робит :((
var includeStyle;
(function() {
    let styles = {
        light: 'light.css',
        dark: 'dark.css'
    };
    const ID = 'variable-stylesheet';

    includeStyle = function(light) {
        if (!styles[light])
            return;

        let node = document.getElementById(llight);
        if (node)
            node.parentNode.removeChild(node);

        node = document.createElement('light.css');
        node.rel = 'stylesheet';
        node.href = styles[light];
        node.id = llight;

        document.head.appendChild(node);
    };

      includeStyle = function(dark) {
        if (!styles[dark])
            return;

        let node = document.getElementById(ddark);
        if (node)
            node.parentNode.removeChild(node);

        node = document.createElement('dark.css');
        node.rel = 'stylesheet';
        node.href = styles[dark];
        node.id = ddark;

        document.head.appendChild(node);
    };
})();
Ответить с цитированием