Why isn't CSS import working in my Remix template?

Dvaer
Shopify Partner
1 0 0

I am trying to import react big calendar in my shopify app in remix. When i try to import it and run, the import does not seem to work.
I have tried adding rules in the config file, changing the css directory and even putting it in public.
Does anyone know how to import css in the remix template?

Replies 2 (2)

myhackinfo
Shopify Partner
3 0 0

To add a custom CSS file in Remix, you first need to create a file in the /app/styles/ directory.

For example, you could create a file called setup.css.

Once you have created your CSS file, you need to add it to the links export of one of your Remix routes.

For example, you could add it to the links export of your app._index.jsx file.

 

import stylesUrl from "~/styles/setup.css";
export const links = () => {
  return [{ rel: "stylesheet", href: stylesUrl }];
};

 

hacun3jr
Shopify Partner
23 2 16

it worked!