This project is read-only.

How to manage loaded CSS

Aug 20, 2009 at 11:53 PM

Is there any way how to manage theme CSS files?

For example, i have a specific css file for IE which shoud be referenced in code like this :

<!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="main-msie.css" /><![endif]-->

I'm not sure how to load that file thrue theme folder.

Thank you.

 

F.

 

Aug 21, 2009 at 2:23 AM

hi feryt:

   You can reference your css file through absolutely url, for example:

<!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="/Template/{yoursite}/BinaryResource/main-msie.css" /><![endif]-->

  If your css file in the Theme folder, it will be referenced to the page automatically.

Aug 21, 2009 at 4:21 AM

feryt,

You asked a very good question.

Indeed, you can add reference to CSS via absolutly URL, but then you will lost the funciton of Theme in Kooboo.

Unfortunately, Kooboo does not provide this functionality at this moment. We understand this need, we got two solutions. 

1. Server side. 
We implement ways to load different CSS according to useragent.

2. Client side.

We make it possible to render some user defined tags for some css file names.

I think .NET developers will love the server side solution while CSS  developers probably like the client side solution.

What do you think?

We can implement either solution quickly and release another version next week. Please be patient and wait a few days.

Regards,

Kooboo team.

 

Aug 21, 2009 at 1:50 PM

Kooboo,

I am not sure these features will be used by 80% of the community. If this functionality in any way enforces constraints (speed, flexibilty.. etc) on others, I would like to suggest the solution is a candidate for a module. I am sure there will be times when people want to do other special tricks with CSS,  such as:

1. CSS based on time of day

2. Role based CSS

3. Content type based CSS

4. Module based CSS

etc. 

Maybe this is a good example module?

 

 

Aug 21, 2009 at 4:43 PM

Thanks for your concern Jinside.

After some internal discussion this afternoon. We come up with a temp solution.  Indeed the design goal of Kooboo is to have a framework where users can build all kind of modules and plugin to extend the functionality (We did think a lot of this and we think we come up with a nice solution for modular development). 

We are thinking that  in the theme folder where the .css files located, we can create a CSSRules.txt. This text file contains rules how the CSS files should be rendered into pages. 

For example:

--------------- file cotnent ---------------------------

 

<!--[if IE 7]><link type="text/css" rel="stylesheet" href="css/ie7-corrections.css" /><![endif]--> 
<!--[if lt IE 7]><link type="text/css" rel="stylesheet" href="css/ie-corrections.css" /><![endif]--> 

<!--[if IE 7]><link type="text/css" rel="stylesheet" href="ie7.css" /><![endif]--> 

<!--[if lt IE 7]><link type="text/css" rel="stylesheet" href="ie56.css" /><![endif]--> 

-------------- end of file content --------------------

ie7.css & ie56.css is the theme files in the IE theme folder. 

 

When loading theme css files, we will examine this file first, and render ie7.css & ie56.css according to rules defined in the files. So the page will see something like 

<link type="text/css" rel="stylesheet" href="/somepath/default.css" />

<!--[if IE 7]><link type="text/css" rel="stylesheet" href="/somepath/ie7.css" /><![endif]--> 

<!--[if lt IE 7]><link type="text/css" rel="stylesheet" href="/somepath/ie56.css" /><![endif]-->

 

We will be able to use cache, so this will not have influence on performance.

 

What do your guys think of this? We could offer update with this solution next week.

Regards,

Kooboo team

Aug 21, 2009 at 9:44 PM

Hi guys.

IMHO, managing CSS(even JS files) is such a common task as it shoud be a part of a core of a Kooboo framework.

Kooboo should load CSS files from Theme folder(and JS files from some shared JS folder) by rules defined in some config file, then combine it to one file and minimeze it(us cache of cource).

It would help us - developers, to concern on more project-specific tasks.

 

In the last month i have tried most of free and commercial CMS systems, and found Kooboo as the winner.

Keep good working, i hope i can give some of my thoughts and help to improve project too.

 

Best regarda.

F.

Aug 21, 2009 at 9:49 PM
kooboo wrote:

Thanks for your concern Jinside.

After some internal discussion this afternoon. We come up with a temp solution.  Indeed the design goal of Kooboo is to have a framework where users can build all kind of modules and plugin to extend the functionality (We did think a lot of this and we think we come up with a nice solution for modular development). 

We are thinking that  in the theme folder where the .css files located, we can create a CSSRules.txt. This text file contains rules how the CSS files should be rendered into pages. 

 

Good as temp solution - thank you for it, but...

As i wrote before, there should be build-in functions to at least combine and minimize JS/CSS files.

Check out this: http://aspmvccombine.codeplex.com/

Kind regards.

F.

Aug 22, 2009 at 4:56 AM

Feryt, 

Thanks for sharing your thought. We did not realize that we can treat .js similar way as .css. Good thought, going to try to implement it. 

We do already implemented JS combine and compress tools. 

Regards,

Kooboo team