Using wp_filesystem in Plugins to store customizer settings

What you are trying to do is wrong if it is for general purpose use and is not tailored for the needs of a specific client. Dynamically modifying your theme’s code, and css is code like JS, is usually a bad idea that bring only maintenance problems – are you validating all values to be able to compile? How will you handle upgrades? How will you handle network installs where users don’t know the FTP credentials?

In addition to the theoretical reasons there are user expectations related to the UX of theme customization which do not involve writing files to the server.

If you truly need to save files on the server then the right place for them is the /wp-content/uploads directory.

The better way to do it is to have minimal LESS files that are relevant only to the options that are controlled by the user. once the options are changed you compile the LESS and store the generated CSS in an option and output it as part of each pages HTML, like most themes are doing with their customizable options.