Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ektaghag-eaton committed Apr 22, 2024
1 parent c137b25 commit 26015fa
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,12 @@ const theme = useExtendedTheme();
</Button>
```

## Changing fontWeight of a Text Element
## Usage of useFontWeight hook in your project

When you need to change the `fontWeight` of a `Text` element in your application, it's important to note that it should be done through the `fontFamily` property rather than the `fontWeight` property.

The `fontFamily` property allows you to specify the font and its weight. By using the appropriate font family that supports the desired weight, you can achieve the desired fontWeight effect.

For example, if you want to set the fontWeight to "bold", you can use a font family that includes a bold variant, such as:
When the fontFamily of a Text element in your application needs to be modified, you can use the useFontWeight hook.For instance, to set the fontWeight to "bold", you can utilize the useFontWeight() hook as demonstrated below:

```tsx
<Text variant={'headlineLarge'} style={{ fontFamily: 'OpenSans-Bold' }}>
<Text variant={'headlineLarge'} style={{ ...fontStyleBold }}>
headlineLarge
</Text>
```
Expand Down

0 comments on commit 26015fa

Please sign in to comment.