We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46980
    • 11 Posts
    Hello,
    I need to understand what cssSweet is for.
    If someone use it, could you please explain me in simple words how it works.

    Thanks!
    • It's a way to use a chunk to edit a specified .css file.

      The chunk uses placeholders and custom output modifiers. The plugin re-writes the .css file when the Site->Clear Cache menu item is used to clear the cache.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 30672
        • 180 Posts
        Hi !

        i continue here, because it is maybe a newbie question too smiley

        can i use cssSweet with TV's ?

        like a tv for color text ?
        • No. Use ClientConfig, and settings tags: [[++text_blue]]
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 30672
            • 180 Posts
            ok thanks Susan !
            • I have modified it to use resources in a specified context, and to work with OnDocFormSave instead of the site_refresh event. The chunk just has a pdoResources snippet call to gather up all the CSS resource content for the plugin to process as usual.

              With this modification, you can assign a template to these resources and use TVs.

              I'll be demonstrating this RO.IDEs-based system at the MODX Weekend in a few more days.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 30672
                • 180 Posts
                well in fact i cannot use setting tags in this case.

                i use getresource to make a list of ressources. i want to be able to assign a specific color to a div, ressource by ressource.

                that is probably what you have done?
                • The cssSweet plugin only writes to a .css file. What you want to do cannot be done from an external .css file.

                  You can use a TV to set classnames in the div, then style those classnames in your .css file.
                  <div class="[[+tv.divClass]]">
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 30672
                    • 180 Posts
                    yes i'm afraid i will have to do so...
                    i wanted to avoid that, make things a little bit better in styling/css.

                    thanks susan!

                    have a nice evening/day smiley

                    • That's what the mashup of RO.IDEs and CssSweet is all about. It simplifies the management of your CSS, putting the actual CSS code in a context with CSS-type resources, and automatically writing a compressed .css file from their contents. Organize the resources any way you like.

                      The trick is in the chunk, the output of which is compressed and written to your .css file by the plugin. I use pdoResources, you can use getResources if you prefer.

                      [[pdoResources? 
                      	&context=`stylesheet` 
                      	&parents=`0` 
                      	&includeContent=`1`
                      	&tpl=`@CODE [[+content]]`
                      ]]

                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org