views:

748

answers:

3

I don't have a real need to omit the default core.css reference from my HTML pages but I would like to know so I can feel comfortable that I have full control. Thanks

+1  A: 

Note: It's not recommended to customize files from the Site Definition when you can avoid doing so.

When using Mickel's advice, make a copy of the Default.master, rename it to something like Custom.master and apply changes to that file. Then right click your custom master page and select "Set as default master page."

This is all done from within SharePoint Designer btw

zincorp
+2  A: 

There are many ways to achieve this.

The problem is, once you remove the core.css file you are talking about 6 thousand lines of places that will not appear with a presentation anymore. What I do when we are limited to theme-only visual customization I create a theme that will address any new CSS needs and also replace the elements in the core.css file (themes are loaded AFTER this file, so if you have duplicated declarations in both files, the theme's one will prevail, without using the !important mini-hacks).

Keep in mind that SharePoint in editing mode just doesn't work without this file, you have to use different approaches when you are, for example, talking about an internet-facing site with 100% anonymous users vs an intranet-like portal with everyone creating and editing content on the go.

With all the warnings given, you can go to your masterpage and remove the core.css tag making it invisible:

<SharePoint:CssLink runat="server" Visible="false"/>

Depending on your type of sharepoint site (WSS vs MOSS + Publishing Features) the masterpages may work differently based on configuration, by default (WSS or MOSS without Publishing Features or any change on the matter) your masterpage will open on all the link that do not contain /_layouts/ in the url.

Examples:

  • /Default.aspx => Masterpage
  • /DocumentLibrary/Forms/Allitems.aspx => MasterPage
  • /_layouts/viewlsts.aspx (Show all site content) => no custom masterpage

This is Microsoft's way to stop you from breaking even more (system pages) with the masterpages, but you can be extreme and use HttpModules or editing the 12/Template/Layouts/LCID folder (affecting the entire web front-end)

Usual scenarios:

  • Anonymous sites with no core.css when the user is anonymous and normal load when credentials are given (loading speed)
  • Themes used to let users create their mini-sites and use the branded templates or other sharepoint themes
  • Masterpages to customize what most of the users usually see, forcing your branding throught the child webs (new websites in non-MOSS Publishing wont inherit the masterpage)
  • Everything-under-the-masterpage with HttpModules or /12/ modifications (very rinky and complicated)
F.Aquino
+1  A: 

Simply add your own custom CSS style sheet via Central Admin - this will be applied last, after Core.css so you can override anything you wish. You do not want to remove it! :-)

IrishChieftain