All Questions
349 questions
0
votes
1
answer
61
views
css gets transitioned at first mount
I have a svelte app that mounts some progress dots into a pretty plain html site.
simplified the ProgressDots.svelte has this:
hello
<div class="progress-dots">
<div class="...
-3
votes
1
answer
35
views
Svelte multiple small components vs regular html elements
Does it affect performance having svelte components instead of regular HTML elements, for small things like buttons, links etc?
Wrapping these elements in a svelte component would make it more ...
0
votes
1
answer
47
views
How to Sync Scrolling between 2 containers while displaying panel on hover
In my svelte component, I'm displaying line numbers for each line in text area. I've disabled the scrolling of line number. And manually sync line number container when I scroll on text area. overflow-...
0
votes
1
answer
64
views
How to get a component's children height?
I'm trying to create a component that will render it's children when it comes into the viewport, here's the code:
<script lang="ts">
import type { Snippet } from 'svelte';
...
1
vote
1
answer
69
views
Svelte Responsive Menu does not show vertical items on narrow screen
I can't get this W3C Responsive Menu to work in Svelte. The menu horizontal navbar is correctly hidden, but I cannot get the vertical version to show. The demo on the W3C site works.
When I build it ...
-1
votes
1
answer
51
views
Open Graph content not rendering correctly on Meta platforms, but works on Twitter
I have a blog built with Django on the server and Sveltekit on the frontend.
When I share a link to a blog post to Twitter, the link preview renders properly with the blog's image and title.
But when ...
1
vote
2
answers
369
views
controlling css order in vite dev server
I have a webpage, that loads a script from a vite dev server.
so at the end of body I have this tag
<script type="module" src="https://localhost:5173/index.ts"></script>...
2
votes
1
answer
112
views
"Uncaught (in promise) TypeError: ...img is undefined" when using @sveltejs/enhanced-img with dynamic image URLs
I'm encountering an issue using @sveltejs/enhanced-img in my Svelte project. I've installed it via npm install --save-dev @sveltejs/enhanced-img and configured it in vite.config.js.
My setup involves ...
0
votes
1
answer
91
views
Serving .js and .css from Vite + Svelte to a static website
I have a pre-existing website using a popular website builder.
I want to be able to inject interactive svelte components on certain blog pages to help demonstrate concepts.
I got a rough prototype ...
2
votes
1
answer
181
views
Svelte 5: Form briefly appears then disappears on page load when using conditional rendering for an image
I'm encountering a strange issue with a Svelte 5 component where a form briefly flashes on the screen for about half a second when the page loads, and then disappears. This happens when I have ...
1
vote
1
answer
132
views
Hydration issue when server-side loading HTML content
I am loading HTML content from a Supabase repo. When I display the content without the @html tag it shows (as plain text), but when I encapsulate it with {@html ...} nothing is shown and I get a ...
0
votes
2
answers
198
views
SvelteKit - Redirect after Form Submit
I have a problem with redirecting after submitting form in SvelteKit.
I have some routes that needs authentication, before rendering it I'm checking if user is authenticated.
routes
│ ├── +page....
0
votes
1
answer
243
views
Why is my rune that holds an array, not being reactive?
In a separate .svelte.js file I have
export let allQuestionsRune = $state([new ObjectWithStringProperty("hi")])
Then in a button onClick method in some +page file I am doing
...
0
votes
2
answers
84
views
How to nest <a> inside <a>? [duplicate]
I'm using Svelte 5.
<a href="my-first-link">
<div>
<!-- Some elements -->
</div>
<a href="my-second-link">
<div>
...
0
votes
1
answer
266
views
Set `body` `background-color` programmatically in Svelte?
I'm making a site using Svelte and SvelteKit, and I'd like to use a predefined array of colors for styling in a normalized way-- if I change one of the values later, everywhere that styles using that ...