HEX
Server: Apache
System: Linux server.mart2global.com 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User: henzergrouphenz (1442)
PHP: 7.4.28
Disabled: NONE
Upload Files
File: /home/henzergrouphenz/public_html/wp-content/themes/metro/inc/traits/script.php
<?php
/**
 * @author  RadiusTheme
 * @since   1.0
 * @version 1.0
 */

namespace radiustheme\Metro;

trait Script_Trait {
	
	private function add_prefix_to_css( $css, $prefix ) {
	    $parts = explode('}', $css);
	    foreach ($parts as &$part) {
	        if (empty($part)) {
	            continue;
	        }

	        $firstPart = substr($part, 0, strpos($part, '{') + 1);
	        $lastPart = substr($part, strpos($part, '{') + 2);
	        $subParts = explode(',', $firstPart);
	        foreach ($subParts as &$subPart) {
	            $subPart = str_replace("\n", '', $subPart);
	            $subPart = $prefix . ' ' . trim($subPart);
	        }

	        $part = implode(', ', $subParts) . $lastPart;
	    }

	    $prefixedCSS = implode("}\n", $parts);

	    return $prefixedCSS;
	}

	private function output_css( $css ) {
		$css = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css );
		$css = str_replace( array( "\r\n", "\r", "\n", "\t", '  ', '    ', '    ' ), ' ', $css );
		return $css;
	}
}