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

# text-stroke

APISummary
## Introduction

The `text-stroke` CSS property specifies the width and color of strokes for text characters.

## Examples

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

**Entry:** `src/text-stroke`
**Bundle:** `dist/text-stroke.lynx.bundle`

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

const TextStroke = () => {
  const textStyle = {
    textStroke: "1px red",
  } as const;

  return (
    // @ts-expect-error TODO(types): Support textStroke in `@lynx-js/types`
    <text style={textStyle}>
      The stroke of this text is red
    </text>
  );
};

root.render(<TextStroke />);

```

v0.11.0



## Syntax

```css
text-stroke: 4px green;
```

### Values

- none 

  **Default value**

- [`<length>`](/next/api/css/data-type/length.md) 

  Set the width of the stroke

- [`<color>`](/next/api/css/properties/color.md) 

  Set the color of the stroke

## Formal definition

| Initial value | empty value |
| Applies to | all elements |
| Inherited | no |
| Animatable | no |


## Formal syntax

```css
text-stroke = none | <length [0,∞]> || <color>
```

## Differences from the Web

- Does not support setting attribute values such as `thin` for stroke width.

## Notes

- Some fonts may have overlapping strokes.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.text-stroke`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/194-text-stroke.json) · [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-text-stroke)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| text-stroke | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | No |

**`text-stroke`**

**Specifications:**

- **Web — Not supported:** The shorthand is not translated to -webkit-text-stroke. Use text-stroke-width and text-stroke-color, which are translated separately.

