Newer Version Available
Identifying the Salesforce Style Your Users See
There are two global variables that can help you identify which style a user sees: $User.UITheme and $User.UIThemeDisplayed. The difference between the two variables is that $User.UITheme returns the look and feel the user is supposed to see, while $User.UIThemeDisplayed returns the look and feel the user actually sees. For example, a user may have the permissions to see the Salesforce Classic 2010 user interface theme look and feel, but if they are using a browser that doesn’t support that look and feel, for example, older versions of Internet Explorer, $User.UIThemeDisplayed returns a different value.
- Theme1—Obsolete Salesforce theme
- Theme2—Salesforce Classic 2005 user interface theme
- Theme3—Salesforce Classic 2010 user interface theme
- Theme4d—Modern “Lightning Experience” Salesforce theme
- Theme4t—Salesforce1 mobile Salesforce theme
- PortalDefault—Salesforce Customer Portal theme
- Webstore—Salesforce AppExchange theme
- Using the rendered attribute you can “toggle” which sections display.
- Since the <apex:stylesheet> tag doesn't have a rendered attribute, you’ll need to wrap it in a component that does.