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

Website improvements #134

Merged
merged 6 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions docs/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,23 @@

.content h1 {
@apply text-2xl font-bold;
padding-top: 48px;
margin-top: -48px;
}
.content h2 {
@apply text-xl font-bold;
padding-top: 48px;
margin-top: -48px;
}
.content h3 {
@apply text-lg font-bold;
padding-top: 48px;
margin-top: -48px;
}
.content h4 {
@apply text-base font-bold;
padding-top: 48px;
margin-top: -48px;
}

.content a {
Expand All @@ -47,3 +55,7 @@
padding-inline-start: 30px;
@apply list-disc;
}

.outline a {
@apply text-gray-600 hover:text-yellow-400 mb-1 inline-block transition-colors;
}
4 changes: 2 additions & 2 deletions docs/markdown/basics/reactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ How does the `create_effect(...)` function know to execute the closure every tim
Calling `create_effect` creates a new _"reactivity scope"_ and calling `state.get()` inside this scope adds itself as a _dependency_.
Now, when `state.set(...)` is called, it automatically calls all its _dependents_, in this case, `state` as it was called inside the closure.

> #### What's that `cloned!` macro doing?
> ## What's that `cloned!` macro doing?
>
> The `cloned!` macro is an utility macro for cloning the variables into the following expression. The previous `create_effect` function call could very well have been written as:
>
Expand Down Expand Up @@ -74,7 +74,7 @@ assert_eq!(*double.get(), 2);

Now that you understand `sycamore`'s reactivity system, we can look at how to use this to update the DOM.

### Using reactivity with DOM updates
## Using reactivity with DOM updates

Reactivity is automatically built-in into the `template!` macro. Say we have the following code:

Expand Down
Loading