You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{ slug: 'theme.css' }
No Venue found
NotFoundError: No Venue found
at /Users/binajmen/Projects/horeka-sveltekit/node_modules/@prisma/client/runtime/index.js:29421:13
at async load (/Users/binajmen/Projects/horeka-sveltekit/src/routes/[lang]/[...slug]/+layout.server.ts:24:18)
at async load_server_data (file:///Users/binajmen/Projects/horeka-sveltekit/node_modules/@sveltejs/kit/src/runtime/server/page/load_data.js:31:17)
at async file:///Users/binajmen/Projects/horeka-sveltekit/node_modules/@sveltejs/kit/src/runtime/server/page/index.js:144:13
Because I have a /routes/[lang]/[...slug]/.... I suppose by having href="theme.css", it concat theme.css with http://localhost:5173/en/, therefore pointing on the wrong route.
Thus my question: how do/would you handle that? 🙂
Unless I'm wrong, I can't really use svelte:head in my root layer to declare styles as I don't have access to the loaded data.
Update:
Adding a / did solve the problem: <link rel="stylesheet" href="/theme.css" />
But I'm still interested to know if that's the right approach to add dynamic styling 🤔
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Is there a way to generate a dynamic CSS file based on theme data coming from the database?
I've the current solution:
And
But when I visit http://localhost:5173/en/some-slug, I have the following issue:
Because I have a
/routes/[lang]/[...slug]/.... I suppose by havinghref="theme.css", it concattheme.csswithhttp://localhost:5173/en/, therefore pointing on the wrong route.Thus my question: how do/would you handle that? 🙂
Unless I'm wrong, I can't really use svelte:head in my root layer to declare styles as I don't have access to the loaded data.
Update:
Adding a
/did solve the problem:<link rel="stylesheet" href="/theme.css" />But I'm still interested to know if that's the right approach to add dynamic styling 🤔
Beta Was this translation helpful? Give feedback.
All reactions