Recall & Review
beginner
What does importing CSS per route mean in Remix?
It means loading CSS files only for the specific route or page that needs them, not globally. This helps keep styles organized and improves page load speed.
Click to reveal answer
beginner
How do you add CSS imports for a route in Remix?
You export a
links function from the route module that returns an array of objects with rel and href keys pointing to the CSS file.Click to reveal answer
intermediate
Why is CSS imported per route better than a global CSS file?
Because it only loads the styles needed for that page, reducing unused CSS and improving performance and maintainability.
Click to reveal answer
beginner
What is the shape of the object returned by the
links function in Remix?An array of objects where each object has
rel (usually 'stylesheet') and href (path to CSS file) properties.Click to reveal answer
intermediate
Can you import multiple CSS files per route in Remix?Yes, the
links function can return multiple objects to load several CSS files for a single route.Click to reveal answer
In Remix, where do you specify CSS files to load for a route?
✗ Incorrect
The
links function is the official way to tell Remix which CSS files to load for a route.What should the
rel property be set to when importing CSS in Remix?✗ Incorrect
The
rel attribute must be 'stylesheet' to load CSS files properly.Why might you prefer CSS imports per route over a single global CSS file?
✗ Incorrect
Importing CSS per route helps load only needed styles, making pages faster.
Can the
links function return multiple CSS files for one route?✗ Incorrect
The
links function returns an array, so you can include multiple CSS files.What happens if you forget to export the
links function in a Remix route?✗ Incorrect
Without the
links export, Remix won't know to load any CSS for that route.Explain how to import CSS files per route in Remix and why this is useful.
Think about how Remix knows which CSS to load for each page.
You got /4 concepts.
Describe the structure and purpose of the links function in Remix routes.
This function controls CSS loading per route.
You got /5 concepts.