import { Button } from 'some-css-in-js-lib'; export default function Page() { return <Button>Click me</Button>; }
Most CSS-in-JS libraries inject styles dynamically on the client side after hydration in Remix, unless configured for server extraction. This avoids FOUC but styles appear post-hydration.
In Remix, you import global CSS files by just importing the path as a side effect. You do not assign it to a variable.
import { Card } from 'ui-library'; import 'ui-library/dist/styles.css'; export default function Page() { return <Card>Content</Card>; }
The most likely cause is that the route does not export a links() function to include the CSS file in the HTML head, so styles are not applied.
Remix includes CSS links in the server-rendered HTML head, so styles are applied immediately when the page loads, before React hydrates the UI.
Combining CSS into a single file reduces HTTP requests and importing it once in the root layout ensures styles are loaded once for all pages, improving performance.