Skip to main content

All Questions

Tagged with
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="...
munHunger's user avatar
  • 3,061
-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 ...
Alex's user avatar
  • 66.3k
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-...
Amit Kumar Gupta's user avatar
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'; ...
Christopher Poulsen's user avatar
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 ...
Chris's user avatar
  • 1,475
-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 ...
Chistev's user avatar
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>...
munHunger's user avatar
  • 3,061
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 ...
Leonardo Cavalcante's user avatar
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 ...
learyjk's user avatar
  • 731
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 ...
Leonardo Cavalcante's user avatar
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 ...
16ar's user avatar
  • 175
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....
rh3h's user avatar
  • 1
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 ...
Yash's user avatar
  • 13
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> ...
Valentin Vignal's user avatar
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 ...
food's user avatar
  • 27

15 30 50 per page
1
2 3 4 5
24