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


How do I prevent them from loading?


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":

    $(this).attr("disabled", "disabled");
| improve this answer | |
  • 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

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.

| improve this answer | |
  • 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

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.

| improve this answer | |

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.