From 511aa81acc66dce4ed73824b60d94158ee9197c9 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 24 Feb 2026 21:20:53 -0500 Subject: [PATCH] Apply suggestions from code review Co-authored-by: ComputerGuy <63362464+Ocean-OS@users.noreply.github.com> --- documentation/docs/97-best-practices/10-best-practices.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/docs/97-best-practices/10-best-practices.md b/documentation/docs/97-best-practices/10-best-practices.md index 88c4094fa9..19399a6a4f 100644 --- a/documentation/docs/97-best-practices/10-best-practices.md +++ b/documentation/docs/97-best-practices/10-best-practices.md @@ -91,9 +91,9 @@ Every snippet created as a child of a component will be automatically passed as Read [the `@attach` docs](/docs/svelte/@attach) for documentation on using the imperative DOM API with elements in a Svelte component. -## Use dynamic variables in css +## Using JavaScript variables in CSS -If you have a JS variable that you want to use inside CSS you can do so by using the `style:` directive. +If you have a JS variable that you want to use inside CSS you can do so with the `style:` directive. ```svelte
@@ -103,7 +103,7 @@ this will add a style attribute with the `--columns:` variable that you can use ## Dynamic classes -Since `svelte@5.16.0` you can use `clsx` style directly in the `class` attribute of an element +Since `svelte@5.16.0` you can use `clsx` styles directly in the `class` attribute of an element. This means that arrays and objects can be used to declaratively define classes for an element without having to do manual string concatenation. ```svelte