1 of 2

function wpdocs_theme_name_scripts() {

//this is example folder path $cssFolderPath = dirname(FILE)."/assets/css/";

$fileNames = array();
foreach (new DirectoryIterator($cssFolderPath) as $file) {

    $filetype = pathinfo($file, PATHINFO_EXTENSION);

    if ($file->isFile() && $filetype == "css") {

        array_push($fileNames, $file->getFilename());
    }
}

foreach ($fileNames as $name){
    wp_enqueue_style( $name, "/wp-content/css_folder_path/".$name );
}

} add_action( 'wp_enqueue_scripts', 'wpdocs_theme_name_scripts' );