A really useful class which is more than yet-another minifier, since it adds some additioal intelligence such as processing @import directives, inlining image data and adding automatically browser-specific styles.
Each compressed css is cached and you are free to do whatever you want with the cached results : use them as is, or inline them in your html page (as described by the example), thus avoiding additional http requests.
Victor V. Nabatov - 2016-04-12 13:34:48 - In reply to message 1 from Christian Vigh
Excuse me, please, but for you I have by mistake sent the message to other programmer. I hope, he won't take offense!
The message for you:
Many thanks for a review of my work!
I try to carry out what, in my opinion, really is required for programmers and designers. I think that it is necessary to expand the list of the processed functions, directives, properties and etc. If suddenly you have ideas or critical remarks, I will be glad to your participation.
Once again thanks for your attention to my work! In turn, I wish you success in intellectual work of the programmer!
Christian Vigh - 2016-04-12 18:13:22 - In reply to message 2 from Victor V. Nabatov
I also try to carry out useful things to help programmers and developers to achieve their work more rapidly and concentrate on their applicative work.
And I do have some ideas that maybe we could share. In fact, I developped classes to include css and js contents from the php side, when building the page. Everything is minified with simple minifiers I developed (my css one is not as elaborated as yours, and I found lots of interesting ideas in yours).
One of the ideas I could share with you is grouping css/js files
that reside in the same directory (this is really important when you use relative paths within them), so that only one http request is performed for each group of file (this behavior is defined by the site configuration). Js files do have file inclusion support, not css ones because at the time I developed that, I had no idea of what would be a recognized as a file-inclusion directive within a js file.
I did not yet publish these classes because they are currently integrated into a framework of mine and I did not took the time so far to make it a standalone and independent package.
All of this verbose dissertation to say that we may have some ideas to share ; on my side, I'm feeling really impressed with your css handling, including features I was not aware of, such as inlining image data.
Moreover, you have tried to be as complete as possible.
And, finally, inlining seems so interesting to test : the example you gave, which replaces <link> tags with <style> contents should really be a feature to integrate into your class : take an html page and spit out the preprocessed contents. I would add some preprocessing options, such as inline image data or not, or others I do not foresee so far. Maybe a look at the features provided by the less utility could help.
This is to say that if you're interested into sharing about our respective approaches, I will be totally ok with that.
And now, it's my turn to wish you the best in the intellectual work of a developer !