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

# text-stroke-width

APISummary
## 介绍

`text-stroke-width` 属性指定了文字的笔画宽度。

## 使用示例

**下面是一个示例: css-api**

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

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

const TextStokeColor = () => {
  const textStyle1 = {
    textStrokeWidth: "1px",
    textStrokeColor: "red",
  } as const;
  const textStyle2 = {
    textStrokeWidth: "0.5px",
    textStrokeColor: "red",
  } as const;

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      {/* @ts-expect-error TODO(types): Support textStroke in `@lynx-js/types` */}
      <text style={textStyle1}>The stroke width of this text is 1px</text>
      {/* @ts-expect-error TODO(types): Support textStroke in `@lynx-js/types` */}
      <text style={textStyle2}>The stroke width of this text is 0.5px</text>
    </scroll-view>
  );
};

root.render(<TextStokeColor />);

```

v0.11.0



## 语法

```css
text-stroke-width: 2px;
text-stroke-width: 0.1em;
text-stroke-width: 5pt;
```

### 取值

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

  设置笔画的宽度

## 形式定义

| 初始值 | 空值 |
| 适用元素 | 所有元件 |
| 是否支持继承 | no |
| 是否支持动画 | no |


## 形式语法

```
<length[0,∞]>
```

## 与 Web 的区别

- 不支持设置笔画宽度为 thin 等属性值。

## 兼容性

**Compatibility Table**

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

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

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

**`text-stroke-width`**

**Specifications:**

