Skip to Content

SAPUI5 change font size with custom css

Hi experts,

I would like to increase the font-size of the title text of an ObjectListItem by custom CSS:

View:

<ObjectListItem xmlns="sap.m" id="MAIN_LIST_ITEM" type="{device>/listItemType}" press="_handleItemPress" class="sapMTextBold"
title="{parts: [{path: 'TaskTitle'}, {path: 'CustomAttributeData'}], formatter: 'cross.fnd.fiori.inbox.Conversions.formatterTaskTitle'}"
intro="{parts: [{path: 'TaskSupports/Release'}, {path: 'SupportsRelease'}], formatter: 'cross.fnd.fiori.inbox.Conversions.formatterStatusForReserved'}"
number="{path: 'CustomAttributeData', formatter:'cross.fnd.fiori.inbox.Conversions.formatterCustomNumberValue'}" numberUnit="{path: 'CustomAttributeData', formatter:'cross.fnd.fiori.inbox.Conversions.formatterCustomNumberUnitValue'}">

CSS:

.sapMTextBold {
    font-size: 10px;
}

but it doesn't work.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 16, 2017 at 09:06 PM

    The ObjectListItem generates list items with divs and spans within it. The css should be something like

    .sapMTextBold div > span {
        font-size: 10px !important;
    } 
    

    Regards,

    Jamie

    Add comment
    10|10000 characters needed characters exceeded