Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dav 44 posts 69 karma points
    May 25, 2011 @ 18:01
    Dav
    0

    Sassy CSS in Umbraco

    SASS stands for "Stylistically Awesome Style Sheets" and having used it for a few production projects I can confidently say that it does bring fun back into writing CSS. You can see for yourself but a glimpse of what it's capable of on SASS homepage. However, due to SASS being a superset and an extension of CSS, it requires a compile step before files are understandable by browsers and can be meaningfully served.

    I would love to use my fav cms with my fav css tool :-) I know I can edit css files in umbraco, and presumably it wouldn't be too tough to teach it to show scss/sass files under settings/stylesheets and edit them. However, I'm not too sure about the extra recompile step - do you think it might be possible to ask umbraco to post-process a file after save?

    Or perhaps some of you are already using SASS+UMB and are experiencing cms zen on a daily basis already? Care to let me know how you integrated the two?

    Will be grateful for any tips, this has been bugging me for a while!

  • Dav 44 posts 69 karma points
    May 30, 2011 @ 15:20
    Dav
    1

    In the end we changed umbraco code a little - first of all making sure that stylesheet files are saved with their extension in the database (was hadcoded to .css), and then adding another foreach in umbraco.cms.businesslogic.web.StyleSheet.GetAll(). If you do this, beware that you will need to edit your database - add .css to all of your stylesheet file names. Will gladly provide a patch in case you'd like to have the job done quickly.

  • wolulcmit 357 posts 693 karma points
    Aug 11, 2011 @ 12:00
    wolulcmit
    0

    I'm interested in using SASS, could the patch you did be made into a package perhaps?

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Aug 21, 2011 @ 07:05
    Bo Damgaard Mortensen
    0

    Or you could install this: http://visualstudiogallery.msdn.microsoft.com/2b96d16a-c986-4501-8f97-8008f9db141a

    If you're developing your site(s) in VS2010 :)

  • Dav 44 posts 69 karma points
    Aug 22, 2011 @ 11:21
    Dav
    0

    Sorry for not coming back a lil earlier, quite rude of me - only excuse being a holiday between then and now. Anyhow, I've uploaded my patch to 2shared. After you apply it (eg. with Patch for Windows) to "vanilla" Umbraco source, you need to rebuild the project (VS2010) and replace two dll's in your project's bin folder: umbraco.dll and cms.dll (much easier than deploying the VS-built instance). Then you're all set: you can right-click on stylesheets folder in backend, and create SCSS files no probs, as well as edit them. We usually launch the `compass watch` process on the machine used to host the project while in development so that any change to our scss styles made in Umbraco backend is instantly applied to the compiled css file you include in your template.

    One thing to bear in mind is that you need to be naming your stylesheet files a little differently from now on. Contrary to ag. scripts, Umbraco used to assume that you type in stylesheed filenames without the ".css" extension, but this patch reverses that and makes it consistent with other bits of Umbraco: it's up to you to choose and type the extension.

    Let me know how it works if you choose to use the patch, and whether you encounter any bugs. We used it on two commercial websites, and so far - no problems :-)

    On another note: wish I could propose such a mod to the larger community (contribute to source, also with other patches we've accumulated over the years), but the whole git affair seems overly complicated... does any of you have any experience with that process and could point me in the right direction?

  • Dav 44 posts 69 karma points
    Aug 22, 2011 @ 11:23
    Dav
    0

    Oh, and Mortensen: props up for Mindscape, it's an awesome addition to our workflow with VS2010! (Sorry for another post, somehow I could not add a newline to my post in edit mode...)

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Aug 22, 2011 @ 12:38
    Bo Damgaard Mortensen
    0

    Anytime :)

    I've been using the SASS plugin for a good while now and it really stands up to what it's supposed to do. The compile-time is just awesome!

    Hope it works just as well for you, as it does for me.

    / Bo

Please Sign in or register to post replies

Write your reply to:

Draft