2

From firebug I can see that in our SharePoint 2013, tokyo.css is being loaded twice. Once before my custom.css is loaded and once after. This is causing my customization to be overridden by default styles in tokyo.css

This is what I have in the master page:

<SharePoint:CssRegistration Name="<% $SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/tokyo.css %>" runat="server" EnableCssTheming="true" />
<SharePoint:CssRegistration ID="CssRegistration2" Name="/SitePages/css/custom.css" runat="server" After="<% $SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/tokyo.css %>" />

What am I doing wrong?

1

This might not be a standard/recommended practice, but might work in your case.
Try giving the link to the css file directly using the <link> tag rather than the <SharePoint:CssRegistration> tag

| improve this answer | |
0

Try this

<SharePoint:CssRegistration Name="<% $SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/tokyo.css %>" runat="server" EnableCssTheming="true" />
<SharePoint:CssRegistration Name="/SitePages/css/custom.css" runat="server" After="/Themable/Core Styles/tokyo.css" />
| improve this answer | |
  • Tried but no change. Even tried hard coding /Style%20Library/en-US/Themable/Core%20Styles/tokyo.css but no effect. tokyo.css still loads twice, before and after custom.css – joym8 Jan 23 '15 at 20:45
  • In your master page do you have <SharePoint:Theme runat="server"/>? – Amal Hashim Jan 23 '15 at 20:45
  • Just searched in master page and didn't find it. – joym8 Jan 23 '15 at 20:46
  • Do you have any page layouts? Check the aspx file also to make sure its not getting loaded from there. – Amal Hashim Jan 23 '15 at 20:47
  • Firebug shows a file called pagelayouts15.css being loaded before any other css. There is no reference for it in the master page though. – joym8 Jan 23 '15 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.