Add theme features
513217
protected function registerSupports()
    {
        do_action("before_theme_add_supports");

        foreach ($this->getConfig("supports") as $feature => $enabled):
            if (!$enabled):
                continue;
            endif;
            add_theme_support($feature);
        endforeach;

        do_action("after_theme_add_supports");
    }
1087036
public function set_theme_suite_to_include_core_features($themetoset) {
        // If no value passed to --add-core-features-to-theme or ALL is passed, then set core features for all themes.
        if (!empty($themetoset)) {
            if (is_number($themetoset) || is_bool($themetoset) || (self::ALL_THEMES_TO_RUN === strtoupper($themetoset))) {
                $this->themesuitewithallfeatures = self::ALL_THEMES_TO_RUN;
            } else {
                $this->themesuitewithallfeatures = explode(',', $themetoset);
                $this->themesuitewithallfeatures = array_map('trim', $this->themesuitewithallfeatures);
            }
        }
    }
803312
def _load_themes(self):
        """"""
        with utils.temporary_chdir(utils.get_file_directory()):
            self._append_theme_dir("themes")
            self.tk.eval("source themes/pkgIndex.tcl")
            theme_dir = "gif" if not self.png_support else "png"
            self._append_theme_dir(theme_dir)
            self.tk.eval("source {}/pkgIndex.tcl".format(theme_dir))
        self.tk.call("package", "require", "ttk::theme::scid")
878103
def _apply_base_theme(app):
    

    if QT_VERSION < (5,):
        app.setStyle('plastique')
    else:
        app.setStyle('Fusion')

    with open(_STYLESHEET) as stylesheet:
        app.setStyleSheet(stylesheet.read())
587154
def use_theme(theme, directory=None):
    """"""
    repo = require_repo(directory)
    if theme not in list_themes(directory):
        raise ThemeNotFoundError(theme)

    old_theme = set_value(repo, 'theme', theme)
    return old_theme != theme
1143676
protected function registerTheme()
    {
        $this->app->singleton(
            'theme', 
            function ($app) {
                $loadDefaultLangPath = base_path('resources/lang');
                $app['path.lang'] = $loadDefaultLangPath;
                return new Manager($app['files']);
            }
        );
    }
1146203
private void applyTheme() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            setSeekBarColor(ThemeUtil.getColor(getContext(), R.attr.colorAccent));
        }
    }
618970
public static function setup_theme() {

		global $pagenow;

		if ( ( is_admin() && 'themes.php' == $pagenow ) || ! self::can_switch_themes() ) {
			return;
		}

		self::check_reset();
		self::load_cookie();

		if ( empty( self::$theme ) ) {
			return;
		}

		add_filter( 'pre_option_template', array( self::$theme, 'get_template' ) );
		add_filter( 'pre_option_stylesheet', array( self::$theme, 'get_stylesheet' ) );
		add_filter( 'pre_option_stylesheet_root', array( self::$theme, 'get_theme_root' ) );
		$parent = self::$theme->parent();
		add_filter( 'pre_option_template_root', array( empty( $parent ) ? self::$theme : $parent, 'get_theme_root' ) );
		add_filter( 'pre_option_current_theme', '__return_false' );
	}
1191469
protected function addThemePackageToRootComposer()
    {
        $composer = json_decode(file_get_contents(base_path('composer.json')), true);

        $composer['require'][$this->argument('name')] = '*';

        file_put_contents(
            base_path('composer.json'),
            json_encode($composer, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
        );
    }
296332
public function add_footer() {
		$screen = get_current_screen();
		if ( ! isset( $screen->parent_file ) ) {
			return;
		}
		if ( 'themes.php' !== $screen->parent_file ) {
			return;
		}
		if ( ! $this->product->is_theme() ) {
			return;
		}
		$version = $this->get_rollback();
		if ( empty( $version ) ) {
			return;
		}
		?>
		<script type="text/javascript">
			jQuery(document).ready(function ($) {
				setInterval(checkTheme, 500);

				function checkTheme() {
					var theme = '<?php echo esc_attr( $this->product->get_slug() ); ?>-action';

					if (jQuery('#' + theme).length > 0) {
						if (jQuery('.theme-overlay.active').is(':visible')) {
							if (jQuery('#' + theme + '-rollback').length === 0) {
								jQuery('.theme-actions .active-theme').prepend('<a class="button" style="float:left" id="' + theme + '-rollback" href="<?php echo esc_url( wp_nonce_url( admin_url( 'admin-post.php?action=' . $this->product->get_key() . '_rollback' ), $this->product->get_key() . '_rollback' ) ); ?>">Rollback to v<?php echo esc_attr( $version['version'] ); ?></a>')
							}
						}

					}
				}
			})

		</script>
		<?php

	}
1297272
protected function addStyleSheets()
	{
		// Initialize string for .css path
		$path = '';

		// Get .css path if defined in config file
		if ($this->getConfig('assets.paths.css'))
		{
			$path = $this->getConfig('assets.paths.css') . '/';
		}

		foreach ($this->stylesheets as $file => $options)
		{
			// Set default value for median attribute
			$media = 'all';

			// Set default value for conditional comments
			$cond = '';

			// Check in config file if stylesheet is an external resource
			$cdn = $this->getConfig('assets.cdn.'.$file);

			// Initialize string for file's url
			$href = '';

			// No conditional comment
			if (is_string($options) && $options)
			{
				$media = $options;
			}

			// Conditional comments are defined
			elseif(is_array($options))
			{
				// Check if value is not empty
				if (array_key_exists(1, $options) && $options[1])
				{
					// Get value for conditional comments
					$cond = $options[1];
				}

				// Check if value is not empty
				if (array_key_exists(0, $options) && $options[0])
				{
					// Get value for media attribute
					$media = $options[0];
				}
			}

			// Stylesheet is an external resource
			if ($cdn)
			{
				// Get file's url
				$href = $cdn;
			}

			// Stylesheet is a local resources + check if file exists
			elseif (File::exists(public_path($path.$file.'.css')))
			{
				// Get file's url
				$href = asset($path.$file.'.css');
			}

			// Check if url is not empty
			if ($href)
			{
				// Register link tag for this stylesheet
				$this->addOneLink('stylesheet', $href, '', array('media' => $media), $cond);
			}
		}
	}
186500
function() {
			if(that.settings.cssClass !== null) {
				that.bar.addClass(that.settings.cssClass);
			}
		}
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)]
424777
def format_theme(selection):
    """"""
    global themefile

    text = open(THEMEDIR + '/' + selection).read()
    if '!dotcolors' in text[:10]:
        themefile = text
        return

    lines = ['!dotcolors auto formatted\n']
    for line in text.split('\n'):
        lline = line.lower()
        background = 'background' in lline
        foreground = 'foreground' in lline
        color = 'color' in lline

        if background:
            if 'rgb' in line:
                # rbga: 0000/0000/0000/dddd
                rgb = line.split(':')[2].replace(' ', '')
                rgb = rgb_to_hex(rgb)
                lines.append('*background:\t%s' % rgb)
            else:
                lines.append('\t#'.join(line \
                                        .replace(' ', '') \
                                        .replace('\t', '') \
                                        .split('#')))

        if foreground:
            if 'rgb' in line:
                # rbga: 0000/0000/0000/dddd
                rgb = line.split(':')[2].replace(' ', '')
                rgb = rgb_to_hex(rgb)
                lines.append('*foreground:\t%s' % rgb)
            else:
                lines.append('\t#'.join(line \
                                        .replace(' ', '') \
                                        .replace('\t', '') \
                                        .split('#')))

        if color:
            if lline[0] != '!':
                lines.append('\t#'.join(line \
                                        .replace(' ', '') \
                                        .replace('\t', '') \
                                        .split('#')))
    
    themefile = '\n'.join(lines) + '\n'
    fd, tmpfile = tempfile.mkstemp()
    if exists( THEMEDIR + '/' + selection ):
        old = open( THEMEDIR + '/' + selection )
        new = os.fdopen(fd, 'w')
        os.write(fd, themefile)
        old.close()
        new.close()
        move( tmpfile, THEMEDIR + '/' + selection )
1011879
function add_css()
    {
        if ($this->css_loaded) {
            return;
        }

        $skin_path = $this->enigma->local_skin_path();
        $this->enigma->include_stylesheet("$skin_path/enigma.css");
        $this->css_loaded = true;
    }
1995
def theme_set(new):
    
    if (not isinstance(new, theme) and
            not issubclass(new, theme)):
        raise PlotnineError("Expecting object to be a theme")

    out = get_option('current_theme')
    set_option('current_theme', new)
    return out
934295
def _decorate(self):
        """"""
        self._set_view()
        self._make_graph()
        self._axes()
        self._legend()
        self._make_title()
        self._make_x_title()
        self._make_y_title()