> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# -x-auto-font-size-line-ranges

APISummary
## Introduction

The `-x-auto-font-size-line-ranges` property defines line-count-based font size ranges for text auto sizing. Use it together with `-x-auto-font-size: true` to provide different font size search ranges for different rendered line counts.

## Examples


**This is an example below: css-api**

**Entry:** `src/-x-auto-font-size-line-ranges`
**Bundle:** `dist/-x-auto-font-size-line-ranges.lynx.bundle`

```tsx
import { root } from "@lynx-js/react";

import "./index.scss";

const samples = [
  "Short title",
  "A medium title that wraps into two lines",
  "A very long title that wraps into three lines and uses the last line range rule",
];

const XAutoFontSizeLineRanges = () => {
  return (
    <view className="page">
      {samples.map((sample) => (
        <view key={sample} className="card">
          <text className="title" text-maxline="3">
            {sample}
          </text>
        </view>
      ))}
    </view>
  );
};

root.render(<XAutoFontSizeLineRanges />);

```

v0.11.0



## Syntax

```css
-x-auto-font-size: true;
-x-auto-font-size-line-ranges:
  line-range(1, 18px, 22px), line-range(2, 16px, 18px),
  line-range(3 to infinity, 14px);
```

### Values

- `line-range(<line-count>, <min-size>[, <max-size>])`
  - Defines one line-count rule.
  - `<line-count>` can be an exact positive integer such as `1` or an open-ended range such as `3 to infinity`.
  - `<min-size>` is required and must be a [`<length>`](/next/api/css/data-type/length.md).
  - `<max-size>` is optional and must be a [`<length>`](/next/api/css/data-type/length.md). If omitted, the value defaults to `<min-size>`, meaning a fixed font size is used for the matched rule.

## Formal definition


| Initial value | [] |
| Applies to | text |
| Inherited | no |
| Animatable | no |


## Formal syntax

```
-x-auto-font-size-line-ranges = <line-range-function>#

<line-range-function> = line-range( <line-count> , <length> [, <length>]? )
<line-count> = <integer> | <integer> to infinity
```

## Differences from the Web

- This is a Lynx-specific property.

## Notes

- This property is only effective when `-x-auto-font-size` is enabled.
- This property overrides the minimum and maximum font size settings in `-x-auto-font-size`.
- When this property is set, `-x-auto-font-size-preset-sizes` does not take effect.

## Compatibility


**Compatibility Table**
**Query:** `css.properties.-x-auto-font-size-line-ranges`

**Platform Support**

| Platform | Version Added | Notes |
|----------|---------------|-------|
| Android | 3.8 | - |
| iOS | 3.8 | - |
| HarmonyOS | ❌ No | - |
| Clay Android | ❌ No | - |
| Clay iOS | ❌ No | - |
| Clay Windows | ❌ No | - |
| Clay macOS | ❌ No | - |
| Web | ❌ No | - |

