Register a CSS stylesheet
@param $handle
@param $src
@param array $deps
@param bool $ver
@param string $media
@return mixed
@throws \ErrorException
347931
public function wpRegisterStyle($handle, $src, $deps = [], $ver = false, $media = 'all')
    {
        return $this->callGlobalFunction('wp_register_style', [$handle, $src, $deps, $ver, $media]);
    }
690052
public function _set_defer( $tag, $handle, $src ) {
		$handles = apply_filters( 'inc2734_wp_page_speed_optimization_defer_scripts', [] );

		if ( ! in_array( $handle, $handles ) ) {
			return $tag;
		}

		return str_replace( ' src', ' defer src', $tag );
	}
129923
public function addCSS(string $stylesheet, $media = "screen")
    {
        $stylesheet = $this->stripSuffix($stylesheet, ".min", ".css");
        $this->CSS[$stylesheet] = array("path" => $stylesheet, "media" => $media);
        return $this;
    }
1311095
public function registerCssFile($url, $media = '')
    {
        if (($cs = $this->getClientScript()) === false) {
            return null;
        }
        if (isset($this->_assetsUrl)) {
            $url = $this->_assetsUrl . '/' . ltrim($url, '/');
        }
        return $cs->registerCssFile($url, $media);
    }
685293
protected function enqueue_style( $style, $hook = null ) {
		if ( $style['condition']( $hook ) ) {
			wp_enqueue_style(
				$style['handle'],
				$this->url . $style['src'] . $this->min . '.css',
				isset( $style['deps'] ) ? $style['deps'] : array(),
				$this->version,
				isset( $style['media'] ) ? $style['media'] : 'all'
			);
		}
	}
674631
public function stylesheet($src, $attributes = [])
    {
        $attributes['rel'] = 'stylesheet';
        $attributes['href'] = $src;
        $tag = new Tag('link', $attributes);
        return $tag;
    }
1356894
function compileCss(src, dest) {
  gulp
    .src(src)
    .pipe(plumber(config.plumberOptions))
    .pipe(gulpif(!config.production, sourcemaps.init()))
    .pipe(sass({
      outputStyle: config.production ? 'compressed' : 'expanded',
      precision: 5
    }))
    .pipe(postcss(processors))
    .pipe(gulpif(config.production, rename({
      suffix: '.min',
      extname: '.css'
    })))
    .pipe(gulpif(!config.production, sourcemaps.write()))
    .pipe(gulp.dest(dest));
}
724617
public function appendStylesheet($href, $media = null, $conditional = '')
    {
        return $this->_setStylesheet($href, $media, false, $conditional);
    }
695288
protected function loadMainStyleByHandle($mainHandle)
    {
        $deps = $this->getStyleDeps($mainHandle);

        if (file_exists(sprintf('%s/css/%s.css', $this->paths->getThemeAssetsDir(), $mainHandle))) {
            $mainSrc = sprintf('%s/css/%s.css', $this->paths->getThemeAssetsUri(), $mainHandle);
        } else {
            // load styles in case we need to load dependencies
            $mainSrc = sprintf('%s/css/%s.css', $this->paths->getBaseAssetsUri(), $mainHandle);
        }

        $this->loadStyle($mainHandle, $mainSrc, $deps);
    }
443650
function createCSS(sel, decl, media, newStyle) {
		if (ua.ie && ua.mac) { return; }
		var h = doc.getElementsByTagName("head")[0];
		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
		var m = (media && typeof media == "string") ? media : "screen";
		if (newStyle) {
			dynamicStylesheet = null;
			dynamicStylesheetMedia = null;
		}
		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
			// create dynamic stylesheet + get a global reference to it
			var s = createElement("style");
			s.setAttribute("type", "text/css");
			s.setAttribute("media", m);
			dynamicStylesheet = h.appendChild(s);
			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
			}
			dynamicStylesheetMedia = m;
		}
		// add style rule
		if (ua.ie && ua.win) {
			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
				dynamicStylesheet.addRule(sel, decl);
			}
		}
		else {
			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
			}
		}
	}
538233
public function _builded( $tag, $handle, $src ) {
		$handles = apply_filters( 'inc2734_wp_page_speed_optimization_builded_scripts', [] );

		if ( ! in_array( $handle, $handles ) ) {
			return $tag;
		}

		return sprintf(
			'<script>
			document.addEventListener("DOMContentLoaded", function(event) {
				var s=document.createElement("script");
				s.src="%s";
				s.async=true;document.body.appendChild(s);
			});
			</script>',
			$src
		);
	}
712654
public static function cssLinkTag($href, $media = 'screen')
    {
        if (strpos($href, 'http') === false and strpos($href, '//') === false) {
            $href = Request::basePath($href);
        }
        return '<link rel="stylesheet" href="' . $href . '" media="' . $media . '">' . PHP_EOL;
    }
1034833
private function _completeItem ($path, $media, $render, $doNotMinify) {
		if (self::$fileChecking) {
			if (!$path) $this->exception('Path to *.css can\'t be an empty string.');
			if (!in_array($media, self::$_allowedMediaTypes, TRUE)) $this->exception('Media could be only values: ' . implode(', ', self::$_allowedMediaTypes) . '.');
			$duplication = $this->_isDuplicateStylesheet($path);
			if ($duplication) $this->warning("Style sheet '$path' is already added in css group: '$duplication'.");
		}
		return (object) [
			'path'			=> $path,
			'media'			=> $media,
			'render'		=> $render,
			'doNotMinify'	=> $doNotMinify,
		];
	}
636892
public function loadScript($handle, $url, array $deps = [], $footer = true)
    {
        wp_register_script($handle, $url, $deps, $this->version, $footer);
        wp_enqueue_script($handle);
    }
334160
protected function stream_headers($handle, $headers) {
		// Why do we do this? cURL will send both the final response and any
		// interim responses, such as a 100 Continue. We don't need that.
		// (We may want to keep this somewhere just in case)
		if ($this->done_headers) {
			$this->headers = '';
			$this->done_headers = false;
		}
		$this->headers .= $headers;

		if ($headers === "\r\n") {
			$this->done_headers = true;
		}
		return strlen($headers);
	}
416649
public function addCss($relativeUrl, string $media = null, string $moduleNamespace = null, bool $prepend = false,
			array $attrs = null, $target = self::TARGET_HEAD) {
		if ($moduleNamespace === null) {
			$moduleNamespace = $this->view->getModuleNamespace();
		}
		
		$this->addCssUrl($this->view->getHttpContext()->getAssetsUrl($moduleNamespace)->ext($relativeUrl),
				$media, $prepend, $attrs, $target);
		
		return $this;
	}
580874
public function getThemeCustomizablePreset($handle)
    {
        $env = Environment::get();
        if ($this->isThemeCustomizable()) {
            $file = $env->getRecord(
                DIRNAME_THEMES.'/'.$this->getThemeHandle(
                ).'/'.DIRNAME_CSS.'/'.DIRNAME_STYLE_CUSTOMIZER_PRESETS.'/'.$handle.static::THEME_CUSTOMIZABLE_STYLESHEET_EXTENSION,
                $this->getPackageHandle()
            );
            if ($file->exists()) {
                $urlroot = $env->getURL(
                    DIRNAME_THEMES.'/'.$this->getThemeHandle().'/'.DIRNAME_CSS,
                    $this->getPackageHandle()
                );
                $preset = Preset::getFromFile($file->file, $urlroot);

                return $preset;
            }
        }
    }