Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS

I wanted to achieve the same thing.. What I ended up doing was creating a function that collects the Kirki variables (see here about the use of variables in Kirki) and writes them to a scss..

$file = get_template_directory() . '/sass/custom/_custom_vars_mixins_options.scss';

if(file_exists($file)){

    $output = "";

    $variables = Kirki::get_variables();
    foreach ( $variables as $variable => $vvalue ) {
        $output .= '$' . $variable . ': ' . $vvalue . ';' . PHP_EOL;
        //echo '@' . $variable . ':' . $value . ';';
    }

    file_put_contents($file, $output, FILE_TEXT )or die('<br />Error writing to custom options CSS file');

This function is called each time the user saves their settings in WP Customizer through the sanitization callback, hence writing all the custom user settings to the .scss file.