Copied to clipboard

Flag this post as spam?

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


  • Chris Owen 7 posts 27 karma points
    Nov 01, 2009 @ 13:04
    Chris Owen
    0

    DotLess with Umbraco

    Ok guys Ill admit this post is me been very lazy, but hopefully its just a quick question to answer. 

    I am currently involved in a .NET port of the ruby css library www.dotlesscss.com . This allows you to add nested rules, variables, mixins and operators to your css files.

    Now It occurred to me that this might be a good addition to some of the CMS's out there and I remembered using (and liking) Umbraco some time back. I also remember that the CSS files were stored in the DB and you could do funky things with them to associate styles with the WYSIWYG. With this in mind, is dotless integration with Umbacro going to have to be done at the core lib level, or is there an abstraction above that allows me to swap out standard CS files with Less files and the preprocessor?

    As I said im been quite lazy by not just diging around myself, but Im really only after a quick overview of where I might get started and not a working solution. 

    Cheers, Chris. 

  • Chris Owen 7 posts 27 karma points
    Nov 01, 2009 @ 13:05
    Chris Owen
    0

    Aghh, sorry for multi post. Accident (how do I delete)

  • SaphuA 124 posts 87 karma points
    Nov 01, 2009 @ 14:46
    SaphuA
    0

    For as far I know css files are actualy created on disk, so not in the database. I do think it'd require quite some work if you wanted to alter the css file-format, since Umbraco does add some formatting in the files.

  • Chris Owen 7 posts 27 karma points
    Nov 01, 2009 @ 14:55
    Chris Owen
    0

    Thanks SaphuA, I thought the CSS files were stored in th DB instance, shows what I know :-). As for the additional formatting, any ideas where I can find out what this is and why its there?

  • SaphuA 124 posts 87 karma points
    Nov 01, 2009 @ 15:21
    SaphuA
    1

    Well, you can add properties to css files. These properties can be used in the Rich Text Editor. However, the css is still stored in a single file. Here's the result:

     body
    {
     padding: 10px;
    }

    /* EDITOR PROPERTIES - PLEASE DON'T DELETE THIS LINE TO AVOID DUPLICATE PROPERTIES */
    h1 {
    font-weight: bold;
    }

    I don't know what else Umbraco does with the css files, but its something to keep in mind.

  • Chris Owen 7 posts 27 karma points
    Nov 01, 2009 @ 17:36
    Chris Owen
    0

    Thanks SaphuA, you've been helpful. 

  • Rich Green 2246 posts 4008 karma points
    Nov 01, 2009 @ 18:04
    Rich Green
    0

    I believe it's been since V4 that css is file based, css is no longer held in the DB.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 02, 2010 @ 09:30
    Jeroen Breuer
    0

    I've been using dotless for a while now and I really like it! Since Umbraco 5 is going to be a complete redevelopment of the Umbraco core it might be a good idea to use dotless for styling. I´ve made a workitem for it: http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=26683. Please vote for it if you agree.

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Apr 02, 2010 @ 10:00
    Aaron Powell
    0

    Personally I don't see the advantage of dotless, if you're having such large CSS file(s) which actually would make dotless useful then you probably should look into class and ID setup.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 02, 2010 @ 10:07
    Jeroen Breuer
    0

    The things I like about dotless are the following:

    Variables

    Variables allow you to specify widely used values in a single place, and then re-use them throughout the style sheet, making global changes as easy as changing one line of code.

    Nested Rules

    Rather than constructing long selector names to specify inheritance, in Less you can simply nest selectors inside other selectors. This makes inheritance clear and style sheets shorter.

    I don't think these features have anything to do with large css file(s). It's just easier :).

  • Tom Madden 252 posts 454 karma points MVP 4x c-trib
    Apr 02, 2010 @ 10:11
    Tom Madden
    2

    Personally I think the theory behind dotless is a good idea even for small sites,even just using variables for colours used in multiple locations will make it super easy when the inevitable changes come from the client. I've not used it yet, but am about to use it for a new site starting this coming week.

    For the editor styles for Umbraco, I've always stored these in a separate CSS file to keep them separate from my CSS.

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Apr 02, 2010 @ 10:44
    Stefan Kip
    0

    Dotless rules! :)

Please Sign in or register to post replies

Write your reply to:

Draft