Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS, Salesforce, ExtJS, and the blues

I've been asked to demo some ExtJS UI enhancements to our current apps inside Salesforce. This is just a proof of concept that ExtJS will work as a good UI replacement for the default UI that most of our VisualForce pages use.

Everything works great, that is, except a few odds and ends of the CSS. There are lots of styles inside "...visual.force.com/sCSS/21.0/sprites/13013.../Theme3/default" that are messing with the ExtJS elements. Specifically commmon.css and extended.css. Here's an example:

Extended.css

body .x-date-middle, .x-date-left, .x-date-right {
    background: none repeat scroll 0 0 transparent;
}

Is there an elegant way around this, or is ExtJS just not going to play well inside of Salesforce?

For example: Is there a way that I can tell my VisualForce page to ignore commmon.css and extended.css?

like image 556
Stephano Avatar asked Mar 31 '11 22:03

Stephano


2 Answers

Do you need the standard Salesforce style sheets? If not, you can use the showHeader and standardStylesheets attributes to stop Salesforce from sending down the style sheets.

<apex:page standardStylesheets="false" showHeader="false">
</apex:page>
like image 182
Ryan Guest Avatar answered Sep 22 '22 12:09

Ryan Guest


I can't speak to whatever Salesforce is doing, but if Ext's styles are being overridden (by any other CSS really) you have two choices: remove the offending CSS, or override the rules yourself. Not much way around that in Ext 3.x.

In Ext 4 you'll be able to sandbox your Ext styles by customizing the global Ext.baseCSSPrefix config, which will effectively eliminate this issue going forward.

like image 25
Brian Moeskau Avatar answered Sep 18 '22 12:09

Brian Moeskau