Design and CSS styles
Version 5.x > Design and CSS styles > CSS - where to store ? Advice for good practice wanted View modes: 
User avatar
Member
Member
evisser-vcontent - 7/13/2010 12:22:12 AM
   
CSS - where to store ? Advice for good practice wanted
Hi,
Just restructuring a website for better maintenance.
Q: where to keep the CSS definitions?
1. I tend to have two files - a default CSS file combined with @import special CSS file
2. I prefer to use an external editor for the CSS files since I am not good at the CSS syntax.
As far as I know a CSS is defined and maintained in Site Manager -> Development -> CSS stylesheets. So far so good, but rather clumsy without an editor (or do I overlook something?) Why do I see for example CSS files under App_Themes as well?

Until now I maintain my two CSS files in Site Manager. But especially with a new site and many CSS ichanges it leads to many cut/paste from the CSS editor into Site Manager for the CSS definitions (and frustration) until it is right. I am looking for a file driven approach with an external CSS editor if possible. Thanks for any hints.

User avatar
Member
Member
evisser-vcontent - 7/13/2010 1:48:54 AM
   
RE:CSS - where to store ? Advice for good practice wanted
Think I got a workable solution for me after coming across a post in this forum Editing CSS Stylesheet in CMS where learned that Kentico picks up CSS files from the App-Themes folder.
Step 1: In Site Manager -> Development -> CSS stylesheets I have defined a dummy CSS name and codename: cssplaceholder
Content is one line /* Dummy */
Step 2: In Site Manager -> Sites, I have selected cssplaceholder as my site CSS stylesheet
Step 3: create in your MySite/App_Themes folder a new folder called cssplaceholder (exactly as the codename)
In the folder cssplaceholder are my images folder, my default.css and my special.css.
I noticed that that Kentico will now automatically include link statements in my master page to the default.css and the special.css
Step 4: start your favourite CSS editor
My CSS editor opens the Inetpub/wwwroot/MySite/App-Themes/cssplaceholder/default.css file.
I can now make changes to the CSS files, save the file, reload my web page and voila my change is displayed.
Hope this is useful for other css editors.

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 7/22/2010 2:14:56 AM
   
RE:CSS - where to store ? Advice for good practice wanted
Hello,

Thank you for providing this approach also to other users. I'm sure, it will be helpful.

What I just wanted to say here is a fact that we intend to incorporate better CSS editor (with advanced features) within version 6.0.

Best regards
Ondrej Vasil