function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hema A 1Hema A 1 

Force.com sites displaying Lightning styled VF page in classic

Hi all,

I am using lightningStylesheets=“true” in one of my VF page, it worked within the context off the org but when I make the page public and access it through a force.com site it reverts back to the classic view. Is there a way to make lightningStylesheets=“true” work with public sites?

Things I tried:
1) My site setting for 'Lightning Features for Guest Users' is enabled
2)  Used the below stylesheet
<apex:stylesheet value="/resource/SLDS0102/assets/styles/salesforce-lightning-design-system-ltng.css"/>
3) Used the lightningStylesheets=“true”, in the <apex:page>

Please help me if I am missing something that I haven't tried.

Thanks in Advance!
Yogeshwar TailorYogeshwar Tailor
Hi Hema,

Can you copy <apex:slds /> in your VF page and check ?

Best,
Yogesh
Hema A 1Hema A 1
Hi Yogeshwar,

I tried adding the <apex:slds/>, but no luck. Still the same result.
Yogeshwar TailorYogeshwar Tailor
Hi Hema,

Can you please share the VF code so I can help in detail.

Best,
Yogesh
Hema A 1Hema A 1
Sure Yogesh,
 
<apex:page controller="PropertyWebFormController" sidebar="false" showHeader="false" lightningStylesheets="true">

    <apex:form >
        <apex:pageBlock title="Property" mode="edit">
             <apex:pageBlockSection id="accountNameSection" title="Property details" columns="1">
                 <apex:outputText label="Account Name" value="{!accountName}" />
                 <apex:outputText label="Management Group" value="{!managementGroup}" />
                 <apex:inputText label="New Management Group" value="{!newManagementGroup}"/>
             </apex:pageBlockSection>
             <apex:pageBlockButtons >
                 <apex:commandButton value="Save" onclick="return confirm('Do you want to save the Management Group?');" action="{!onClickSave}"/>
             </apex:pageBlockButtons>
         </apex:pageBlock>
    </apex:form>
    <apex:pageMessages ></apex:pageMessages>
    <apex:slds />
</apex:page>