@mark1russell7/site-pages 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/package.json +4 -2
- package/styles/scroll-cue.css +31 -0
package/README.md
CHANGED
|
@@ -269,6 +269,31 @@ The variables are `--sp-bg`, `--sp-surface`, `--sp-sunken`, `--sp-fg`, `--sp-fg-
|
|
|
269
269
|
|
|
270
270
|
The pages operate at a width of 390 px without horizontal scroll. The timeline scrolls in its own box. The keyboard operates all controls: the arrow keys, Home and End move between the versions, and Enter or Space selects one. Without JavaScript, the releases page shows all versions.
|
|
271
271
|
|
|
272
|
+
## A cue on a box that scrolls
|
|
273
|
+
|
|
274
|
+
A wide code block or table on a narrow screen scrolls sideways. Without a cue, its text looks cut. The file `scroll-cue.css` of the package gives a cue:
|
|
275
|
+
|
|
276
|
+
- A shade shows at each edge that has more content. At an end of the box, the shade of that end goes.
|
|
277
|
+
- The cue uses only CSS. It needs no JavaScript.
|
|
278
|
+
|
|
279
|
+
Import the file in the site, and give the class `scroll-cue` to the box:
|
|
280
|
+
|
|
281
|
+
```ts
|
|
282
|
+
import "@mark1russell7/site-pages/scroll-cue.css";
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
```html
|
|
286
|
+
<pre class="scroll-cue">pnpm add @mark1russell7/site-pages</pre>
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
The class sets `overflow-x: auto` and the background color of the box. Set `--scroll-cue-bg` to the background color of the box, and `--scroll-cue-shade` to the color of the shade:
|
|
290
|
+
|
|
291
|
+
```css
|
|
292
|
+
.code {
|
|
293
|
+
--scroll-cue-bg: var(--code-bg);
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
272
297
|
## A GitHub Pages workflow
|
|
273
298
|
|
|
274
299
|
This workflow builds the site, adds the two pages, and deploys. It also starts every 3 hours, so the status page stays current without a push. A scheduled run builds the newest commit of `main` that passed CI.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@mark1russell7/site-pages",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.8",
|
|
5
5
|
"description": "A release timeline page and a live status page for the site of a GitHub repository: JSON data and standalone HTML, made at deploy time.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"github-pages",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"site-pages": "./build/cli.js"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
|
-
"build"
|
|
33
|
+
"build",
|
|
34
|
+
"styles"
|
|
34
35
|
],
|
|
35
36
|
"publishConfig": {
|
|
36
37
|
"access": "public"
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
"types": "./build/index.d.ts",
|
|
58
59
|
"import": "./build/index.js"
|
|
59
60
|
},
|
|
61
|
+
"./scroll-cue.css": "./styles/scroll-cue.css",
|
|
60
62
|
"./package.json": "./package.json"
|
|
61
63
|
}
|
|
62
64
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @mark1russell7/site-pages/scroll-cue.css: a cue on a box that scrolls sideways.
|
|
3
|
+
* A shade shows at each edge that has more content. When the box is at an end, the shade of that end goes.
|
|
4
|
+
* The cue uses only CSS: two covers scroll with the content, and two shades stay at the edges.
|
|
5
|
+
*
|
|
6
|
+
* Use: give the class scroll-cue to the box, and set --scroll-cue-bg to the background color of the box.
|
|
7
|
+
* <pre class="scroll-cue">...</pre>
|
|
8
|
+
* .my-code { --scroll-cue-bg: #f6f6f8; }
|
|
9
|
+
* The box gets overflow-x: auto. Its background color is --scroll-cue-bg.
|
|
10
|
+
*/
|
|
11
|
+
.scroll-cue {
|
|
12
|
+
--scroll-cue-bg: Canvas;
|
|
13
|
+
--scroll-cue-shade: color-mix(in srgb, CanvasText 28%, transparent);
|
|
14
|
+
--scroll-cue-size: 1.25rem;
|
|
15
|
+
overflow-x: auto;
|
|
16
|
+
overscroll-behavior-x: contain;
|
|
17
|
+
background-color: var(--scroll-cue-bg);
|
|
18
|
+
background-image:
|
|
19
|
+
linear-gradient(to right, var(--scroll-cue-bg) 40%, transparent),
|
|
20
|
+
linear-gradient(to left, var(--scroll-cue-bg) 40%, transparent),
|
|
21
|
+
radial-gradient(farthest-side at 0 50%, var(--scroll-cue-shade), transparent),
|
|
22
|
+
radial-gradient(farthest-side at 100% 50%, var(--scroll-cue-shade), transparent);
|
|
23
|
+
background-position: left center, right center, left center, right center;
|
|
24
|
+
background-size:
|
|
25
|
+
calc(var(--scroll-cue-size) * 2) 100%,
|
|
26
|
+
calc(var(--scroll-cue-size) * 2) 100%,
|
|
27
|
+
var(--scroll-cue-size) 100%,
|
|
28
|
+
var(--scroll-cue-size) 100%;
|
|
29
|
+
background-repeat: no-repeat;
|
|
30
|
+
background-attachment: local, local, scroll, scroll;
|
|
31
|
+
}
|