Closed gspasov closed 2 years ago
Are you importing the default theme file? It's needed to give components the correct styling through variables. https://fluent-svelte.vercel.app/docs/getting-started#step-2-add-theme-file
Yup, this does it. But what if I wish to have the process ring in another color? What would be the best way to accomplish this?
Yup, this does it. But what if I wish to have the process ring in another color? What would be the best way to accomplish this?
Either add a class
to the ProgressRing and manually style it (note that class
es on components need to be wrapped in :global()
), or use style props:
<ProgressRing --fds-accent-default="red" />
Note that while the style props approach looks nicer in svelte, it will add an inline style and an extra <div>
wrapper if you're okay with that.
Before you start...
Description
When adding
ProgressRing
to my SvelteKit project I was expecting the Ring to have the color that was showcased in the Docs. When going to the page I didn't even see theProgressRing
. Going to theElements
section of the dev tools I saw that the html was present, and there was a stroke color assigned from a variable (var(--fds-accent-default)
), yet thecircle
had no color, hence it was invisible.To add color I did the following:
Which is basically going around the issue. Which is: How to set the color of the ring?
Alternative solutions
What I propose is to expose a variable called
stroke
on which the User can set the desirable color of theProgressRing
.Maybe something like:
If
stroke
is a bit confusing you could go withcolor
like so as well:Relevant Assets
No response