fontWeight
Set an inheritable font weight.
fontWeight(value) accepts a FontWeight value. It inherits through container views and overrides the weight supplied by the current font.
import { Font, FontWeight, Modifier, Text, VStack } from "onescript/views"
<VStack modifier={Modifier
.font(Font.body)
.fontWeight(FontWeight.medium)}>
<Text>Inherited medium weight</Text>
<Text modifier={Modifier.fontWeight(FontWeight.bold)}>Bold override</Text>
</VStack>| Value | Relative weight |
|---|---|
FontWeight.ultraLight | 100 |
FontWeight.thin | 200 |
FontWeight.light | 300 |
FontWeight.regular | 400 |
FontWeight.medium | 500 |
FontWeight.semibold | 600 |
FontWeight.bold | 700 |
FontWeight.heavy | 800 |
FontWeight.black | 900 |
How is this guide?
Last updated on