1. Go to this page and download the library: Download digitalisweb/sassy 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/ */
define('SASSY_WRITE_SOURCE', 'edit_theme_options');
add_filter('sassy-write-source', fn () => current_user_can('dev')); // or, for anything a constant cannot say
add_action('sassy-register', function () {
Sassy\Extensions::register_variables('my-theme', function (array $variables, Sassy\Asset $asset) {
$variables['brand'] = '#ff0000';
return $variables;
});
});
Sassy\Extensions::register_post_processor('my-minifier', function ($css, $context) {
if (!$binary_exists) {
$context->warn('my-minifier did not run; the CSS is unprocessed.');
return $css;
}
return minify($css);
});
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.