Remix
Remix is a full-stack JavaScript framework for building web applications. Importing fonts depends on the compiler you are using. Below are the steps to import fonts into a Remix project.
Vite Compiler
To import fonts into a Remix project using the Vite compiler, you can simply import the CSS file directly into your root.tsx
file.
1. Import CSS
Modify root.tsx
to include the following code:
⬤⬤
tsx
Note: You MUST include the
.css
extension when importing the file or you will get an error.
2. Usage
You can now use the imported fonts in your Remix.js project.
⬤⬤
css
Classic Remix Compiler
With the Classic Remix Compiler, you can leverage the CSS bundler plugin built into the framework.
1. Install the plugin
⬤⬤
sh
2. Configure the plugin
Modify root.tsx
to include the following code:
⬤⬤
tsx
3. Usage
You can now use the imported fonts in your Remix.js project.
⬤⬤
css
Read the official documentation on the plugin here.