[SalesForce] Can we increase the lightning-accordion-section label font size

Is it possible to change the lightning-accordion-section label font size, I tried by adding

class="slds-text-heading_medium" It print like below

enter image description here

Play Ground

Expecting to increase the Font Size and bold the text.

<lightning-accordion class="example-accordion"
                         onsectiontoggle={handleToggleSection}
                         active-section-name="B">
        <lightning-accordion-section name="A"  class="slds-text-heading_medium" label="Accordion Title A">
            <lightning-button-menu slot="actions"
                                  alternative-text="Show menu"
                                  icon-size="x-small"
                                  menu-alignment="right">
                <lightning-menu-item value="New" label="Menu Item One"></lightning-menu-item>
                <lightning-menu-item value="Edit" label="Menu Item Two"></lightning-menu-item>
            </lightning-button-menu>
            <p>This is the content area for section A.</p>
            <p>.</p>
            <p>.</p>
            <p>.</p>
            <p>The section height expands to fit your content.</p>
        </lightning-accordion-section>

        <lightning-accordion-section name="B" label="Accordion Title B">
            <p>This is the content area for section B.</p>
            <p>.</p>
            <p>.</p>
            <p>.</p>
            <p>The section height expands to fit your content.</p>
        </lightning-accordion-section>

        <lightning-accordion-section name="C" label="Accordion Title C">
            <p>This is the content area for section C.</p>
            <p>.</p>
            <p>.</p>
            <p>.</p>
            <p>The section height expands to fit your content.</p>
        </lightning-accordion-section>
    </lightning-accordion>

Best Answer

No. Its not possible as its exposed as only attribute and not as slot and you do not have any other attributes to pass the style.

Note: You can change the style using javascript as static resource but this will be at your own risk as it is not documented and may break at any time with any upgrade.

Related Topic