-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change behaviour of
data-star-ignore
(#505)
* Change behaviour of `data-star-ignore`, add mod * Improve example
- Loading branch information
Showing
10 changed files
with
62 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## Ignore Attributes | ||
|
||
## Demo | ||
|
||
<div data-signals-foo="'A valid signal'" class="text-primary"> | ||
<div data-star-ignore__self data-text="$notASignal"> | ||
<div data-text="$foo"></div> | ||
</div> | ||
</div> | ||
|
||
## Explanation | ||
|
||
```html | ||
<div data-signals-foo="'A valid signal'"> | ||
<div data-star-ignore__self data-text="$notASignal"> | ||
<div data-text="$foo"></div> | ||
</div> | ||
</div> | ||
``` | ||
|
||
This demonstrates how adding the `data-star-ignore__self` attribute to an element prevents the element from being processed by Datastar. | ||
|
||
The `__self` modifier limits the behavior to the element itself. Removing the `__self` modifier would cause Datastar also ignore the descendant elements. | ||
|
||
```html | ||
<div data-star-ignore data-text="$notASignal"> | ||
<div data-text="$alsoNotASignal"></div> | ||
</div> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters