Skip to content

Commit

Permalink
Merge pull request #102 from etn-ccis/fix/title-large-variant
Browse files Browse the repository at this point in the history
fix title large variant font weight
  • Loading branch information
ektaghag-eaton authored Apr 23, 2024
2 parents b402b68 + 26015fa commit 36df464
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@brightlayer-ui/react-native-themes",
"author": "Brightlayer UI <[email protected]>",
"license": "BSD-3-Clause",
"version": "7.0.1-alpha.4",
"version": "7.0.1-alpha.5",
"description": "React Native themes for Brightlayer UI applications",
"main": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const fontConfig = {
},
titleLarge: {
fontFamily: 'OpenSans-Regular',
fontWeight: '600' as const,
fontWeight: '400' as const,
fontSize: 22,
lineHeight: 28,
},
Expand Down

0 comments on commit 36df464

Please sign in to comment.