Customizing your store’s typography
Introduction
In addition to being crucial for communicating with users, a store’s typography should be a reflection of its identity, using its characteristic styles, such as font size and spacing.
Whether using the admin’s CMS or your store theme CSS files, Store Framework gives you the flexibility to customize your store’s typography according to your business needs.
Step by step
Using store theme CSS files
- Open your store theme directory using a code editor of your preference.
- Create a new folder inside the
assets
directory calledfonts
. Make sure your app have the assets builder in its manifest. - Add the font files inside this folder (
assets/fonts/
).
.ttf
or .woff
.
- In
styles/configs
folder, create a new file calledfont-faces.css
. - Use the
@font-face
rule declaring the CSS properties you desire to apply in your website typography. For example:
@font-face {
font-family: 'MyHelvetica';
src: url(assets/fonts/MyHelvetica.woff2), url(assets/fonts/MyHelvetica.ttf);
font-weight: bold;
}
font-faces.css
is a global file meaning its configurations are applied to all texts from the website. If you want to customize a component's typography independently, overriding the global configurations,you should declare the font-faces.css
file still and refer the desired component font using the font-family
property in the app's CSS overriding file.
Using store's admin
- Access Styles in the desired account’s admin, in CMS.
- Select the More Options (three dots) menu for the store’s style whose typography will be edited.
- Click on Edit and select Typography.
In the Font Family section, you can add a font family of your choosing in order to use in your store’s theme. Simply click on Add custom font and upload the desired font’s file.
Remember to give a name for the font family recently uploaded by you, otherwise you won't be able to properly save your changes.
.ttf
or .woff
.
After choosing the font family, you can apply it to your store’s text content. The Type Token option displays all your store’s text content that can be customized. In addition to each one’s font families, you can also customize other parameters, such as Font Weight, Font Size, capitalization (Text Transform) and spacing (Letter Spacing).
For a better understanding of this feature and customization recommendations for each of your store’s text content, access the VTEX Styleguide.
Updated 10 days ago