fix(curriculum): fix definition of custom property (#65533)

This commit is contained in:
Gary Yeung
2026-01-29 02:30:35 +08:00
committed by GitHub
parent a86be68b2b
commit 7012e8cd35
3 changed files with 6 additions and 6 deletions
@@ -21,9 +21,9 @@ The basic syntax of the `@property` rule is as follows:
}
```
The `--property-name` is the name of the custom property you're defining. Like all custom properties, it must start with two dashes. `--property-name` can be things like `<color>`, `<length>`, `<number>`, `<percentage>`, or more complex types.
The `--property-name` is the name of the custom property you're defining. Like all custom properties, it must start with two dashes.
`syntax` defines the type of the property.
`syntax` defines the type of the property, which can be things like `<color>`, `<length>`, `<number>`, `<percentage>`, or more complex types.
`inherits` specifies whether the property should inherit its value from its parent element.
@@ -40,8 +40,8 @@ body {
}
```
- **`--property-name`**: This is the name of the custom property you're defining. Like all custom properties, it must start with two dashes. `--property-name` can be things like `<color>`, `<length>`, `<number>`, `<percentage>`, or more complex types.
- **`syntax`**: This defines the type of the property.
- **`--property-name`**: This is the name of the custom property you're defining. Like all custom properties, it must start with two dashes.
**`syntax`**: This defines the type of the property, which can be things like `<color>`, `<length>`, `<number>`, `<percentage>`, or more complex types.
- **`inherits`**: This specifies whether the property should inherit its value from its parent element.
- **`initial-value`**: This sets the default value of the property.
- **Gradient Example Using the `@property` Rule**: This example creates a gradient that smoothly animates when the element is hovered over.
@@ -526,8 +526,8 @@ Using placeholder text is not great for accessibility. Too often, users confuse
}
```
- **`--property-name`**: This is the name of the custom property you're defining. Like all custom properties, it must start with two dashes. `--property-name` can be things like `<color>`, `<length>`, `<number>`, `<percentage>`, or more complex types.
- **`syntax`**: This defines the type of the property.
- **`--property-name`**: This is the name of the custom property you're defining. Like all custom properties, it must start with two dashes.
**`syntax`**: This defines the type of the property, which can be things like `<color>`, `<length>`, `<number>`, `<percentage>`, or more complex types.
- **`inherits`**: This specifies whether the property should inherit its value from its parent element.
- **`initial-value`**: This sets the default value of the property.
- **Fallbacks**: When using the custom property, you can provide a fallback value using the `var()` function, just as you would with standard custom properties.