mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
278 B
19 lines
278 B
6 years ago
|
---
|
||
|
title: Shorthand class directive
|
||
|
---
|
||
|
|
||
|
Often, the name of the class will be the same as the name of the value it depends on:
|
||
|
|
||
|
```html
|
||
|
<div class:big={big}>
|
||
|
<!-- ... -->
|
||
|
</div>
|
||
|
```
|
||
|
|
||
|
In those cases we can use a shorthand form:
|
||
|
|
||
|
```html
|
||
|
<div class:big>
|
||
|
<!-- ... -->
|
||
|
</div>
|
||
|
```
|