Svelte · Junior · Question 27 of 76

What does the style: directive do?

<p style:color={color} style:--columns={columns}>...</p>

Explanation

Setting a custom property is a clean way to use JavaScript values in the component's CSS.

Further reading

Problem with a question

Svelte · Junior · question 27

Test yourself

Take the Svelte · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz