0

I set the apex:page parameter standardStylesheets="false". But some stylesheets are still being loaded and affecting display, such as common.css:

https://www.evernote.com/shard/s167/sh/e1b6d6b5-d67d-4d3c-861b-1e8e91e2f94e/8233ccc5d653fc93eebd5b8a92526c23

How do I prevent them from loading?

2

Found a solution. I don't think we need the CSS, so I disabled it on page load, as per this article: https://stackoverflow.com/questions/12857734/removing-the-css-file. You can also remove it entirely with .remove().

Luckily, all the CSS files are being loaded via tag, which all have the class "user":

  $("link.user").each(function(){
    $(this).attr("disabled", "disabled");
  });
  • 1
    Is there a chance that you've got development mode enabled for some users which is why it's only happening for them? – Matt Lacey Jul 14 '14 at 2:04
  • I think I was incorrect that the CSS is only being loaded for admins--it's being loaded for everyone, which I verified by opening the site in Private Browsing window. I edited my answer above. – Alan Feb 12 '15 at 21:08
1

You can also try to set sidebar="false" and showHeader="false" with standardStyleSheets="false" in apex:page. This will show up a balnk page and it will a plain HTML page without any standard style of salesforce.

  • 1
    I already have these attributes in apex:page. This stops the main stylesheets from being loaded, but certain stylesheets continue to be loaded against our will, such as common.css. The answer I posted above is the only solution I found. – Alan Feb 12 '15 at 21:06
1

I just ran into the same problem tonight. My set up was that my page called a template via <apex:composition>. My page had the relevant sidebar and showHeader and standardStyleSheets all set to false, but common.css was still getting included.

The resolution was to set all of the above parameters to false in the page template as well as the page you're calling the template in, as the template is a page too.

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.