pnp / List-Formatting

List Formatting Samples for use in SharePoint and Microsoft Lists
https://pnp.github.io/List-Formatting/
MIT License
1.71k stars 824 forks source link

Just change the font size #621

Closed Ofer-Gal closed 1 year ago

Ofer-Gal commented 1 year ago

I found a sample and did something different on it

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "span",
      "txtContent": "@currentField",
      "style": {
        "font-size": "20px"
      }
    }
  ]
}

In the production tenant, I see: image

when doing the same in my dev tenant, I do not get any change when pressing Preview. Can I please have a simple sample that will will always work even if the list is configured for Alternating row styles? Thank you

I notice the column I was testing was Multiple lines of text. Does it matter?

Fedes365 commented 1 year ago

@Ofer-Gal

All those div HTML tags made me have a suspect. How was the multi-line text column configured? Was it normal text or RTF (Rich Text Format)? Reference: https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#supported-column-types

I'm asking this because I tried your code with a multiple line with no RTF and here is the result:

immagine

Ofer-Gal commented 1 year ago

Yes I realized later, it does not support rich text. Guess you can't have the cake and eat it too. :-)