Looking for clarification around the getUIThemeDisplayed()
method. I have simple VF page that displays the value returned by this method from a corresponding controller and a lightning component on the same VF page that also shows the value returned from the method from the same controller.
When in SF classic I'm seeing both the VF page and Lightning Comp returning Theme3
(SF Classic). So far so good. But when I switch (via the menu) to LEX and go to the VF page, the VF page shows Theme3
(Classic) and the component returns Theme4d
(LEX).
Example VF Page
<apex:page controller="ThemeTestController" showHeader="true">
<apex:includeLightning />
Theme returned by VisualForce page: {!UIThemeValue}
<div id="lightning" />
<script>
window.onload = function(){
$Lightning.use("c:TestApp", function() {
$Lightning.createComponent("c:ThemeTestCmp",
{},
"lightning",
function(cmp) {
});
});
}
</script>
</apex:page>
Documentation states these variables Identify the CSS used to render SF web pages to a user, so if the component utilizing Lightning CSS and the VF still uses classic CSS hence the different values displayed? And if so, why do we see both the VisualForce page and component display Theme3
when in classic?