Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Custom CSS file location

  Asked By: Emanuel    Date: Jul 08    Category: Sharepoint    Views: 1940

I've created a custom CSS file and my solution currently puts it into
the
12/TEMPLATE/LAYOUTS/MyCompany/Styles directory.

I've created a custom site definition which references it by setting
the
AlternateCSS attribute
(to "/_layouts/MyCompany/Styles/MyCompanyCore.css") of
the <Project> element in the onet.xml file.

It seems to work. Any sites provisioned from this site are using the
overridden styles from that file.

I'm just wondering if there's a better place to put CSS (along with
image
and js) files? Should I continue to put it there and then have the
onet.xml
put it in the site collection's Style Library?

The reason I ask is that there doesn't seem to be any way to
customize my
CSS in SPD. If I were to put it in the Style Library I think I could
edit it
directly and save the changes to the content database.

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Jada Clemons     Answered On: Jul 08

yes, you can put  your style  sheet in SPD.
open SPD and open your site, create a custom  folder called Styles. in this
folder add that css  and refer it in the master page. you can edit in SPD. this
is the best way of doing style sheets.

 
Answer #2    Answered By: Brooke Lewis     Answered On: Jul 08

I would stick to the approach you have outlined. Where
possible maybe change it slightly and use a theme instead, this means that
you can then apply this theme to any site  not just one that is based on your
custom site definition. Where possible also ensure that items like CSS, JS,
XML etc are stored on the disk to allow for global changes to be made
without having to manually change it loads of times. The approach of using
SPD works perfectly fine if you do decide to create a theme, this way you do
get the _styles folder and a CSS file  to edit, this allows for instant
changes which you will then merge into your final theme when you are ready.

 
Didn't find what you were looking for? Find more on Custom CSS file location Or get search suggestion and latest updates.




Tagged: