Ant Design System for Figma uses the Typography variables. The Typography collection is within the Local Variables library in your Figma file. Editing these variables will affect all components and styles that use them.
Ant Design defaults to using the system font, and in the Ant Design System for Figma, we've integrated the “SF Pro Text” font, which is specific to Mac systems. Ant Design of React uses system font family "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'". If you'd like to employ a different font family for your Figma project, you can find instructions below.
A default font family for code and keyboard text elements in Ant Design or React is "'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace'". In Figma, we use "Courier Prime" as a default code font family. If you want to use a different font family in you Figma project, follow the instructions below:
If you want to use a different font family for your headings:
Currently, Ant Design does not offer a token for controlling the font family specifically for headings when it differs from the fontFamily token. Instead, you can implement a straightforward CSS override. For instance, if your design team has utilized "Montserrat" with a font-weight of "800" exclusively for headings, you can adjust your CSS as follows:
If you want to edit font size:
In the Ant Design System for Figma, we use pixel values for text line heights (for example, 22px). In the Ant Design of React, however, the line height is based on decimal values (for example, 1.5). If you will change the line heights in Figma, make sure to convert the pixels to decimal values in your code correctly. If you want to edit the line height:
Ant Design by default applies a normal (400) font weight to text and paragraphs. In the Ant Design System for Figma, we introduced a specific variable (fontWeightNormal) to manage the font weight for all elements set to normal. However, this variable is not utilized in the Ant Design for React. If you want to modify the default font weight in your code, you should adjust it in the CSS. For instance, you can change it by setting body { font-weight: 500; }
. To modify the normal font weight in Figma:
The strong weight in the Ant Design System for Figma is used in headings and bold texts. If you want to edit the weight of the fontWeightStrong variable: