SCSS code to prepend when compiling.

This is intended to be used by themes to inject SCSS code before it gets compiled.

@return string The SCSS code to inject.
340804
protected function get_pre_scss_code() {
        $content = '';

        // Getting all the candidate functions.
        $candidates = array();
        foreach ($this->parent_configs as $parent_config) {
            if (!isset($parent_config->prescsscallback)) {
                continue;
            }
            $candidates[] = $parent_config->prescsscallback;
        }
        $candidates[] = $this->prescsscallback;

        // Calling the functions.
        foreach ($candidates as $function) {
            if (function_exists($function)) {
                $content .= "\n/** Pre-SCSS from $function **/\n" . $function($this) . "\n";
            }
        }

        return $content;
    }
781791
public function prepend()
    {
        $script = $this->parseArgs(func_get_args());
        if ($script !== false && !in_array($script, $this->members)) array_unshift($this->members, $script);
    }
837013
public static function _css()
	{
		if ( !self::$_firstRun ) return '';
		self::$_firstRun = false;

		$baseDir = KINT_DIR . 'view/inc/';

		if ( !is_readable( $cssFile = $baseDir . self::$theme . '.css' ) ) {
			$cssFile = $baseDir . 'original.css';
		}

		return '<script>' . file_get_contents( $baseDir . 'kint.js' ) . '</script>'
			. '<style>' . file_get_contents( $cssFile ) . "</style>\n";
	}
1196657
protected function getScssVars() {

		$sass = '';

		// Required
		foreach ( $this->requiredSassVars as $var ) {
			$method = $this->varToGetter( $var );

			if ( ! method_exists( $this->input, $method ) ) {
				throw new \LogicException( "Input::{$method}() not found." );
			}
			if ( empty( $this->input->{$method}() ) ) {
				throw new \InvalidArgumentException( "Input::{$method}() cannot be empty." );
			}

			$sass .= "\${$var}: " . $this->input->{$method}() . ";\n";
		}

		// Optional
		foreach ( $this->optionalSassVars as $var ) {
			$method = $this->varToGetter( $var );

			if ( method_exists( $this->input, $method ) && ! empty( $this->input->{$method}() ) ) {
				$sass .= "\${$var}: " . $this->input->{$method}() . ";\n";
			}
		}

		return $sass;
	}
698881
public function forTemplate()
    {
        $link = '';
        if ($this->LinkURL) {
            $link = $this->renderWith($this->RenderTemplates);
        }
        $this->extend('updateTemplate', $link);
        return $link;
    }
1272441
public function jsRender()
    {
        $pre = '';

        if ($this->preventDefault) {
            $this->fx_args = ['event'];
            $pre .= "\n".$this->indent.'  event.preventDefault();';
        }

        if ($this->stopPropagation) {
            $this->fx_args = ['event'];
            $pre .= "\n".$this->indent.'  event.stopPropagation();';
        }

        $output = 'function('.implode(',', $this->fx_args).') {';
        $output .= $pre;
        foreach ($this->fx_statements as $statement) {
            if (!$statement) {
                // null passed
                continue;
            }

            if ($statement instanceof jsChain && !$statement->_chain) {
                // chain contains no statements, so probably is useless
                continue;
            }

            if ($statement instanceof jsExpressionable) {
                $statement = $statement->jsRender();
            } else {
                throw new Exception(['Incorrect statement for jsFunction.', 'statement' => $statement]);
            }

            $output .= "\n".$this->indent.'  '.$statement.';';
        }

        $output .= "\n".$this->indent.'}';

        return $output;
    }
886656
public function getScript() {
		$jsCode="$('".$this->attachTo." a').click(function (event) { event.preventDefault();$(this).tab('show');});";
		$this->jquery_code_for_compile []=$jsCode;
		$this->compileEvents();
		return $this->compileJQueryCode();
	}
948254
public function GetAffilateCode()
    {
        $sCode = false;
        if (array_key_exists(TdbShop::SESSION_AFFILIATE_CODE, $_SESSION)) {
            $sCode = $_SESSION[TdbShop::SESSION_AFFILIATE_CODE];
        }

        return $sCode;
    }
411929
public function getHashCode()
    {
        $hashConditionals = '';
        foreach ($this->_conditionalStyles as $conditional) {
            $hashConditionals .= $conditional->getHashCode();
        }

        return md5(
              $this->_fill->getHashCode()
            . $this->_font->getHashCode()
            . $this->_borders->getHashCode()
            . $this->_alignment->getHashCode()
            . $this->_numberFormat->getHashCode()
            . $hashConditionals
            . $this->_protection->getHashCode()
            . ($this->_quotePrefix  ? 't' : 'f')
            . __CLASS__
        );
    }
1131545
public function getStyle()
	{
		$values = array();

		if ($this->fgColor)
		{
			$values[] = $this->fgColor;
		}

		if ($this->bgColor)
		{
			$values[] = $this->bgColor;
		}

		foreach ($this->options as $option)
		{
			$values[] = static::$knownOptions[$option];
		}

		return implode(';', $values);
	}
1336189
public function prepend()
    {
        $this->importNodes(\func_get_args(), function ($node, $imported_node) {
            $node->insertBefore($imported_node, $node->childNodes->item(0));
        });

        return $this;
    }
300134
public function getContentCSS()
    {
        // Prioritise instance specific content
        if (isset($this->contentCSS)) {
            return $this->contentCSS;
        }

        // Add standard editor.css
        $editor = [];
        $editorCSSFiles = $this->config()->get('editor_css');
        if ($editorCSSFiles) {
            foreach ($editorCSSFiles as $editorCSS) {
                $editor[] = $editorCSS;
            }
        }

        // Themed editor.css
        $themes = HTMLEditorConfig::getThemes() ?: SSViewer::get_themes();
        $themedEditor = ThemeResourceLoader::inst()->findThemedCSS('editor', $themes);
        if ($themedEditor) {
            $editor[] = $themedEditor;
        }
        return $editor;
    }
165403
public function assemble() {
		$scripts = [];
		
		if (! empty($this->resources)) {
			foreach ($this->resources as $resource) {
				$scripts[] = $this->renderTag($resource);
			}
		}
		
		if (! empty($this->packages)) {
			foreach ($this->packages as $package) {
				$package->assemble();
				$scripts[] = $this->renderTag($package);
			}
		}
		
		if (empty($scripts)) {
			return '';
		}
		
		return implode(PHP_EOL, $scripts);
	}
284321
public function renderStyles()
    {
        $this->loadPackageCss();

        if (empty($this->styles)) {
            return PHP_EOL;
        }

        $assets = [];

        foreach ($this->sort($this->styles) as $handle => $data) {
            $assets[] = $this->getCss($handle);
        }

        return implode(PHP_EOL, $assets);
    }
1105867
protected function kneadCss() {

		$styles = Container::get( 'Styles' );

		$scss = \Pressbooks\Utility\get_contents( $this->exportStylePath );

		$custom_styles = $styles->getPrincePost();
		if ( $custom_styles && ! empty( $custom_styles->post_content ) ) {
			// append the user's custom styles to the theme stylesheet prior to compilation
			$scss .= "\n" . $custom_styles->post_content;
		}

		$css = $styles->customize( 'prince', $scss, $this->cssOverrides );

		$css = normalize_css_urls( $css, $this->urlPath() );

		if ( WP_DEBUG ) {
			Container::get( 'Sass' )->debug( $css, $scss, 'prince' );
		}

		return $css;
	}
1084781
public function getScript() {
		$this->jquery_code_for_compile=array ();
		foreach ( $this->jsCodes as $jsCode ) {
			$this->jquery_code_for_compile []=$jsCode->compile(array (
					"identifier" => $this->attachTo
			));
		}
		$this->compileEvents();
		return $this->compileJQueryCode();
	}
1346056
public function onBeforeInit() {
        $only_dev = LessCompilerConfig::config()->only_dev;
        
        // Only check and compile either on dev, or on all environments (if set)
        if (!$only_dev || $only_dev && Director::isDev()) {

            // Allow extensions for before less is compiled
            $this->owner->extend("onBeforeLessCompiler");

            $files = LessCompilerConfig::config()->file_mappings;
            $root_path = LessCompilerConfig::config()->root_path;
            $temp_folder = TEMP_FOLDER;
            
            if (is_array($files)) {
                $theme_dir = Controller::join_links(
                    "themes",
                    SSViewer::current_theme()
                );
                $base_theme = Controller::join_links(
                    $theme_dir,
                    SSViewer::current_theme()
                );
                
                $options = array('cache_dir' => $temp_folder);
                
                if (LessCompilerConfig::config()->compress) {
                    $options['compress'] = true;
                }
                
                // First loop through all files and deal with inputs
                foreach ($files as $input => $output) {
                    if ($input && $output) {
                        
                        // Does output and input contain a path
                        if (strpos($input, '/') === false) {
                            $input = Controller::join_links(
                                $theme_dir,
                                "less",
                                $input
                            );
                        }
                        
                        if (strpos($output, '/') === false) {
                            $output = Controller::join_links(
                                $theme_dir,
                                "css",
                                $output
                            );
                        }
                        
                        // Now append the full system path to the input
                        // and output file.
                        $input = Controller::join_links(BASE_PATH, $input);
                        $output = Controller::join_links(BASE_PATH, $output);
                        
                        // Finally try to compile our less files
                        try {
                            $css_file_name = Less_Cache::Get(
                                array( $input => $root_path),
                                $options
                            );
                            $css = file_get_contents(Controller::join_links($temp_folder,$css_file_name));
                            
                            $output_file = fopen($output, "w");
                            fwrite($output_file, $css);
                            fclose($output_file);
                        } catch (exception $e) {
                            error_log($e->getMessage());
                        }
                    }
                }
            }

            // Allow extensions for after less has compiled
            $this->owner->extend("onAfterLessCompiler");
        }
    }