Skip to content

Commit c7236c3

Browse files
committed
docs polish + new icons (and mobile nav fix)
1 parent b8f8416 commit c7236c3

32 files changed

Lines changed: 102 additions & 58 deletions

www/commands/add.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The `when` clause lets you filter which elements in the target actually get the
2424
_="on change add { --accent-color: my.value } to document.body"
2525
/>
2626

27-
<button _="on click add [@disabled='true'] to <button/> when it is not me">Disable Other Buttons</button>
27+
<button _="on click add @disabled='true' to <button/> when it is not me">Disable Other Buttons</button>
2828

2929
<button _="on click add .{'-foo-bar'} to #that">Add Class With A Dash Prefix!</button>
3030

@@ -39,6 +39,13 @@ add item to myArray -- array.push(item)
3939
add item to mySet -- set.add(item)
4040
```
4141

42+
### See also
43+
44+
- [`remove`](/commands/remove) -- the inverse operation
45+
- [`take`](/commands/take) -- move a class or attribute from one element to another
46+
- [`toggle`](/commands/toggle) -- flip a class or attribute on and off
47+
- [`show`](/commands/show) / [`hide`](/commands/hide) -- also support the `when` clause for per-element filtering
48+
4249
### Syntax
4350

4451
```ebnf

www/commands/fetch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ To cancel a fetch request, send a `fetch:abort` event to the element that trigge
155155
If you need to fetch from a dynamically-generated URL, use a [template literal string](/expressions/string/) as the URL:
156156

157157
```hyperscript
158-
set userId to my [@data-userId]
158+
set userId to my @data-userId
159159
fetch `/users/${userId}/profile` as JSON -- parsed into an object
160160
```
161161

www/commands/hide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ More information here: [Safelisting specific utilities - Tailwind CSS v4.0](http
106106
<div _="on click hide with twOpacity">Hide Me With Opacity!</div>
107107
```
108108

109+
### See also
110+
111+
- [`show`](/commands/show) -- the inverse operation
112+
- [`toggle`](/commands/toggle) -- flip between shown and hidden
113+
- [`add`](/commands/add) / [`remove`](/commands/remove) -- also support the `when` clause for per-element filtering
114+
109115
### Syntax
110116

111117
```ebnf

www/commands/put.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: put - ///_hyperscript
66

77
The `put` command inserts content into a variable, property, or the DOM. It reads naturally for placement operations like "put X into Y" or "put X after Y".
88

9-
Content added to the DOM via `put` will have any hyperscript within it automatically initialized -- no need to call `processNode()`.
9+
Content added to the DOM via `put` will have any hyperscript within it automatically initialized -- no need to call `_hyperscript.process()`.
1010

1111
### Examples
1212

www/commands/remove.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ the property. This keeps the common case `remove firstChild of me`
6969
doing what you'd expect.
7070
{% endnote %}
7171

72+
### See also
73+
74+
- [`add`](/commands/add) -- the inverse operation
75+
- [`take`](/commands/take) -- move a class or attribute from one element to another
76+
- [`toggle`](/commands/toggle) -- flip a class or attribute on and off
77+
- [`show`](/commands/show) / [`hide`](/commands/hide) -- also support the `when` clause for per-element filtering
78+
7279
### Syntax
7380

7481
```ebnf

www/commands/show.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ If you're using Tailwind CSS, you can use their utility classes instead. Set `_h
7575
</div>
7676
```
7777

78+
### See also
79+
80+
- [`hide`](/commands/hide) -- the inverse operation
81+
- [`toggle`](/commands/toggle) -- flip between shown and hidden
82+
- [`add`](/commands/add) / [`remove`](/commands/remove) -- also support the `when` clause for per-element filtering
83+
7884
### Syntax
7985

8086
```ebnf

www/commands/take.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ take <class-ref+ | attribute-ref> [with <value>] [from <source> [giving <value>]
1919
| Clause | What it does | Default if omitted |
2020
|-----------------------|--------------|--------------------|
2121
| `<class-ref>` | One or more `.classNames` to move | - required form A |
22-
| `<attribute-ref>` | An `@attr` or `[@attr='value']` to move | - required form B |
22+
| `<attribute-ref>` | An `@attr` or `@attr='value'` to move | - required form B |
2323
| `with <value>` | A *replacement* given to the `from` elements instead of having the class/attribute removed. For the attribute form `<value>` is any expression; for the class form it is a single class reference. | class is removed / attribute is removed |
2424
| `from <expression>` | Source element(s) to take from | for classes: any element on the page that has the class; for attributes: must be specified |
2525
| `giving <value>` | Same meaning as `with`, but written *after* the `from` clause where it usually reads more naturally. Cannot be combined with `with`. | - |

www/commands/toggle.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: toggle - ///_hyperscript
44

55
## The `toggle` Command
66

7-
The `toggle` command flips classes, attributes, or visibility on and off -- the simplest way to create interactive UI.
7+
The `toggle` command flips classes, attributes, or visibility on and off.
88

99
You can toggle:
1010

@@ -36,7 +36,7 @@ Toggle a class on another element:
3636
Toggle an attribute:
3737

3838
```html
39-
<button _="on click toggle [@disabled='true']">Toggle Disabled!</button>
39+
<button _="on click toggle @disabled='true'">Toggle Disabled!</button>
4040
```
4141

4242
Toggle with a timeout - reverts after the duration:

www/css/os9.css

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,16 @@ body {
120120
position: sticky;
121121
top: 0;
122122
z-index: 100;
123+
height: 44px;
124+
box-sizing: border-box;
123125
}
124126

125127
.navbar nav {
126128
max-width: 94ch;
127129
margin: 0 auto;
128130
display: flex;
129131
align-items: center;
132+
height: 100%;
130133
}
131134

132135
.nav-links {
@@ -147,7 +150,7 @@ body {
147150
color: var(--text);
148151
font-family: var(--font-heading);
149152
font-size: 0.95rem;
150-
padding: 8px 14px;
153+
padding: 10px 14px;
151154
}
152155

153156
.navbar a:hover {
@@ -159,7 +162,7 @@ body {
159162

160163
/* Logo */
161164
.nav-logo-img {
162-
height: 44px;
165+
height: 28px;
163166
width: auto;
164167
image-rendering: pixelated;
165168
vertical-align: middle;
@@ -275,8 +278,8 @@ body {
275278
flex-direction: column;
276279
justify-content: center;
277280
gap: 4px;
278-
width: 32px;
279-
height: 32px;
281+
width: 36px;
282+
height: 36px;
280283
padding: 4px;
281284
background: none;
282285
border: none;
@@ -304,16 +307,23 @@ body {
304307
left: -1rem;
305308
right: -1rem;
306309
background: var(--bg);
307-
border-bottom: 1px solid var(--border);
308310
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
309-
padding: 8px 0;
311+
padding: 0;
310312
z-index: 98;
311313
gap: 0;
312314
max-height: 0;
313315
overflow: hidden;
314-
transition: max-height 0.2s ease-out;
316+
box-sizing: border-box;
317+
pointer-events: none;
318+
border-bottom: 0 solid var(--border);
319+
transition: max-height 0.2s ease-out, border-bottom-width 0s linear 0.2s;
320+
}
321+
.nav-open .nav-links {
322+
max-height: 500px;
323+
pointer-events: auto;
324+
border-bottom-width: 1px;
325+
transition: max-height 0.2s ease-out, border-bottom-width 0s linear;
315326
}
316-
.nav-open .nav-links { max-height: 500px; }
317327
.nav-links li { width: 100%; text-align: center; }
318328
.nav-links a {
319329
display: block;

www/css/site.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
line-height: 1;
3939
margin-bottom: 0.5rem;
4040
}
41+
img.docs-card-icon {
42+
width: 64px;
43+
height: 64px;
44+
object-fit: contain;
45+
image-rendering: pixelated;
46+
}
4147
.docs-card strong {
4248
font-family: var(--font-heading);
4349
font-size: 1.05rem;

0 commit comments

Comments
 (0)