Skip to content

more design tweaks #1594

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

Merged
merged 1 commit into from
Aug 21, 2024
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
10 changes: 5 additions & 5 deletions docs/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ A program block looks like this (note the semicolon):
const foo = 1 + 2;
```

A program block doesn’t display anything by default, but you can call [`display`](#display(value)) to display something.
A program block doesn’t display anything by default, but you can call [`display`](#display-value) to display something.

JavaScript blocks do not show their code by default. If you want to show the code, use the `echo` directive:

Expand Down Expand Up @@ -129,7 +129,7 @@ Expressions cannot declare top-level reactive variables. To declare a variable,

## Explicit display

The built-in [`display` function](#display(value)) displays the specified value.
The built-in [`display` function](#display-value) displays the specified value.

```js echo
const x = Math.random();
Expand Down Expand Up @@ -202,7 +202,7 @@ Inputs.button("Click me", {value: 0, reduce: (i) => displayThere(++i)})

## Implicit display

JavaScript expression fenced code blocks are implicitly wrapped with a call to [`display`](#display(value)). For example, this arithmetic expression displays implicitly:
JavaScript expression fenced code blocks are implicitly wrapped with a call to [`display`](#display-value). For example, this arithmetic expression displays implicitly:

```js echo
1 + 2 // implicit display
Expand Down Expand Up @@ -297,7 +297,7 @@ The current width of the main element in pixels as a reactive variable. A fenced
width
```

See [`Generators.width`](./lib/generators#width(element)) for implementation.
See [`Generators.width`](./lib/generators#width-element) for implementation.

## now

Expand All @@ -307,4 +307,4 @@ The current time in milliseconds since Unix epoch as a reactive variable. A fenc
now
```

See [`Generators.now`](./lib/generators#now()) for implementation.
See [`Generators.now`](./lib/generators#now) for implementation.
4 changes: 2 additions & 2 deletions docs/reactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Values that change over time — such as interactive inputs, animation parameter

<div class="note">As with implicit await and promises, implicit iteration of generators only applies <i>across</i> code blocks, not <i>within</i> a code block.</div>

As an example, here’s an HTML input element. By passing it to [`Generators.input`](<../lib/generators#input(element)>), we can define a generator that yields the input’s value each time it changes.
As an example, here’s an HTML input element. By passing it to [`Generators.input`](<../lib/generators#input-element>), we can define a generator that yields the input’s value each time it changes.

<input id="nameInput">

Expand Down Expand Up @@ -298,7 +298,7 @@ The `view` function does two things:
1. it [displays](../javascript#explicit-display) the given DOM *element*, and then
2. returns a corresponding value generator.

The `view` function uses [`Generators.input`](../lib/generators#input(element)) under the hood. As shown above, you can call `Generators.input` directly, say to declare the input as a top-level variable without immediately displaying it.
The `view` function uses [`Generators.input`](../lib/generators#input-element) under the hood. As shown above, you can call `Generators.input` directly, say to declare the input as a top-level variable without immediately displaying it.

```js echo
const subjectInput = html`<input type="text" placeholder="anonymous">`;
Expand Down
24 changes: 23 additions & 1 deletion docs/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,31 @@
--theme-foreground-focus: #148576;
}

h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: revert;
}

h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code,
code,
tt {
font-size: inherit;
font-size: revert;
}

code:not(pre code, h1 code, h2 code, h3 code, h4 code, h5 code, h6 code) {
color: var(--theme-foreground-alt);
background-color: var(--theme-background-alt);
padding: 2px 4px;
border-radius: 4px;
}

@media (prefers-color-scheme: dark) {
Expand Down