PHP code example of basteyy / scss-php-builder

1. Go to this page and download the library: Download basteyy/scss-php-builder 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/ */

    

basteyy / scss-php-builder example snippets



// Get composers autoloader
ew \basteyy\ScssPhpBuilder\ScssPhpBuilder();

// Add the input folder
$scss->addFolder(__DIR__.'/scss');

// Define the output file
$scss->addOutputeFile(__DIR__ . '/css/style.css');

// Define the scss starting point
$scss->addStartingFile(__DIR__ . '/scss/style.scss');

// Than compile the scss source
$scss->compileToOutputfile();
 

$scss->setOutputExpanded();
 


// Get composers autoloader
ew \basteyy\ScssPhpBuilder\ScssPhpBuilder();

// Add the input folder
$scss->addFolder(__DIR__.'/scss');

// Define the output file
$scss->addOutputeFile(__DIR__ . '/css/style.css');

// Define the scss starting point
$scss->addStartingFile(__DIR__ . '/scss/style.scss');

// If you like, you can acticate sourcemap by setup the remote url
$scss->setSourcemapFolderUrl('/css/');

// Than compile the scss source
$scss->compileToOutputfile();
 

$scss->compileToOutputfile(true);
 

$scss->getCompiledCode();
 

$scss->getCompiledCode(true);
 

// Construct the class
$scss = new \basteyy\ScssPhpBuilder\ScssPhpBuilder([
	'auto_create_folders' => true, 
	'auto_create_files' => true, 
	'write_source_map' => true
]);
composer