using js variables in css #5560
-
Hello there! I know that to use css from an outside URL I use this in svelte: but what if that URL Is saved in a js variable called testurl? |
Beta Was this translation helpful? Give feedback.
Answered by
mustofa-id
Jul 17, 2022
Replies: 1 comment 3 replies
-
JavaScript variable not accessible to |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
tryggs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
JavaScript variable not accessible to
<style ...>
scope. If you need to change css url dynamically, you can use<link ...>
in<svelte:head ...>
instead. Here is example: https://svelte.dev/repl/0c3e53d75e364e4a8903d1033c17f6fd?version=3.49.0