Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: avoid using "lame" as a synonym for uncool #14852

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions documentation/docs/03-template-syntax/18-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ If the value is an object, the truthy keys are added:
</script>

<!-- results in `class="cool"` if `cool` is truthy,
`class="lame"` otherwise -->
<div class={{ cool, lame: !cool }}>...</div>
`class="uncool"` otherwise -->
<div class={{ cool, uncool: !cool }}>...</div>
```

If the value is an array, the truthy values are combined:
Expand Down Expand Up @@ -77,14 +77,14 @@ Prior to Svelte 5.16, the `class:` directive was the most convenient way to set

```svelte
<!-- These are equivalent -->
<div class={{ cool, lame: !cool }}>...</div>
<div class:cool={cool} class:lame={!cool}>...</div>
<div class={{ cool, uncool: !cool }}>...</div>
<div class:cool={cool} class:uncool={!cool}>...</div>
```

As with other directives, we can use a shorthand when the name of the class coincides with the value:

```svelte
<div class:cool class:lame={!cool}>...</div>
<div class:cool class:uncool={!cool}>...</div>
```

> [!NOTE] Unless you're using an older version of Svelte, consider avoiding `class:`, since the attribute is more powerful and composable.
Loading