PHP code example of claudioldf / php-sass

1. Go to this page and download the library: Download claudioldf/php-sass library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

claudioldf / php-sass example snippets


function load_sass($assets, $target_file) {
	if (getenv('ENV') != 'production') {
		foreach($assets as $index => $file) {
			$file_append = ($index==0) ? false : true;
			SassCompiler::run($file, $target_file, "scss_formatter_compressed", $file_append);
		}
		return $target_file;
	} else {
		return $target_file;
	}
 }
 
 load_sass(
 	[
		"assets/scss/styles1.scss",
		"assets/scss/styles2.scss",
		...
	],
	"assets/css/style-join-all.css"
 );

SassCompiler::run("scss/", "css/");

if (getenv('APPLICATION_ENV') == 'development') {
    SassCompiler::run("scss/", "css/");
}
json
""claudioldf/php-sass": "2.0"
}