@charmland/gem 0.1.1 → 0.2.1

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.
@@ -146,7 +146,7 @@ $row-inset: 1.5rem;
146
146
  gap: 0.5rem;
147
147
  text-decoration: none;
148
148
  color: var(--fg);
149
- font-family: "Hypography Web", "Charmform Web", system-ui, sans-serif;
149
+ font-family: "Charmform Web", system-ui, sans-serif;
150
150
  font-size: 1.5rem;
151
151
  letter-spacing: -0.02em;
152
152
 
@@ -156,6 +156,11 @@ $row-inset: 1.5rem;
156
156
  max-width: 60vw;
157
157
  height: auto;
158
158
  }
159
+
160
+ .site-brand:has(.site-brand-text) .site-logo {
161
+ width: auto;
162
+ height: 2.5rem;
163
+ }
159
164
  }
160
165
 
161
166
  svg.logo {
@@ -105,6 +105,7 @@
105
105
  // button paints its own background instead.
106
106
  .tabs {
107
107
  --tabs-pad: 0.25rem;
108
+ --tabs-radius: calc(0.5rem * var(--squircle-scale, 1));
108
109
  position: relative;
109
110
  display: inline-flex;
110
111
  align-self: flex-start;
@@ -120,7 +121,7 @@
120
121
  bottom: var(--tabs-pad);
121
122
  left: 0;
122
123
  z-index: 0;
123
- border-radius: calc(0.5rem * var(--squircle-scale, 1));
124
+ border-radius: var(--tabs-radius);
124
125
  background: charmtone.$charple;
125
126
  transition:
126
127
  transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1),
@@ -140,10 +141,7 @@
140
141
  background: transparent;
141
142
  color: var(--muted);
142
143
  font-size: 0.875rem;
143
- transition:
144
- background 125ms ease,
145
- border-color 125ms ease,
146
- color 125ms ease;
144
+ transition: border-color 125ms ease;
147
145
 
148
146
  // Icon tabs (the models layout switcher): the glyph follows the
149
147
  // button's color states via currentColor.
@@ -170,14 +168,6 @@
170
168
  }
171
169
  }
172
170
 
173
- // Before the first measurement lands there is no thumb; the active
174
- // button paints its own fill so the selection is visible
175
- // immediately. Once the thumb exists it takes over. The underline
176
- // variant never paints a pill — its selection is the slide alone.
177
- &:not(.measured):not(.underline) button.active {
178
- background: charmtone.$charple;
179
- }
180
-
181
171
  // The dense switcher used next to compact controls and tables.
182
172
  &.compact {
183
173
  height: $control-height-sm;
@@ -189,6 +179,11 @@
189
179
  }
190
180
  }
191
181
 
182
+ &:not(.measured):not(.underline) button.active {
183
+ background: charmtone.$charple;
184
+ border-radius: var(--tabs-radius);
185
+ }
186
+
192
187
  // The underline variant: bare text tabs sitting on a hairline, the
193
188
  // selection a sliding two-pixel charple bar. Same geometry as the
194
189
  // reference site's section navs: the buttons hang 1px past the row so
@@ -15,7 +15,7 @@ $control-radius: 0.75rem;
15
15
  $control-fill: var(--well);
16
16
  // JetBrains Mono is the house mono; hosts that don't load it fall
17
17
  // back to the system mono.
18
- $mono: "JetBrains Mono Variable", ui-monospace, monospace;
18
+ $mono: "JetBrains Mono", ui-monospace, monospace;
19
19
 
20
20
  // The app face: Charmform, the Charm house typeface. Hosts that don't
21
21
  // load it fall back to the system sans.
@@ -250,7 +250,7 @@
250
250
  h1 {
251
251
  font-size: 2.7rem;
252
252
  font-weight: 800;
253
- font-variation-settings: "OPTK" -15;
253
+ font-variation-settings: "OPTK" -45;
254
254
  margin: 0;
255
255
  }
256
256
 
@@ -153,7 +153,7 @@
153
153
  // Small screens: triggers often sit near the viewport's right edge
154
154
  // (toolbars), so the menu grows leftward — a left-anchored menu would
155
155
  // hang off-screen even while hidden and scroll the page.
156
- @media (max-width: 768px) {
156
+ @media (max-width: 1024px) {
157
157
  .dropdown .menu {
158
158
  left: auto;
159
159
  right: 0;
@@ -9,17 +9,22 @@
9
9
  .page-nav {
10
10
  display: flex;
11
11
  justify-content: space-between;
12
- gap: 1rem;
12
+ gap: 1.5rem;
13
13
  margin-top: 2.5rem;
14
14
  padding-top: 1.5rem;
15
- border-top: 1px solid var(--rule);
15
+ }
16
+
17
+ // A lone next link sits at the start with the rest of the row; two
18
+ // links split the row evenly.
19
+ .page-nav-link.next:only-child {
20
+ margin-left: auto;
16
21
  }
17
22
 
18
23
  .page-nav-link {
19
24
  display: flex;
25
+ flex: 1;
20
26
  flex-direction: column;
21
27
  gap: 0.25rem;
22
- max-width: 45%;
23
28
  min-width: 0;
24
29
  padding: 0.75rem 1rem;
25
30
  border: 1px solid var(--frame);
@@ -57,7 +62,6 @@
57
62
  }
58
63
 
59
64
  &.next {
60
- margin-left: auto;
61
65
  text-align: right;
62
66
  }
63
67
  }
@@ -30,7 +30,7 @@
30
30
  figcaption {
31
31
  margin: 0;
32
32
  padding: 0;
33
- font-weight: normal;
33
+ font-weight: inherit;
34
34
  font-style: normal;
35
35
  text-align: left;
36
36
  }
@@ -1,39 +1,46 @@
1
- @use "charmtone";
1
+ // One scrollbar recipe for every engine: a thin, flat thumb on an invisible
2
+ // track, the shape Firefox draws, mirrored into Chromium and Safari through
3
+ // the WebKit pseudo-elements. The thumb stays invisible until the pointer is
4
+ // over the scrolling element, so a page or a rail never wears a permanent bar.
2
5
 
3
- // Scrollbars drawn by the Meter's recipe: a rounded thumb carrying
4
- // the Meter's charple-to-dolly gradient over a recessed track, in both
5
- // themes. The light theme used to take the Meter's light stops
6
- // (zest-to-bok), but a yellow thumb reads as a stray highlight on salt;
7
- // the purple stays the brand mark either way. Two specs, both declared
8
- // — engines that don't know a property ignore it. Chromium/WebKit render
9
- // the gradient on the thumb directly; Firefox's scrollbar-color takes
10
- // flat colors only, so there the thumb is the gradient's charple start.
6
+ $thumb: color-mix(in srgb, var(--fg) 28%, transparent);
7
+ $thumb-hover: color-mix(in srgb, var(--fg) 45%, transparent);
11
8
 
12
9
  * {
13
10
  scrollbar-width: thin;
14
- scrollbar-color: charmtone.$charple var(--well);
11
+ scrollbar-color: transparent transparent;
12
+ }
13
+
14
+ *:hover {
15
+ scrollbar-color: $thumb transparent;
15
16
  }
16
17
 
17
18
  *::-webkit-scrollbar {
18
- width: 0.625rem;
19
- height: 0.625rem;
19
+ width: 0.5rem;
20
+ height: 0.5rem;
20
21
  }
21
22
 
22
23
  *::-webkit-scrollbar-track {
23
- border-radius: 9999px;
24
- background: var(--well);
24
+ background: transparent;
25
25
  }
26
26
 
27
27
  *::-webkit-scrollbar-thumb {
28
+ border: 1px solid transparent;
28
29
  border-radius: 9999px;
29
- background: linear-gradient(90deg, charmtone.$charple, charmtone.$dolly);
30
- border: 1px solid var(--bg);
30
+ background: transparent;
31
+ background-clip: content-box;
32
+ }
33
+
34
+ *:hover::-webkit-scrollbar-thumb {
35
+ background: $thumb;
36
+ background-clip: content-box;
37
+ }
31
38
 
32
- &:hover {
33
- background: linear-gradient(90deg, charmtone.$hazy, charmtone.$mauve);
34
- }
39
+ *::-webkit-scrollbar-thumb:hover {
40
+ background: $thumb-hover;
41
+ background-clip: content-box;
35
42
  }
36
43
 
37
44
  *::-webkit-scrollbar-corner {
38
- background: var(--well);
45
+ background: transparent;
39
46
  }
@@ -1,6 +1,22 @@
1
1
  @use "charmtone";
2
2
  @use "controls" as *;
3
3
 
4
+ // Height of the dissolve at each end of the scrolling list.
5
+ $sidebar-fade: 2.5rem;
6
+
7
+ // Registered so the scroll timelines can interpolate them as lengths.
8
+ @property --sidebar-fade-top {
9
+ syntax: "<length>";
10
+ inherits: false;
11
+ initial-value: 0px;
12
+ }
13
+
14
+ @property --sidebar-fade-bottom {
15
+ syntax: "<length>";
16
+ inherits: false;
17
+ initial-value: 0px;
18
+ }
19
+
4
20
  // The navigation rail, carried over from the Hyper dashboard: fixed
5
21
  // items with the house hover sweep — a charple fill with salt ink,
6
22
  // wiped in from the left via a two-cell mask position animation — and
@@ -16,35 +32,42 @@
16
32
  flex: 1;
17
33
  min-height: 0;
18
34
  overflow-y: auto;
35
+ scrollbar-gutter: stable;
36
+
37
+ // Scroll fades: rows that hide above or below the scrollport
38
+ // dissolve via a mask, which also fades the ink — background
39
+ // gradients paint behind the text, so they cannot do this. One
40
+ // gradient reads two registered lengths, and scroll timelines
41
+ // animate them: the top fade grows over the first stretch of
42
+ // scrolling, the bottom one shrinks over the last. Both ramp by
43
+ // distance, never by percentage, so the fades stay 2.5rem tall
44
+ // however long the list is. With no overflow the timeline is
45
+ // inactive and the lengths keep their initial 0, so no mask shows.
46
+ // Browsers without scroll timelines keep a plain list.
47
+ -webkit-mask-image: linear-gradient(
48
+ to bottom,
49
+ transparent 0,
50
+ #000 var(--sidebar-fade-top),
51
+ #000 calc(100% - var(--sidebar-fade-bottom)),
52
+ transparent 100%
53
+ );
54
+ mask-image: linear-gradient(
55
+ to bottom,
56
+ transparent 0,
57
+ #000 var(--sidebar-fade-top),
58
+ #000 calc(100% - var(--sidebar-fade-bottom)),
59
+ transparent 100%
60
+ );
19
61
 
20
- // Scroll shadows: a soft dark fade shows at the inner top edge
21
- // while content hides above, and at the inner bottom edge while
22
- // content hides below. Pure CSS (Lea Verou's scrolling shadows):
23
- // the two cover gradients ride the content (background-attachment:
24
- // local) and hide their shadow when scrolled to that edge, so a
25
- // short, unscrolled list shows neither.
26
- background:
27
- linear-gradient(var(--bg) 33%, rgb(255 255 255 / 0%)) local center top,
28
- linear-gradient(rgb(255 255 255 / 0%), var(--bg) 67%) local center bottom,
29
- radial-gradient(
30
- farthest-side at 50% 0%,
31
- rgb(0 0 0 / 30%),
32
- rgb(0 0 0 / 0%)
33
- )
34
- scroll center top,
35
- radial-gradient(
36
- farthest-side at 50% 100%,
37
- rgb(0 0 0 / 30%),
38
- rgb(0 0 0 / 0%)
39
- )
40
- scroll center bottom;
41
- background-repeat: no-repeat;
42
- background-size:
43
- 100% 4rem,
44
- 100% 4rem,
45
- 100% 1rem,
46
- 100% 1rem;
47
- background-attachment: local, local, scroll, scroll;
62
+ @supports (animation-timeline: scroll()) {
63
+ animation:
64
+ sidebar-fade-top linear both,
65
+ sidebar-fade-bottom linear both;
66
+ animation-timeline: scroll(self block), scroll(self block);
67
+ animation-range:
68
+ 0 $sidebar-fade,
69
+ calc(100% - #{$sidebar-fade}) 100%;
70
+ }
48
71
  }
49
72
 
50
73
  ul {
@@ -72,8 +95,8 @@
72
95
  // size and in full-strength ink, so the sections read as the structure
73
96
  // and the pages as their contents.
74
97
  .section-label {
75
- padding: 0.35rem 1.5rem;
76
- font-weight: 620;
98
+ padding: 0.35rem 1rem 0.35rem 1.5rem;
99
+ font-weight: 735;
77
100
  letter-spacing: -0.01em;
78
101
  color: var(--fg);
79
102
  }
@@ -87,7 +110,7 @@
87
110
  align-items: center;
88
111
  justify-content: space-between;
89
112
  width: 100%;
90
- padding: 0.35rem 1.5rem;
113
+ padding: 0.35rem 1rem 0.35rem 1.5rem;
91
114
  border: none;
92
115
  background: none;
93
116
  cursor: pointer;
@@ -123,11 +146,11 @@
123
146
  display: flex;
124
147
  align-items: center;
125
148
  gap: 0.5rem;
126
- padding: 0.5rem 1.5rem;
149
+ padding: 0.5rem 1rem 0.5rem 1.5rem;
127
150
  text-decoration: none;
128
151
  color: var(--muted);
129
152
  font-size: 0.9375rem;
130
- font-weight: 520;
153
+ font-weight: 560;
131
154
  cursor: pointer;
132
155
  --active-border: 0.375rem;
133
156
 
@@ -187,7 +210,7 @@
187
210
  border-left: var(--active-border) solid charmtone.$blush;
188
211
  padding-left: calc(1.5rem - var(--active-border));
189
212
  color: var(--fg);
190
- font-weight: 620;
213
+ font-weight: 660;
191
214
  }
192
215
 
193
216
  ul > li.section ~ li.active > a {
@@ -227,3 +250,21 @@
227
250
  }
228
251
  }
229
252
  }
253
+
254
+ @keyframes sidebar-fade-top {
255
+ from {
256
+ --sidebar-fade-top: 0rem;
257
+ }
258
+ to {
259
+ --sidebar-fade-top: #{$sidebar-fade};
260
+ }
261
+ }
262
+
263
+ @keyframes sidebar-fade-bottom {
264
+ from {
265
+ --sidebar-fade-bottom: #{$sidebar-fade};
266
+ }
267
+ to {
268
+ --sidebar-fade-bottom: 0rem;
269
+ }
270
+ }
@@ -113,7 +113,7 @@ body {
113
113
  // rendered outside the page (the mobile drawer, toasts, dialogs)
114
114
  // inherit it too.
115
115
  font-family: $sans;
116
- font-weight: 500;
116
+ font-weight: 460;
117
117
  color: var(--fg);
118
118
  background: var(--bg);
119
119
  -webkit-font-smoothing: antialiased;
@@ -2,7 +2,8 @@
2
2
  @use "controls" as *;
3
3
 
4
4
  // The table of contents: a centered header, items on a flat list.
5
- // No rail — the blush edge on the active item is the only marker.
5
+ // No rail — the active section reads as accent-colored, bolder text,
6
+ // not the sidebar's blush edge.
6
7
 
7
8
  .toc {
8
9
  font-size: 0.8125rem;
@@ -25,21 +26,16 @@
25
26
  }
26
27
 
27
28
  ul ul {
28
- // Children keep the highlight rail in the same column as the
29
- // parent; only the label indents, never the border.
30
29
  margin-left: 0;
31
30
  }
32
31
 
33
32
  li a {
34
33
  display: block;
35
34
  padding: 0.3rem 0.9rem;
36
- border-left: 2px solid transparent;
37
35
  color: var(--muted);
38
36
  text-decoration: none;
39
37
  line-height: 1.4;
40
- transition:
41
- color 125ms ease,
42
- border-color 125ms ease;
38
+ transition: color 125ms ease;
43
39
 
44
40
  &:hover {
45
41
  color: var(--fg);
@@ -50,9 +46,10 @@
50
46
  padding-left: 1.6rem;
51
47
  }
52
48
 
53
- li.active a {
54
- border-left-color: charmtone.$blush;
55
- color: var(--fg);
49
+ // Only the entry's own anchor: children render inside the active
50
+ // parent's li, so a descendant selector would tint the whole branch.
51
+ li.active > a {
52
+ color: charmtone.$blush;
56
53
  font-weight: 620;
57
54
  }
58
55
 
@@ -75,10 +72,10 @@
75
72
  width: 100%;
76
73
  // The .toc-title margins don't apply to the button: the collapsed
77
74
  // band centers it instead. Its label starts where the item labels
78
- // do (rail + item padding), folded or open, at every width.
75
+ // do (item padding), folded or open, at every width.
79
76
  margin: 0;
80
77
  padding: 0;
81
- padding-left: calc(0.9rem + 2px);
78
+ padding-left: 0.9rem;
82
79
  border: none;
83
80
  background: none;
84
81
  cursor: pointer;