We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5340
    • 1,624 Posts
    Hi,

    I finally got some time and mood to work on this snippet. It was not a lot of work since I copy pasted most of it from other css minify solutions.

    Please download test and let me know if works for you. A working solution here. Use firebug or View Source to see the difference in html.

    This solution is based on Minify: http://www.minifycss.com/
    I basically copied lib/Minify/CSS/Compressor.php file and made it work as a snippet for Modx. The caching is done by modx unless you disable it.

    Eg: [[MinCSS? &path=`/assets/mycss/` &files=`test1.css,test2.css`]]

    Installation:

    1. Upload the mincss folder to assets/snippets
    2. Create a new snippet MinCSS and paste the content of mincss.txt

    How it works:
    0. Create a template for your css page. The template should have as output: [*content*] or the MinCSS snippet call
    1. You need to create a file in modx
    2. Make it Internet Media Type: text/css
    3. Assign the above template
    4. Paste the snippet call in the Content Area if you did not do paste it in the template
    5. Link to this resource/document in your templates

    Notes: You might need to change the paths to your images in the css.

    Thank You