@nxgt/material 3.3.0 → 3.4.0

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +3 -3
  3. package/dist/backgrounds/backgrounds.css +30 -1
  4. package/dist/backgrounds/css-react/blobs.css +65 -0
  5. package/dist/backgrounds/css-react/bubbles.css +41 -0
  6. package/dist/backgrounds/css-react/checker.css +47 -0
  7. package/dist/backgrounds/css-react/chevrons.css +46 -0
  8. package/dist/backgrounds/css-react/circuit.css +111 -0
  9. package/dist/backgrounds/css-react/concrete.css +41 -0
  10. package/dist/backgrounds/css-react/diagonal-checker.css +48 -0
  11. package/dist/backgrounds/css-react/glass.css +99 -0
  12. package/dist/backgrounds/css-react/graph-paper.css +74 -0
  13. package/dist/backgrounds/css-react/halo.css +66 -0
  14. package/dist/backgrounds/css-react/hexagons.css +79 -0
  15. package/dist/backgrounds/css-react/illustrated.css +164 -0
  16. package/dist/backgrounds/css-react/leaves.css +41 -0
  17. package/dist/backgrounds/css-react/linen.css +44 -0
  18. package/dist/backgrounds/css-react/marble.css +55 -0
  19. package/dist/backgrounds/css-react/music.css +2 -0
  20. package/dist/backgrounds/css-react/night-sky.css +41 -0
  21. package/dist/backgrounds/css-react/paper.css +49 -0
  22. package/dist/backgrounds/css-react/plasma.css +53 -0
  23. package/dist/backgrounds/css-react/rays.css +67 -0
  24. package/dist/backgrounds/css-react/ripples.css +68 -0
  25. package/dist/backgrounds/css-react/school.css +2 -0
  26. package/dist/backgrounds/css-react/science.css +2 -0
  27. package/dist/backgrounds/css-react/sport.css +2 -0
  28. package/dist/backgrounds/css-react/travel.css +2 -0
  29. package/dist/backgrounds.js +57 -33
  30. package/dist/lib/backgrounds/background/available.d.ts +3 -3
  31. package/dist/lib/backgrounds/background/background.d.ts +2 -2
  32. package/dist/lib/backgrounds/index.d.ts +1 -1
  33. package/dist/material.css +1 -1
  34. package/docs/components/navigation-and-layout.md +1 -1
  35. package/docs/getting-started.md +1 -1
  36. package/docs/guides/backgrounds.md +94 -16
  37. package/docs/previews/backgrounds-geometry-more.webp +0 -0
  38. package/docs/previews/backgrounds-illustrated-scenes.webp +0 -0
  39. package/docs/previews/backgrounds-light-more.webp +0 -0
  40. package/docs/previews/backgrounds-material-more.webp +0 -0
  41. package/docs/previews/backgrounds-matrix.webp +0 -0
  42. package/docs/previews/backgrounds-motif-shapes.webp +0 -0
  43. package/docs/roadmap.md +16 -4
  44. package/docs/troubleshooting.md +2 -2
  45. package/lib/backgrounds/backgrounds.css +30 -1
  46. package/lib/backgrounds/css-react/blobs.css +65 -0
  47. package/lib/backgrounds/css-react/bubbles.css +41 -0
  48. package/lib/backgrounds/css-react/checker.css +47 -0
  49. package/lib/backgrounds/css-react/chevrons.css +46 -0
  50. package/lib/backgrounds/css-react/circuit.css +111 -0
  51. package/lib/backgrounds/css-react/concrete.css +41 -0
  52. package/lib/backgrounds/css-react/diagonal-checker.css +48 -0
  53. package/lib/backgrounds/css-react/glass.css +99 -0
  54. package/lib/backgrounds/css-react/graph-paper.css +74 -0
  55. package/lib/backgrounds/css-react/halo.css +66 -0
  56. package/lib/backgrounds/css-react/hexagons.css +79 -0
  57. package/lib/backgrounds/css-react/illustrated.css +164 -0
  58. package/lib/backgrounds/css-react/leaves.css +41 -0
  59. package/lib/backgrounds/css-react/linen.css +44 -0
  60. package/lib/backgrounds/css-react/marble.css +55 -0
  61. package/lib/backgrounds/css-react/music.css +2 -0
  62. package/lib/backgrounds/css-react/night-sky.css +41 -0
  63. package/lib/backgrounds/css-react/paper.css +49 -0
  64. package/lib/backgrounds/css-react/plasma.css +53 -0
  65. package/lib/backgrounds/css-react/rays.css +67 -0
  66. package/lib/backgrounds/css-react/ripples.css +68 -0
  67. package/lib/backgrounds/css-react/school.css +2 -0
  68. package/lib/backgrounds/css-react/science.css +2 -0
  69. package/lib/backgrounds/css-react/sport.css +2 -0
  70. package/lib/backgrounds/css-react/travel.css +2 -0
  71. package/package.json +103 -2
@@ -0,0 +1,74 @@
1
+ /* The `graph-paper` preset: a soft squared grid, 20 px cells with a line every
2
+ * fifth (100 px) barely stronger, drawn from the top left corner so every line
3
+ * lands on a whole pixel. Thin, pale lines in the tone's colour, fading out
4
+ * toward the edges, with fine line doodles (`gp-d`) in an SVG scene, sparse
5
+ * and none around the content. Layers: `wash` (a tint), `grid` and the scene.
6
+ * React only: nothing in the shared `css/` folder. */
7
+ @import "../css/scene.css";
8
+
9
+ @layer components {
10
+ [data-background="graph-paper"] > [data-layer="wash"] {
11
+ position: absolute;
12
+ inset: 0;
13
+ background-image: linear-gradient(
14
+ 180deg,
15
+ color-mix(in oklab, var(--nxgt-bg-c1) var(--nxgt-bg-a1), transparent),
16
+ transparent 70%
17
+ );
18
+ }
19
+ [data-background="graph-paper"] > [data-layer="grid"] {
20
+ --nxgt-bg-l1: color-mix(
21
+ in oklab,
22
+ var(--nxgt-bg-c1) calc(var(--nxgt-bg-a2) * 0.5),
23
+ transparent
24
+ );
25
+ --nxgt-bg-l2: color-mix(
26
+ in oklab,
27
+ var(--nxgt-bg-c1) calc(var(--nxgt-bg-a2) * 0.8),
28
+ transparent
29
+ );
30
+ position: absolute;
31
+ inset: 0;
32
+ background-image:
33
+ linear-gradient(to right, var(--nxgt-bg-l2) 1px, transparent 1px),
34
+ linear-gradient(to bottom, var(--nxgt-bg-l2) 1px, transparent 1px),
35
+ linear-gradient(to right, var(--nxgt-bg-l1) 1px, transparent 1px),
36
+ linear-gradient(to bottom, var(--nxgt-bg-l1) 1px, transparent 1px);
37
+ background-size:
38
+ 100px 100px,
39
+ 100px 100px,
40
+ 20px 20px,
41
+ 20px 20px;
42
+ background-position: 0 0;
43
+ -webkit-mask-image: radial-gradient(
44
+ ellipse 75% 70% at 50% 45%,
45
+ black 15%,
46
+ transparent 100%
47
+ );
48
+ mask-image: radial-gradient(
49
+ ellipse 75% 70% at 50% 45%,
50
+ black 15%,
51
+ transparent 100%
52
+ );
53
+ }
54
+ [data-background="graph-paper"] > [data-scene] .gp-d {
55
+ color: var(--nxgt-bg-c1);
56
+ opacity: calc(var(--nxgt-bg-op) * 0.7);
57
+ }
58
+ }
59
+
60
+ @media (prefers-reduced-motion: no-preference) {
61
+ /* One major cell (100 px, five minor ones), so the loop has no jump. */
62
+ @keyframes nxgt-bg-graph-paper-pan {
63
+ to {
64
+ background-position: 100px 100px;
65
+ }
66
+ }
67
+
68
+ @layer components {
69
+ [data-background="graph-paper"][data-animated] > [data-layer="grid"] {
70
+ animation: nxgt-bg-graph-paper-pan 24s linear infinite
71
+ var(--nxgt-bg-play, running);
72
+ }
73
+ }
74
+ }
@@ -0,0 +1,66 @@
1
+ /* The `halo` preset: a ring of light. A conic gradient through the tone's
2
+ * three colours, cut to a soft ring and blurred (`halo`, a square centred a
3
+ * little above the middle), over a tint (`wash`). CSS only. Blended with the
4
+ * page: it adds light in dark. Motion (opt-in, `animated`): the colours turn
5
+ * round the ring. React only: nothing in the shared `css/` folder. */
6
+ @layer components {
7
+ [data-background="halo"] {
8
+ overflow: clip;
9
+ isolation: isolate;
10
+ }
11
+ [data-background="halo"] > [data-layer="wash"] {
12
+ position: absolute;
13
+ inset: 0;
14
+ background-image: radial-gradient(
15
+ circle at 50% 44%,
16
+ color-mix(in oklab, var(--nxgt-bg-c1) var(--nxgt-bg-a2), transparent),
17
+ transparent 60%
18
+ );
19
+ }
20
+ [data-background="halo"] > [data-layer="halo"] {
21
+ position: absolute;
22
+ top: 44%;
23
+ left: 50%;
24
+ width: max(70vmin, 22rem);
25
+ aspect-ratio: 1 / 1;
26
+ margin: calc(max(70vmin, 22rem) / -2) 0 0 calc(max(70vmin, 22rem) / -2);
27
+ border-radius: 9999px;
28
+ opacity: var(--nxgt-bg-op);
29
+ mix-blend-mode: var(--nxgt-bg-glow-blend);
30
+ filter: blur(18px);
31
+ background-image: conic-gradient(
32
+ from 0deg,
33
+ var(--nxgt-bg-c1),
34
+ var(--nxgt-bg-c2),
35
+ var(--nxgt-bg-c3),
36
+ var(--nxgt-bg-c1)
37
+ );
38
+ -webkit-mask-image: radial-gradient(
39
+ closest-side,
40
+ transparent 56%,
41
+ black 72%,
42
+ transparent 90%
43
+ );
44
+ mask-image: radial-gradient(
45
+ closest-side,
46
+ transparent 56%,
47
+ black 72%,
48
+ transparent 90%
49
+ );
50
+ }
51
+ }
52
+
53
+ @media (prefers-reduced-motion: no-preference) {
54
+ @keyframes nxgt-bg-halo-turn {
55
+ to {
56
+ transform: rotate(360deg);
57
+ }
58
+ }
59
+
60
+ @layer components {
61
+ [data-background="halo"][data-animated] > [data-layer="halo"] {
62
+ animation: nxgt-bg-halo-turn 40s linear infinite
63
+ var(--nxgt-bg-play, running);
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,79 @@
1
+ /* The `hexagons` preset: a honeycomb, fading out toward the edges, with a
2
+ * seeded tenth of its cells tinted. Layers: `wash` (a tint) and the SVG scene
3
+ * (`hx-line` the edges, `hx-lit` and `hx-lit1..3` the tinted cells in c1, c2
4
+ * and c3). React only: nothing in the shared `css/` folder. */
5
+ @import "../css/scene.css";
6
+
7
+ @layer components {
8
+ [data-background="hexagons"] > [data-layer="wash"] {
9
+ position: absolute;
10
+ inset: 0;
11
+ background-image: linear-gradient(
12
+ 180deg,
13
+ color-mix(in oklab, var(--nxgt-bg-c1) var(--nxgt-bg-a1), transparent),
14
+ transparent 70%
15
+ );
16
+ }
17
+ [data-background="hexagons"] > [data-scene] {
18
+ -webkit-mask-image: radial-gradient(
19
+ ellipse 80% 80% at 50% 50%,
20
+ rgb(0 0 0 / 0.45) 0%,
21
+ black 100%
22
+ );
23
+ mask-image: radial-gradient(
24
+ ellipse 80% 80% at 50% 50%,
25
+ rgb(0 0 0 / 0.45) 0%,
26
+ black 100%
27
+ );
28
+ }
29
+ [data-background="hexagons"] > [data-scene] .hx-line {
30
+ fill: none;
31
+ stroke: var(--nxgt-bg-c1);
32
+ stroke-width: 1.4;
33
+ stroke-linejoin: round;
34
+ stroke-opacity: calc(var(--nxgt-bg-op) * 0.65);
35
+ }
36
+ [data-background="hexagons"] > [data-scene] .hx-lit1 {
37
+ fill: var(--nxgt-bg-c1);
38
+ fill-opacity: calc(var(--nxgt-bg-op) * 0.2);
39
+ stroke: none;
40
+ }
41
+ [data-background="hexagons"] > [data-scene] .hx-lit2 {
42
+ fill: var(--nxgt-bg-c2);
43
+ fill-opacity: calc(var(--nxgt-bg-op) * 0.26);
44
+ }
45
+ [data-background="hexagons"] > [data-scene] .hx-lit3 {
46
+ fill: var(--nxgt-bg-c3);
47
+ fill-opacity: calc(var(--nxgt-bg-op) * 0.34);
48
+ }
49
+ }
50
+
51
+ @media (prefers-reduced-motion: no-preference) {
52
+ @keyframes nxgt-bg-hexagons-pulse {
53
+ from {
54
+ opacity: 1;
55
+ }
56
+ to {
57
+ opacity: 0.15;
58
+ }
59
+ }
60
+
61
+ @layer components {
62
+ [data-background="hexagons"][data-animated] > [data-scene] .hx-lit {
63
+ animation: nxgt-bg-hexagons-pulse 7s ease-in-out infinite alternate
64
+ var(--nxgt-bg-play, running);
65
+ }
66
+ [data-background="hexagons"][data-animated]
67
+ > [data-scene]
68
+ .hx-lit:nth-child(3n + 1) {
69
+ animation-duration: 9s;
70
+ animation-delay: -3s;
71
+ }
72
+ [data-background="hexagons"][data-animated]
73
+ > [data-scene]
74
+ .hx-lit:nth-child(3n + 2) {
75
+ animation-duration: 11s;
76
+ animation-delay: -7s;
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,164 @@
1
+ /* The illustrated scenes' shared parts (`school`, `night-sky`, `bubbles`,
2
+ * `leaves`, `science`, `music`, `travel`, `sport`): a faint colour wash under
3
+ * the scene, and the scene itself, fine line drawings (`il` is the root; every
4
+ * path is stroked in `currentColor`, which a `k1..k3` class sets) kept calm in
5
+ * the middle of the frame by a mask, where the content sits. The scene is the
6
+ * one drawn by core's `buildBackgroundScene`. React only: nothing in the shared
7
+ * `css/` folder. Intensity never goes above the default (`vivid` draws as the default). Each preset's file imports this one. */
8
+ @import "../css/scene.css";
9
+
10
+ @layer components {
11
+ /* `vivid` is capped at the default strength: drawings under body text
12
+ * never get stronger (the wash and the strokes read these variables).
13
+ * Three attributes (0,3,0) beat tones.css's (0,2,0) in any import order. */
14
+ :is(
15
+ [data-background="school"],
16
+ [data-background="night-sky"],
17
+ [data-background="bubbles"],
18
+ [data-background="leaves"],
19
+ [data-background="science"],
20
+ [data-background="music"],
21
+ [data-background="travel"],
22
+ [data-background="sport"]
23
+ )[data-intensity="vivid"][data-intensity] {
24
+ --nxgt-bg-a1: 8%;
25
+ --nxgt-bg-a2: 16%;
26
+ --nxgt-bg-a3: 28%;
27
+ --nxgt-bg-op: 0.72;
28
+ }
29
+
30
+ /* The wash: two soft colour pools under the scene. */
31
+ :is(
32
+ [data-background="school"],
33
+ [data-background="night-sky"],
34
+ [data-background="bubbles"],
35
+ [data-background="leaves"],
36
+ [data-background="science"],
37
+ [data-background="music"],
38
+ [data-background="travel"],
39
+ [data-background="sport"]
40
+ ) > [data-layer="wash"] {
41
+ position: absolute;
42
+ inset: 0;
43
+ background:
44
+ radial-gradient(
45
+ ellipse 70% 60% at 22% 18%,
46
+ color-mix(in oklab, var(--nxgt-bg-c1) var(--nxgt-bg-a1), transparent),
47
+ transparent 72%
48
+ ),
49
+ radial-gradient(
50
+ ellipse 60% 55% at 85% 92%,
51
+ color-mix(in oklab, var(--nxgt-bg-c3) var(--nxgt-bg-a1), transparent),
52
+ transparent 70%
53
+ );
54
+ }
55
+
56
+ :is(
57
+ [data-background="school"],
58
+ [data-background="night-sky"],
59
+ [data-background="bubbles"],
60
+ [data-background="leaves"],
61
+ [data-background="science"],
62
+ [data-background="music"],
63
+ [data-background="travel"],
64
+ [data-background="sport"]
65
+ )
66
+ > [data-scene] {
67
+ overflow: hidden;
68
+ }
69
+
70
+ /* The middle stays calm: the mask is in pixels, not in percent of the
71
+ * frame, so the quiet zone always covers a card of content (a percentage
72
+ * would shrink it on a phone). It passes 7 to 9% of the drawings, which
73
+ * keeps 14 px muted text at 4.5:1 or better over the worst stroke pixel. */
74
+ :is(
75
+ [data-background="school"],
76
+ [data-background="night-sky"],
77
+ [data-background="bubbles"],
78
+ [data-background="leaves"],
79
+ [data-background="science"],
80
+ [data-background="music"],
81
+ [data-background="travel"],
82
+ [data-background="sport"]
83
+ )
84
+ > [data-scene]
85
+ .mo {
86
+ opacity: calc(var(--nxgt-bg-op) + 0.2);
87
+ }
88
+ :is(
89
+ [data-background="school"],
90
+ [data-background="night-sky"],
91
+ [data-background="bubbles"],
92
+ [data-background="leaves"],
93
+ [data-background="science"],
94
+ [data-background="music"],
95
+ [data-background="travel"],
96
+ [data-background="sport"]
97
+ )
98
+ > [data-scene]
99
+ > .il {
100
+ -webkit-mask-image: radial-gradient(
101
+ ellipse 380px 290px at 50% 50%,
102
+ rgb(0 0 0 / 0.07) 0%,
103
+ rgb(0 0 0 / 0.09) 55%,
104
+ rgb(0 0 0 / 0.5) 80%,
105
+ black 100%
106
+ );
107
+ mask-image: radial-gradient(
108
+ ellipse 380px 290px at 50% 50%,
109
+ rgb(0 0 0 / 0.07) 0%,
110
+ rgb(0 0 0 / 0.09) 55%,
111
+ rgb(0 0 0 / 0.5) 80%,
112
+ black 100%
113
+ );
114
+ }
115
+ /* A phone: the card fills the width, so the zone is a band across it. */
116
+ @media (max-width: 640px) {
117
+ :is(
118
+ [data-background="school"],
119
+ [data-background="night-sky"],
120
+ [data-background="bubbles"],
121
+ [data-background="leaves"],
122
+ [data-background="science"],
123
+ [data-background="music"],
124
+ [data-background="travel"],
125
+ [data-background="sport"]
126
+ )
127
+ > [data-scene]
128
+ > .il {
129
+ -webkit-mask-image: radial-gradient(
130
+ ellipse 420px 170px at 50% 50%,
131
+ rgb(0 0 0 / 0.07) 0%,
132
+ rgb(0 0 0 / 0.09) 55%,
133
+ rgb(0 0 0 / 0.5) 80%,
134
+ black 100%
135
+ );
136
+ mask-image: radial-gradient(
137
+ ellipse 420px 170px at 50% 50%,
138
+ rgb(0 0 0 / 0.07) 0%,
139
+ rgb(0 0 0 / 0.09) 55%,
140
+ rgb(0 0 0 / 0.5) 80%,
141
+ black 100%
142
+ );
143
+ }
144
+ }
145
+
146
+ :is(
147
+ [data-background="school"],
148
+ [data-background="night-sky"],
149
+ [data-background="bubbles"],
150
+ [data-background="leaves"],
151
+ [data-background="science"],
152
+ [data-background="music"],
153
+ [data-background="travel"],
154
+ [data-background="sport"]
155
+ )
156
+ > [data-scene]
157
+ > .il
158
+ path {
159
+ fill: none;
160
+ stroke: currentColor;
161
+ stroke-linecap: round;
162
+ stroke-linejoin: round;
163
+ }
164
+ }
@@ -0,0 +1,41 @@
1
+ /* The `leaves` preset: line drawings of one theme (see illustrated.css).
2
+ * Motion (opt-in, `animated`): a leaf sways, 14 to 24 s a leg. The builder sets
3
+ * the pace (`p1..p3`) and the delay (`l1..l4`) as classes, so the markup holds
4
+ * no inline style. */
5
+ @import "./illustrated.css";
6
+
7
+ @media (prefers-reduced-motion: no-preference) {
8
+ @keyframes nxgt-bg-leaves-sw {
9
+ to {
10
+ translate: 16px 8px;
11
+ }
12
+ }
13
+
14
+ @layer components {
15
+ [data-background="leaves"][data-animated] > [data-scene] .sw {
16
+ animation: nxgt-bg-leaves-sw 14s ease-in-out infinite alternate
17
+ var(--nxgt-bg-play, running);
18
+ }
19
+ [data-background="leaves"][data-animated] > [data-scene] .p1 {
20
+ animation-duration: 14s;
21
+ }
22
+ [data-background="leaves"][data-animated] > [data-scene] .p2 {
23
+ animation-duration: 19s;
24
+ }
25
+ [data-background="leaves"][data-animated] > [data-scene] .p3 {
26
+ animation-duration: 24s;
27
+ }
28
+ [data-background="leaves"][data-animated] > [data-scene] .l1 {
29
+ animation-delay: 0s;
30
+ }
31
+ [data-background="leaves"][data-animated] > [data-scene] .l2 {
32
+ animation-delay: -3s;
33
+ }
34
+ [data-background="leaves"][data-animated] > [data-scene] .l3 {
35
+ animation-delay: -7s;
36
+ }
37
+ [data-background="leaves"][data-animated] > [data-scene] .l4 {
38
+ animation-delay: -11s;
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,44 @@
1
+ /* The `linen` preset: a plain weave. A cross-hatch of 1 px threads every 4 px
2
+ * (whole pixels, so crisp at 1x) with faint seeded slubs (a 960 px tile), on a tint of the
3
+ * tone (`wash`). The threads are black in light and white in dark, like the
4
+ * grain overlay. Intensity never goes above the default (`vivid` draws as the default). Static: `animated` does nothing. React only: nothing in the
5
+ * shared `css/` folder. */
6
+ @import "../css/scene.css";
7
+
8
+ @layer components {
9
+ /* `vivid` is capped at the default strength: a texture under body text
10
+ * never gets stronger (the tint and the specks read these two). */
11
+ [data-background="linen"][data-intensity="vivid"][data-intensity] {
12
+ --nxgt-bg-a1: 8%;
13
+ --nxgt-bg-op: 0.72;
14
+ }
15
+ [data-background="linen"] > [data-layer="wash"] {
16
+ position: absolute;
17
+ inset: 0;
18
+ background-image: linear-gradient(
19
+ 180deg,
20
+ color-mix(in oklab, var(--nxgt-bg-c1) var(--nxgt-bg-a1), transparent),
21
+ color-mix(
22
+ in oklab,
23
+ var(--nxgt-bg-c2) calc(var(--nxgt-bg-a1) * 0.6),
24
+ transparent
25
+ )
26
+ );
27
+ }
28
+ [data-background="linen"] > [data-scene] > svg {
29
+ filter: invert(var(--nxgt-bg-grain-invert));
30
+ }
31
+ [data-background="linen"] > [data-scene] .lw-v,
32
+ [data-background="linen"] > [data-scene] .lw-h {
33
+ fill: black;
34
+ fill-opacity: calc(var(--nxgt-bg-op) * 0.1);
35
+ shape-rendering: crispEdges;
36
+ }
37
+ [data-background="linen"] > [data-scene] .lw-b {
38
+ fill-opacity: calc(var(--nxgt-bg-op) * 0.05);
39
+ }
40
+ [data-background="linen"] > [data-scene] .tx1,
41
+ [data-background="linen"] > [data-scene] .tx2 {
42
+ opacity: calc(var(--nxgt-bg-op) * 0.07);
43
+ }
44
+ }
@@ -0,0 +1,55 @@
1
+ /* The `marble` preset: polished marble. A seeded cloudy body and soft veins
2
+ * (an SVG: a cloud of `feTurbulence` on a seamless 960 px tile, and curves
3
+ * blurred soft; black in light, white in dark), very low in contrast, over a pale tint of the tone
4
+ * (`wash`). Intensity never goes above the default (`vivid` draws as the default). Static: `animated` does nothing. React only: nothing in the
5
+ * shared `css/` folder. */
6
+ @import "../css/scene.css";
7
+
8
+ @layer components {
9
+ /* `vivid` is capped at the default strength: a texture under body text
10
+ * never gets stronger (the tint and the specks read these two). */
11
+ [data-background="marble"][data-intensity="vivid"][data-intensity] {
12
+ --nxgt-bg-a1: 8%;
13
+ --nxgt-bg-op: 0.72;
14
+ }
15
+ [data-background="marble"] > [data-layer="wash"] {
16
+ position: absolute;
17
+ inset: 0;
18
+ background-image: linear-gradient(
19
+ 135deg,
20
+ color-mix(in oklab, var(--nxgt-bg-c1) var(--nxgt-bg-a1), transparent),
21
+ color-mix(
22
+ in oklab,
23
+ var(--nxgt-bg-c2) calc(var(--nxgt-bg-a1) * 0.5),
24
+ transparent
25
+ )
26
+ );
27
+ }
28
+ [data-background="marble"] > [data-scene] > svg {
29
+ filter: invert(var(--nxgt-bg-grain-invert));
30
+ }
31
+ [data-background="marble"] > [data-scene] .tx1 {
32
+ opacity: calc(var(--nxgt-bg-op) * 0.08);
33
+ }
34
+ [data-background="marble"] > [data-scene] .mv-p,
35
+ [data-background="marble"] > [data-scene] .mh-p {
36
+ fill: none;
37
+ stroke: black;
38
+ stroke-linecap: round;
39
+ stroke-linejoin: round;
40
+ }
41
+ [data-background="marble"] > [data-scene] .mv {
42
+ opacity: calc(
43
+ var(--nxgt-bg-op) *
44
+ 0.2 *
45
+ (1 - var(--nxgt-bg-grain-invert) * 0.5)
46
+ );
47
+ }
48
+ [data-background="marble"] > [data-scene] .mh {
49
+ opacity: calc(
50
+ var(--nxgt-bg-op) *
51
+ 0.07 *
52
+ (1 - var(--nxgt-bg-grain-invert) * 0.5)
53
+ );
54
+ }
55
+ }
@@ -0,0 +1,2 @@
1
+ /* The `music` preset: line drawings of one theme (see illustrated.css). Still. */
2
+ @import "./illustrated.css";
@@ -0,0 +1,41 @@
1
+ /* The `night-sky` preset: line drawings of one theme (see illustrated.css).
2
+ * Motion (opt-in, `animated`): a star twinkles, 14 to 24 s a leg. The builder sets
3
+ * the pace (`p1..p3`) and the delay (`l1..l4`) as classes, so the markup holds
4
+ * no inline style. */
5
+ @import "./illustrated.css";
6
+
7
+ @media (prefers-reduced-motion: no-preference) {
8
+ @keyframes nxgt-bg-night-sky-tw {
9
+ to {
10
+ opacity: 0.2;
11
+ }
12
+ }
13
+
14
+ @layer components {
15
+ [data-background="night-sky"][data-animated] > [data-scene] .tw {
16
+ animation: nxgt-bg-night-sky-tw 14s ease-in-out infinite alternate
17
+ var(--nxgt-bg-play, running);
18
+ }
19
+ [data-background="night-sky"][data-animated] > [data-scene] .p1 {
20
+ animation-duration: 14s;
21
+ }
22
+ [data-background="night-sky"][data-animated] > [data-scene] .p2 {
23
+ animation-duration: 19s;
24
+ }
25
+ [data-background="night-sky"][data-animated] > [data-scene] .p3 {
26
+ animation-duration: 24s;
27
+ }
28
+ [data-background="night-sky"][data-animated] > [data-scene] .l1 {
29
+ animation-delay: 0s;
30
+ }
31
+ [data-background="night-sky"][data-animated] > [data-scene] .l2 {
32
+ animation-delay: -3s;
33
+ }
34
+ [data-background="night-sky"][data-animated] > [data-scene] .l3 {
35
+ animation-delay: -7s;
36
+ }
37
+ [data-background="night-sky"][data-animated] > [data-scene] .l4 {
38
+ animation-delay: -11s;
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,49 @@
1
+ /* The `paper` preset: a sheet of paper. A seeded fibre grain (an SVG of
2
+ * `feTurbulence` specks on a seamless 400 px tile: black in light, white in
3
+ * dark, like the grain overlay) over a warm tint that the tone cools or warms
4
+ * (`wash`: cream in light, the tone's colour mixed in). Intensity never goes above the default (`vivid` draws as the default). Static: `animated`
5
+ * does nothing. React only: nothing in the shared `css/` folder. */
6
+ @import "../css/scene.css";
7
+
8
+ @layer components {
9
+ /* `vivid` is capped at the default strength: a texture under body text
10
+ * never gets stronger (the tint and the specks read these two). */
11
+ [data-background="paper"][data-intensity="vivid"][data-intensity] {
12
+ --nxgt-bg-a1: 8%;
13
+ --nxgt-bg-op: 0.72;
14
+ }
15
+ [data-background="paper"] > [data-layer="wash"] {
16
+ position: absolute;
17
+ inset: 0;
18
+ background-image: linear-gradient(
19
+ 180deg,
20
+ color-mix(
21
+ in oklab,
22
+ var(--nxgt-bg-c1) calc(var(--nxgt-bg-a1) * 1.6),
23
+ color-mix(
24
+ in oklab,
25
+ rgb(250 233 196) calc(70% * (1 - var(--nxgt-bg-grain-invert))),
26
+ transparent
27
+ )
28
+ ),
29
+ color-mix(
30
+ in oklab,
31
+ var(--nxgt-bg-c2) var(--nxgt-bg-a1),
32
+ color-mix(
33
+ in oklab,
34
+ rgb(250 233 196) calc(42% * (1 - var(--nxgt-bg-grain-invert))),
35
+ transparent
36
+ )
37
+ )
38
+ );
39
+ }
40
+ [data-background="paper"] > [data-scene] > svg {
41
+ filter: invert(var(--nxgt-bg-grain-invert));
42
+ }
43
+ [data-background="paper"] > [data-scene] .tx1 {
44
+ opacity: calc(var(--nxgt-bg-op) * 0.12);
45
+ }
46
+ [data-background="paper"] > [data-scene] .tx2 {
47
+ opacity: calc(var(--nxgt-bg-op) * 0.09);
48
+ }
49
+ }
@@ -0,0 +1,53 @@
1
+ /* The `plasma` preset: a soft colour field. A seeded SVG of soft discs in
2
+ * radial gradients in the tone's three colours, three strengths each (`pm-l1..3`),
3
+ * over a tint (`wash`). Blended with the page: it adds light in dark. Motion
4
+ * (opt-in, `animated`): the field drifts. React only: nothing in the shared
5
+ * `css/` folder. */
6
+ @import "../css/scene.css";
7
+
8
+ @layer components {
9
+ [data-background="plasma"] {
10
+ isolation: isolate;
11
+ }
12
+ [data-background="plasma"] > [data-layer="wash"] {
13
+ position: absolute;
14
+ inset: 0;
15
+ background-image: linear-gradient(
16
+ 160deg,
17
+ color-mix(in oklab, var(--nxgt-bg-c1) var(--nxgt-bg-a1), transparent),
18
+ color-mix(in oklab, var(--nxgt-bg-c3) var(--nxgt-bg-a1), transparent)
19
+ );
20
+ }
21
+ [data-background="plasma"] > [data-scene] > svg {
22
+ mix-blend-mode: var(--nxgt-bg-glow-blend);
23
+ }
24
+ [data-background="plasma"] > [data-scene] .pm-l1 {
25
+ fill-opacity: calc(var(--nxgt-bg-op) * 0.16);
26
+ }
27
+ [data-background="plasma"] > [data-scene] .pm-l2 {
28
+ fill-opacity: calc(var(--nxgt-bg-op) * 0.26);
29
+ }
30
+ [data-background="plasma"] > [data-scene] .pm-l3 {
31
+ fill-opacity: calc(var(--nxgt-bg-op) * 0.38);
32
+ }
33
+ }
34
+
35
+ @media (prefers-reduced-motion: no-preference) {
36
+ @keyframes nxgt-bg-plasma-drift {
37
+ from {
38
+ transform: translate(-3%, -2%) scale(1);
39
+ }
40
+ to {
41
+ transform: translate(3%, 2%) scale(1.06);
42
+ }
43
+ }
44
+
45
+ @layer components {
46
+ [data-background="plasma"][data-animated] > [data-scene] .pm-field {
47
+ animation: nxgt-bg-plasma-drift 28s ease-in-out infinite alternate
48
+ var(--nxgt-bg-play, running);
49
+ transform-box: view-box;
50
+ transform-origin: 50% 50%;
51
+ }
52
+ }
53
+ }