CSS2LESS – PHP class

If you are a PHP developer who also works in frontend stuff you should learn about LESS (Leaner CSS) which is a CSS pre-processor and it allows you to make CSS more maintainable.

I’ve found a cool PHP class which can convert CSS into programmable CSS with LESS syntax. It can parse a given CSS style sheet and extract certain common property constant values to turn them into variables in the converted output using LESS.

Currently it turns the CSS properties into LESS variables: color, width, height, font-family and font-size.

You can find this class here.

I was playing with it and it works like a charm! 😀