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

# font-weight

APISummary
## Introduction

The `font-weight` CSS property sets the weight (or boldness) of the font. The weights available depend on the font-family that is currently set.

## Examples

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

**Entry:** `src/font-weight`
**Bundle:** `dist/font-weight.lynx.bundle`

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

const FontWeight = () => {
  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <text style={{ fontWeight: "100", fontSize: "30px" }}>font-weight: 100</text>
      <text style={{ fontWeight: "200", fontSize: "30px" }}>font-weight: 200</text>
      <text style={{ fontWeight: "300", fontSize: "30px" }}>font-weight: 300</text>
      <text style={{ fontWeight: "400", fontSize: "30px" }}>font-weight: 400</text>
      <text style={{ fontWeight: "500", fontSize: "30px" }}>font-weight: 500</text>
      <text style={{ fontWeight: "600", fontSize: "30px" }}>font-weight: 600</text>
      <text style={{ fontWeight: "700", fontSize: "30px" }}>font-weight: 700</text>
      <text style={{ fontWeight: "800", fontSize: "30px" }}>font-weight: 800</text>
    </scroll-view>
  );
};

root.render(<FontWeight />);

```

v0.11.0



## Syntax

```css
/* Keyword values */
font-weight: normal;
font-weight: bold;

/* Numeric keyword values */
font-weight: 100;
font-weight: 200;
font-weight: 300;
font-weight: 400;
font-weight: 500;
font-weight: 600;
font-weight: 700;
font-weight: 800;
font-weight: 900;
font-weight: 1000;
```

### Values

- Default **normal** 

  Normal font weight. Same as `400`.

- `bold` 

  Bold font weight. Same as `700`

- `<number>` 

  A `<number>` value between 1 and 1000, inclusive. Higher numbers represent weights that are bolder than (or as bold as) lower numbers.

## Best Practices

- Do not using `font-weight` with `font-family`. Currently, lynx `font-family` is just a key-value mapping not a real 'family'. And using other font-weight may cause `font-family` not working.

## Formal definition

| Initial value | normal |
| Applies to | text |
| Inherited | yes |
| Animatable | no |


## Formal syntax

```
<font-weight> = normal | bold | [100, 1000]
```

## Differences from the Web

- Not support `border` and `lighter`

- Numeric types currently only support integer values from '100' to '1000'.

- The fallback logic of glyph mapping failure will vary on different platforms and system versions. In the worst case, the system default font may be fallback, resulting in the failure of custom fonts.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.font-weight`

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| font-weight | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`font-weight`**

**Specifications:**

