Example of WordPress plugin code generating URL and disk path for theme specific files

Looking through WP-LESS source to find some inspiration on how to generate customized CSS by way of a WordPress plugin that can be stored on disk and served by HTTP. Mostly interested in how to determine the theme name and the upload (on disk) and upload URL (for the CSS link). Code snippet below courtesy of Oncle Tom.

https://gist.github.com/576829

Tags: css, stylesheet, wordpress, wp