populates theme selections
428055
function populateThemes(){
		this.preferences.getTheme(function(themeStyles) {
			var selectElement = document.getElementById('editorTheme');//$NON-NLS-0$
			while (selectElement.hasChildNodes() ){
				selectElement.removeChild(selectElement.lastChild);
			}
			for (var i =0; i < themeStyles.styles.length; i++) {
				var option = document.createElement('option');
				option.setAttribute('value', themeStyles.styles[i].name);
				//checks if a theme is the current theme 
				if (themeStyles.styles[i].name === themeStyles.style.name){
					option.setAttribute('selected', 'true');
				}
				option.appendChild(document.createTextNode(themeStyles.styles[i].name));
				selectElement.appendChild(option);
			}
			this.selectTheme(themeStyles.style.name);
		}.bind(this));
	}
160714
def add_options(self):
        
        super(ThemeSwitcher, self).add_options()

        self.add_bool_option("-l", "--list",
            help="list available themes")
        self.add_bool_option("-c", "--current",
            help="print path to currently selected theme")
        self.add_bool_option("-n", "--next",
            help="rotate through selected themes, and print new path")
        self.add_bool_option("-a", "--all",
            help="remove any selections, and use all themes")
        self.add_value_option("-t", "--toggle", "NAME",
            help="toggle selection of a theme")
855723
function importThemes(req, res, next) {
  var options = req.connectionOptions;

  var themesToImport = req.body || [];

  if (!_.isArray(req.body)) {
    return next("Expected An Array Of Themes");
  }

  forms.importThemes(options, themesToImport, resultHandler(constants.resultTypes.themes, req, next));
}
348504
protected function _setTheme()
    {
        $theme = $this->request->getParam('theme');
        if ($theme) {
            $this->viewBuilder()->setTheme($theme);
        }
    }
1134940
def get_random_theme(dark=True):
    """"""
    themes = [theme.path for theme in list_themes(dark)]
    random.shuffle(themes)
    return themes[0]
257141
public static function init() {

		if ( self::can_switch_themes() ) {
			add_action( 'admin_bar_menu', array( __CLASS__, 'admin_bar_menu' ), 90 );
			add_action( 'wp_ajax_tts_set_theme', array( __CLASS__, 'set_theme' ) );
		}

		load_plugin_textdomain( 'toolbar-theme-switcher', false, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/lang' );
	}
44122
public function theme()
    {
        $keys = [
            'Theme_id'
        ];

        /** @var ThemeSettingsTable $ThemeSettings */
        $ThemeSettings = $this->loadModel('Wasabi/Cms.ThemeSettings');

        $settings = $ThemeSettings->getKeyValues(new GeneralSetting(), $keys);

        if ($this->request->is('post') && !empty($this->request->data)) {
            $settings = $ThemeSettings->newEntity($this->request->data);
            if (!$settings->errors()) {
                if ($ThemeSettings->saveKeyValues($settings, $keys)) {
                    $this->Flash->success(__d('wasabi_cms', 'The theme settings have been updated.'));
                    $this->redirect(['action' => 'theme']);
                    return;
                } else {
                    $this->Flash->error($this->dbErrorMessage);
                }
            } else {
                $this->Flash->error($this->formErrorMessage);
            }
        }
        $this->set([
            'settings' => $settings,
            'themes' => ThemeManager::getThemesForSelect()
        ]);
    }
100930
function(themeName, extOptions) {
        var options = presetOptions[themeName];

        if (!options) {
            options = presetOptions[themeNameConst.DEFAULT];
        }
        options = $.extend(true, {}, options, extOptions);
        setDocumentStyle(options);
    }
1214508
protected function setThemeProperties()
    {
        $this->theme_frontend = $this->config('theme', 'frontend');
        $this->theme_backend = $this->config('theme_backend', 'backend');

        if ($this->is_backend) {
            $this->theme = $this->theme_backend;
        } elseif ($this->is_install) {
            $this->theme = $this->theme_frontend;
        } elseif (!empty($this->current_store)) {
            $this->theme_frontend = $this->store->getConfig('theme');
            $this->theme = $this->theme_frontend;
        }

        $this->hook->attach('theme', $this);

        if (empty($this->theme)) {
            $this->response->outputError404();
        }

        $this->current_theme = $this->module->getInfo($this->theme);

        if (empty($this->current_theme)) {
            $this->response->outputError404();
        }

        $this->theme_settings = (array) $this->getModuleSettings($this->theme, null, array());
        $this->templates = $this->getDefaultTemplates();

        if (!empty($this->current_theme['data']['templates'])) {
            $this->templates = array_merge($this->templates, $this->current_theme['data']['templates']);
        }
    }
304599
private function loadTheme()
    {
        if ($this->isThemeCacheValid()) {
            return;
        }
        $this->invalidateCache();

        $themeDir = $this->app['filesystem']->getDir('themes://' . $this->get('general/theme'));

        $this->data['theme'] = $this->parseTheme($themeDir, $this->data['general']);
    }
725705
private function fillStyleAttributesWithMergedStyles()
    {
        foreach ($this->styleAttributesForNodes as $nodePath => $styleAttributesForNode) {
            $node = $this->visitedNodes[$nodePath];
            $currentStyleAttributes = $this->parseCssDeclarationsBlock($node->getAttribute('style'));
            $node->setAttribute(
                'style',
                $this->generateStyleStringFromDeclarationsArrays(
                    $currentStyleAttributes,
                    $styleAttributesForNode
                )
            );
        }
    }
752413
def get_available_themes():
    
    for d in settings.TEMPLATE_DIRS:
        for _d in os.listdir(d):
            if os.path.isdir(os.path.join(d, _d)) and is_theme_dir(_d):
                yield _d
816563
def theme(name='readthedocs'):
    """"""
    
    os.environ['SPHINX_THEME'] = name
    if os.environ['SPHINX_THEME'] == 'bootstrap':
        local('cp docs/source/_templates/layout_bootstrap.html docs/source/_templates/layout.html')
    elif name is 'readthedocs':
        return
    else:
        local('cp docs/source/_templates/layout_simple.html docs/source/_templates/layout.html')
1355294
public static function init()
    {
        foreach (self::$_registeredThemes as $registeredTheme) {
            $theme = self::_initializeTheme($registeredTheme);
            self::$_themes[$theme->id()] = $theme;
        }

        self::$_initialized = true;
    }
1252623
def list_themes(dark=True):
    """"""
    dark = "dark" if dark else "light"
    themes = os.scandir(os.path.join(MODULE_DIR, "colorschemes", dark))
    return [t for t in themes if os.path.isfile(t.path)]
213972
public function setup_on_after_setup_theme() {

		$this->_the_content_priority = absint( apply_filters( 'hogan/the_content_priority', 10 ) );

		// Append Flexible Content modules to the_content.
		add_filter( 'the_content', [ $this, 'append_modules_content' ], $this->_the_content_priority, 1 );

		// Index modules as post content in SearchWP.
		if ( true === apply_filters( 'hogan/searchwp/index_modules_as_post_content', true ) ) {
			add_filter( 'searchwp_pre_set_post', [ $this, 'populate_post_content_for_indexing' ] );
		}

		add_filter( 'acf/fields/wysiwyg/toolbars', [ $this, 'append_hogan_wysiwyg_toolbar' ] );
		add_filter( 'tiny_mce_before_init', [ $this, 'override_tinymce_settings' ] );

		if ( true === apply_filters( 'hogan/flexible_content_layouts_collapsed_by_default', false ) && is_admin() ) {
			add_action( 'acf/input/admin_footer', [ $this, 'append_footer_script_for_collapsed_flexible_content_layouts' ] );
		};

		add_filter( 'acf/fields/flexible_content/layout_title', [ $this, 'extend_layout_titles' ], 10, 3 );

	}
367251
function genStyleSection(style, styles, options) {
    if (shouldReplaceCurrentSection(style, styles, options)) {
        replaceWithSpacer(style);
    }

    // Remove the 'id', theme' and 'replace' attributes from the output set of
    // attributes since they're not really valid SFC <style> attributes
    _.set(style, 'attrs', _.omit(style.attrs, 'id', 'theme', 'replace'));

    return genSection('style', style);
}