Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
pull/7161/head
gtmnayan 4 years ago committed by GitHub
parent 6a2a944cae
commit 98587d1d27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
--- ---
title: Inline styles and the style directive title: Inline styles
--- ---
Apart from adding styles inside style tags, you can also add styles to individual elements using the style attribute. Usually you will want to do styling through CSS, but this can come in handy for dynamic styles, especially when combined with CSS custom properties. Apart from adding styles inside style tags, you can also add styles to individual elements using the style attribute. Usually you will want to do styling through CSS, but this can come in handy for dynamic styles, especially when combined with CSS custom properties.

@ -1,5 +1,5 @@
--- ---
title: Inline styles and the style directive title: The style directive
--- ---
Being able to set css properties dynamically is nice, however this can get unwieldly if you have to write a long string, and mistakes like missing any of the semicolons could make the whole string invalid. Therefore, Svelte provides a nicer way to write inline styles with the style directive. Being able to set css properties dynamically is nice, however this can get unwieldly if you have to write a long string, and mistakes like missing any of the semicolons could make the whole string invalid. Therefore, Svelte provides a nicer way to write inline styles with the style directive.

Loading…
Cancel
Save