Skip to content

Commit b0ecfcf

Browse files
authored
more design tweaks (#1594)
1 parent 1f7489b commit b0ecfcf

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

docs/javascript.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ A program block looks like this (note the semicolon):
2828
const foo = 1 + 2;
2929
```
3030

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

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

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

130130
## Explicit display
131131

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

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

203203
## Implicit display
204204

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

207207
```js echo
208208
1 + 2 // implicit display
@@ -297,7 +297,7 @@ The current width of the main element in pixels as a reactive variable. A fenced
297297
width
298298
```
299299

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

302302
## now
303303

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

310-
See [`Generators.now`](./lib/generators#now()) for implementation.
310+
See [`Generators.now`](./lib/generators#now) for implementation.

docs/reactivity.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Values that change over time — such as interactive inputs, animation parameter
126126

127127
<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>
128128

129-
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.
129+
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.
130130

131131
<input id="nameInput">
132132

@@ -298,7 +298,7 @@ The `view` function does two things:
298298
1. it [displays](../javascript#explicit-display) the given DOM *element*, and then
299299
2. returns a corresponding value generator.
300300
301-
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.
301+
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.
302302
303303
```js echo
304304
const subjectInput = html`<input type="text" placeholder="anonymous">`;

docs/style.css

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,31 @@
99
--theme-foreground-focus: #148576;
1010
}
1111

12+
h1,
13+
h2,
14+
h3,
15+
h4,
16+
h5,
17+
h6 {
18+
margin-top: revert;
19+
}
20+
21+
h1 code,
22+
h2 code,
23+
h3 code,
24+
h4 code,
25+
h5 code,
26+
h6 code,
1227
code,
1328
tt {
14-
font-size: inherit;
29+
font-size: revert;
30+
}
31+
32+
code:not(pre code, h1 code, h2 code, h3 code, h4 code, h5 code, h6 code) {
33+
color: var(--theme-foreground-alt);
34+
background-color: var(--theme-background-alt);
35+
padding: 2px 4px;
36+
border-radius: 4px;
1537
}
1638

1739
@media (prefers-color-scheme: dark) {

0 commit comments

Comments
 (0)