<!--
{
  "availability" : [
    "Apple News Format: 1.9.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppleNewsFormat",
  "identifier" : "/documentation/AppleNewsFormat/ConditionalTextStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Object",
  "symbol" : {
    "kind" : "Object",
    "modules" : [
      "Apple News Format"
    ],
    "preciseIdentifier" : "data:news_format:ConditionalTextStyle"
  },
  "title" : "ConditionalTextStyle"
}
-->

# ConditionalTextStyle

The object for defining conditional properties for a text style, and when the conditional properties are in effect.

```
object ConditionalTextStyle
```

## Discussion

Use the `ConditionalTextStyle` object to define an array of conditional text style properties and the conditions under which to apply them. When a condition is met, the value of a property in `ConditionalTextStyle` overrides the value of the same property if defined in the parent `TextStyle` object. See [`TextStyle`](/documentation/AppleNewsFormat/TextStyle).

### Example

```json
{
  "components": [
    {
      "role": "body",
      "text": "Lorem ipsum dolor sit amet, <span data-anf-textstyle='exampleTextStyle'>consectetur adipiscing elit.</span>",
      "format": "html"
    }
  ],
  "textStyles": {
    "exampleTextStyle": {
      "textColor": "#FF0000",
      "conditional": [
        {
          "underline": true,
          "textColor": "#000",
          "conditions": [
            {
              "minContentSizeCategory": "XXXL"
            }
          ]
        }
      ]
    }
  }
}
```

## Relationships

### Inherits From

[`TextStyle`](/documentation/AppleNewsFormat/TextStyle)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)