All Questions
17 questions
0
votes
2
answers
383
views
Apply transition to change of position
I was following the Svelte tutorial, more specifically the part about REST params, I tried to animate the whole thing; however, I only succeeded into animating what is inside the each block.
I wanted ...
1
vote
2
answers
315
views
Is there a good way to style HTML elements and re-expose all of their events in a Svelte component?
How would I go about styling HTML elements and re-exposing all of their events in a Svelte component? (essentially, I'm looking for the Svelte way to do styled-components)
For example, I'm trying to ...
5
votes
1
answer
1k
views
Svelte: doesn't work inline css animation
Doesn't work inline css animation like this:
<h1 class="test" style="animation: bg 2s linear infinite">Hello {name}!</h1>
<style>
.test {
background: yellow;...
1
vote
2
answers
2k
views
Svelte js How to pass styles to child (with passability to override)
In svelte, I want to write components in BEM style, so component was stylized by its own styles and then positioned from parent's styles
The problem: to do this, I need to put the component in a ...
2
votes
1
answer
1k
views
How to solve SvelteKit/Svelte <style> tag with squiggly line not recognising CSS @import
As the title suggests, I have been struggling to find a solution to this squiggly line problem as part of in my Svelte files.
I have looked all over the web and unforturnately I haven't yet being ...
4
votes
1
answer
2k
views
Global Descendant-Only Styles in Svelte
Is there a way in Svelte to add styles that only affect the current component and any descendant components?
Svelte supports a native :global() selector wrapper which will declare styles for that ...
7
votes
2
answers
8k
views
With Svelte : How to put component style in a separated file but still scoped to this component
I'm working on a table component which one will be usable (included in a library when it will work correctly)in any of my projects.
As there is a lot of css rules related to this component I would ...
12
votes
2
answers
6k
views
How to use two svelte transitions on the same togglable element?
I have an input field that I want to hide/show and doing so with a fade and slide transition. I've have two examples that I came up with but both have their drawbacks and I'd like to know if there is ...
1
vote
2
answers
4k
views
How do I get offset width of a div in Svelte?
I'm working with Svelte and I'd like to ask how can I get the value of offset width of a div?
This is my code
<script>
export let students // string array
let divWidth;
console.log(...
4
votes
1
answer
2k
views
Adding CSS custom properties dynamically to svelte components 3.38.0
Svelte added support for passing CSS custom properties to a component in 3.38.0
Which allows us to pass a css property like shown below.
<Drawer --test1="red">
Technically it makes a ...
1
vote
2
answers
3k
views
Pass global styles down to Svelte "custom element" components
I am "attempting" to use Sveltejs as a front-end web framework for a project built on Django (relevant as it defines the structure of my application). I am attempting to include Svelte ...
3
votes
0
answers
52
views
My css should be applying but it's ignored for some reason [duplicate]
This is only the component that is rendering the text that says "Forbidden" which is because I hit my GCP quota.
<script>
export let text;
export let color;
</script>
&...
2
votes
1
answer
1k
views
using onMount to add class dynamically to element
Using sapper. Trying to create an input and assign 2 classes "name border" to that dynamically created input element. The element is created but the class is not applied. Not sure why and ...
0
votes
2
answers
5k
views
Svelte styles in preprocess not include in build.css
I am creating an app in Svelte and I have a problem with styles.
I preprocess imports in style tags using the rollup.config.js file, not with svelte-preprocess, but with rollup-plugin-svelte ...
0
votes
1
answer
384
views
List Selected Checkbox Options in Same p Tag - Using Svelte
I'm currently learning how to use bindings in Svelte. I found this example that I am practicing with and would like to change the code slightly. I'm trying to make the selected items appear in 1 tag ...
3
votes
1
answer
3k
views
Remove or Modify CSS Classname "svelte-" Prefix
I have written a chatbot widget with Svelte, which should be able to be integrated into websites. The website owner gets the compiled JS and CSS file. So far so good.
But every website owner must ...
6
votes
1
answer
5k
views
How do I make a <div> contentEditable on doubleclick using Svelte?
I'm brand new to Svelte (3.0+)...and for my latest project, I'd like to emulate the functionality of many "todo" lists that allow you to edit todo items previously submitted by double-clicking on them ...