I would like to create a VisualForce page that shows on a Contact record, however, I only want it to show while the user is in Classic mode. I have tried using $User.UIThemeDisplayed to render the wrapping apex:outputPanel depending on if the User is in Classic or Lightning. However, while in Lightning this results in a massive block of whitespace where I would like for the space to not even be allotted to the page.
UPDATE: I tried to simplify my page but I realize that the previous example actually behaves exactly how I want it to. What I am also doing in my page is using Lightning Out to display a custom Lightning component for classic. My hope is that this VisualForce page only shows in classic and that I can use the custom Lightning component as it's own tab in the Lightning experience.
<apex:page standardController="Contact" standardStylesheets="false">
<apex:outputPanel rendered="{!$User.UIThemeDisplayed == 'Theme3' }">
<apex:stylesheet value="{!URLFOR($Resource.SLDS202, 'assets/styles/salesforce-lightning-design-system-vf.min.css')}" />
<apex:includeScript value="/lightning/lightning.out.js" />
<div id="lightning" />
<script>
var contactId = "{!Contact.Id}";
$Lightning.use("c:MyApp", function() {
$Lightning.createComponent("c:RelationshipWidget",
{ recordId : contactId},
"lightning",
function(cmp) {});
});
</script>
</apex:outputPanel>
</apex:page>