Custom CSS In Uploads Folder

If the theme is generating CSS based on theme options then it might choose to do this. Say your theme lets you pick a ‘primary colour’. It might want to style lots of elements in this colour. To do this it would need to output CSS with certain values substituted with your chosen colour.

If it’s a small amount of CSS the theme might generate it on the fly for every load by just outputting CSS in the header with PHP tags used to output the values. Or it could substitute the values into some CSS when the setting is saved and save the result in the database. Then it might just output the saved CSS in the header.

If there’s a large amount of CSS then it might take too long to generate on the fly, or take up too much space in the database. So it might make more sense to save it as a file. This is not an unreasonable thing to do.

So yes, there is a use case for this and I wouldn’t describe it as “poor practice”.

Since you mentioned LESS. LESS is a CSS preprocessor that, for example, would let you write CSS with variables in it. So @primary anywhere you want to use a particular colour called ‘primary’.

A theme could use the PHP LESS library to process a LESS file like this but substitute the variables with the values for your settings in the database. After processing the LESS the theme could then save the result as a CSS file (possibly minified) and enqueue that to load the styles.

As for why it’s in the uploads directory? That would be because it’s the only place in WordPress a plugin can be guaranteed to have permission to write to.