0
votes

When we make changes to our corev4.css in the _themes folder in the root of our SharePoint 2010 site it shows up on the root URL but not on any subsites even though we did select the check box "Reset all subsites to inherit the system master page setting".

http://SiteName/_Layouts/ChangeSiteMasterPage.aspx

The physical changes are there so we know that the MasterPage is inheriting, but the design/css changes are not on the subsites.....

Why is that?

Edit

Ok, I managed to make all the subsites look the same by adding the following line of code in the head tag in my MasterPage and it worked.

<SharePoint:CssRegistration Name="/_styles/S1.css" runat="server" EnableCssTheming="true" After="true"/>

But now when I change the theme in any of my sites it does change it to the correct theme but it ignores my cnanges from my S1.css

5

5 Answers

4
votes

It would be cleaner (and best practice) if you would add overrides to the corev4.css styles in your own Custom Css file and reference that as an alternate css file using site settings (same page as where you can change the masterpage)

It would get loaded later than the corev4.css and because of that it would use your styles instead of the out of the box ones.

Edit:

Add a custom.css to your site (i.e. in the style library). Then point the site to that file (the setting is called alternate css and can be found under look & feel -> masterpage).

In your custom Css, define styles with the same name as those in corev4.css. This override styles becasue sharepoint will reference your CSS file AFTER it references corev4.css.

So say you want to override some styling of the search area, you would define a style named .s4-search in your css. by defining rules here, the same rules in the same class in corev4.css will be overriden

1
votes

The master page has a lot to do with them inheriting beacause all is managed by the SharePoint:CssLink component located in the master.

Managing CSS and themes within SharePoint 2010 is very difficult.

I spent hours on the topic.

you can check this...

http://mosshowto.blogspot.com/2010/06/sharepoint-2010-registering-css.html

and there is also this one where there is I think the answer to Etienne:

http://mosshowto.blogspot.com/2009/12/sharepoint-2010-wiki-styles.html

Now that the Bittersweet theme is applied to the site, if you try to modify the corev4.css file, you won't see any modification because the CSS are now stored in a file automatically generated by SharePoint 2010 and located in a site folder with this kind of url:

/_themes/20/corev4-8A0ABD2F.css?ctag=21

The SharePoint site will reuse the corev4.css file only if you apply the default option for the SharePoint site themes, that is to mean, no theme. That means that it is not a good idea to modify the styles by applying modifications to the themable/corev4.css file since these modifications won't be visible for any sites for which a SharePoint 2010 theme is applied. This is worth except for one case, if we want to remove the styles provided by the Out Of The Box version of SharePoint 2010. We will illustrate that case in a real world example later. This leads in looks for a means to modify the styles in a custom file

Hope that helps...

Marc

0
votes

The subsite would have its own _themes folder. That's the reason probably you are not seeing the change in subsites.

In 2007, core.css used to be in Style Library and thus this problem never occurred.

Can you check if your style library has a CSS which is referenced by your master page ? This is the CSS which you should be ideally modifying instead of one under _themes.

0
votes

The MasterPage has very little to do with Themes inheriting.

In order to inherit themes, you will need to activate the various Publishing features (at least Site scoped, probably the Web scoped as well), then you will get the option in the Site Settings => Themes page to reset subsites to inherit the theme as well.

As Colin says, modifying the corev4.css file isn't an ideal option incase a Microsoft service pack updates it and overwrites your changes.

0
votes

from my understanding its not stored in the styles library, so in that case it would be stored in 14hive:

dont overwrite sharepoint corev4.css, instead ovwerite it in another style, if you want to overwite with the same id or class that is fine! just use !important after each item eg:

.S4-td
{
   width:100% !important;
}

Important overwites any other css! having After="corev4.css" will do it aswell ;) but if you want to explicitly say you only want that style then i would put the method above!

to use above in custom css use this in masterpage:

<!-- link to our custom css  -->
<SharePoint:CssRegistration ID="CssRegistration1" name="/_layouts/customcss/css/style.css" After="corev4.css" runat="server"/>

or

<!-- link to our custom css  -->
<SharePoint:CssRegistration ID="CssRegistration1" name="/Style%20Library/style.css" After="corev4.css" runat="server"/>

just for reference if you want to do above but want to know what classes and id's are in v4 than its located here:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES\corev4.css

in your case the same applies above!

<SharePoint:CssRegistration ID="CssRegistration1" Name="/_styles/S1.css" After="corev4.css" runat="server"/>

that should do the trick ;)

https://sharepoint.stackexchange.com/questions/71591/where-is-corev4-css-located-in-sharepoint-designer-2013