4

Sample code:

<apex:page  docType="html-5.0" 
            lightningStyleSheets="true" 
            showHeader="false" 
            sidebar="false" 
            standardStylesheets="false">
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockSection title="My Content Section">
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Desktop:

enter image description here

iphone X

enter image description here

I am not much of a css expert. Any idea how to fix this?

1 Answer 1

3

Note that as per VF guide API version 47:

Apex tags such as <apex:pageblock> and <apex:inputField> are not yet supported for use with SLDS.

But considering other recommendation from same guide, you can somewhat improve the font rendering in responsive display by applying <apex:slds /> to your page and wrap your code in a scoping class, <div class="slds-scope">...</div> as follows:

<apex:page docType="html-5.0" 
            lightningStyleSheets="true" 
            showHeader="false" 
            sidebar="false" 
            standardStylesheets="false">

  <!-- Import the Design System style sheet -->
  <apex:slds />

    <!-- REQUIRED SLDS WRAPPER -->
    <div class="slds-scope">
     <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection title="My Content Section">
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
    </div>
</apex:page>

which gives this:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .