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.
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.
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?
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.
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.
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.
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 :).
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.
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.
Aghh, sorry for multi post. Accident (how do I delete)
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.
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?
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.
Thanks SaphuA, you've been helpful.
I believe it's been since V4 that css is file based, css is no longer held in the DB.
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.
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.
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 :).
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.
Dotless rules! :)
is working on a reply...