@charmland/gem 0.1.0 → 0.2.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.
- package/dist/browser/boot.d.ts +1 -1
- package/dist/browser/boot.js +1 -1
- package/dist/browser/lightbox.d.ts +8 -0
- package/dist/browser/lightbox.js +282 -0
- package/dist/browser/ports.js +13 -13
- package/dist/browser/router.d.ts +8 -3
- package/dist/browser/router.js +34 -6
- package/dist/browser/runtime.d.ts +2 -0
- package/dist/browser/runtime.js +4 -1
- package/dist/default/theme.css +123 -45
- package/dist/default/theme.js +901 -740
- package/package.json +2 -4
- package/src/app/Gem/App.elm +35 -50
- package/src/app/Gem/Shell.elm +64 -52
- package/src/core/Gem/Page.elm +174 -23
- package/src/core/Gem/Render.elm +71 -33
- package/src/styles/docs.scss +24 -12
- package/src/styles/fonts.scss +24 -22
- package/src/styles/gem.scss +74 -7
- package/src/styles/ui/burger.scss +6 -1
- package/src/styles/ui/controls-extra.scss +8 -13
- package/src/styles/ui/controls.scss +1 -1
- package/assets/fonts/Hypography-Italic.woff2 +0 -0
- package/assets/fonts/Hypography-Regular.woff2 +0 -0
- package/assets/fonts/PPFraktionMono-Variable.ttf +0 -0
- package/assets/fonts/PPFraktionMonoItalic-Variable.ttf +0 -0
- package/assets/fonts/PPFraktionSans-Variable.ttf +0 -0
- package/assets/fonts/PPFraktionSansItalic-Variable.ttf +0 -0
package/src/core/Gem/Render.elm
CHANGED
|
@@ -2,10 +2,12 @@ module Gem.Render exposing
|
|
|
2
2
|
( Code
|
|
3
3
|
, CodeView
|
|
4
4
|
, blocks
|
|
5
|
+
, blocksWithHref
|
|
5
6
|
, codeHead
|
|
6
7
|
, codeLines
|
|
7
8
|
, defaultCodeView
|
|
8
9
|
, inlines
|
|
10
|
+
, inlinesWithHref
|
|
9
11
|
, linesToText
|
|
10
12
|
)
|
|
11
13
|
|
|
@@ -45,28 +47,46 @@ type alias CodeView msg =
|
|
|
45
47
|
Code -> Html msg
|
|
46
48
|
|
|
47
49
|
|
|
48
|
-
{-| Render a list of blocks.
|
|
50
|
+
{-| Render a list of blocks with links and images left as authored.
|
|
49
51
|
-}
|
|
50
52
|
blocks : Slots msg -> CodeView msg -> List Block -> List (Html msg)
|
|
51
53
|
blocks slots codeView list =
|
|
52
|
-
|
|
54
|
+
blocksWithHref identity slots codeView list
|
|
53
55
|
|
|
54
56
|
|
|
55
|
-
{-| Render a list of
|
|
57
|
+
{-| Render a list of blocks, rewriting internal link/image URLs and the
|
|
58
|
+
`href`/`src`/`poster` component props with `rewrite` before they reach a
|
|
59
|
+
`Slots` renderer. The default shell passes `Gem.Page.href` so a non-root base
|
|
60
|
+
prefixes every generated URL; a custom renderer that wants base support calls
|
|
61
|
+
this with the same function.
|
|
62
|
+
-}
|
|
63
|
+
blocksWithHref : (String -> String) -> Slots msg -> CodeView msg -> List Block -> List (Html msg)
|
|
64
|
+
blocksWithHref rewrite slots codeView list =
|
|
65
|
+
List.map (block rewrite slots codeView) list
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
{-| Render a list of inlines with links and images left as authored.
|
|
56
69
|
-}
|
|
57
70
|
inlines : Slots msg -> List Inline -> List (Html msg)
|
|
58
71
|
inlines slots list =
|
|
59
|
-
|
|
72
|
+
inlinesWithHref identity slots list
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
{-| Render a list of inlines, rewriting internal URLs with `rewrite`.
|
|
76
|
+
-}
|
|
77
|
+
inlinesWithHref : (String -> String) -> Slots msg -> List Inline -> List (Html msg)
|
|
78
|
+
inlinesWithHref rewrite slots list =
|
|
79
|
+
List.map (inline rewrite slots) list
|
|
60
80
|
|
|
61
81
|
|
|
62
|
-
block : Slots msg -> CodeView msg -> Block -> Html msg
|
|
63
|
-
block slots codeView node =
|
|
82
|
+
block : (String -> String) -> Slots msg -> CodeView msg -> Block -> Html msg
|
|
83
|
+
block rewrite slots codeView node =
|
|
64
84
|
case node of
|
|
65
85
|
Heading depth id children ->
|
|
66
|
-
heading depth id (
|
|
86
|
+
heading depth id (inlinesWithHref rewrite slots children)
|
|
67
87
|
|
|
68
88
|
Paragraph children ->
|
|
69
|
-
Html.p [ A.class "md-p" ] (
|
|
89
|
+
Html.p [ A.class "md-p" ] (inlinesWithHref rewrite slots children)
|
|
70
90
|
|
|
71
91
|
CodeBlock code ->
|
|
72
92
|
codeView
|
|
@@ -77,13 +97,13 @@ block slots codeView node =
|
|
|
77
97
|
}
|
|
78
98
|
|
|
79
99
|
ListBlock list ->
|
|
80
|
-
listBlock slots codeView list
|
|
100
|
+
listBlock rewrite slots codeView list
|
|
81
101
|
|
|
82
102
|
Quote children ->
|
|
83
|
-
Html.blockquote [ A.class "md-quote" ] (
|
|
103
|
+
Html.blockquote [ A.class "md-quote" ] (blocksWithHref rewrite slots codeView children)
|
|
84
104
|
|
|
85
105
|
Table table ->
|
|
86
|
-
tableView slots table
|
|
106
|
+
tableView rewrite slots table
|
|
87
107
|
|
|
88
108
|
Rule ->
|
|
89
109
|
Html.hr [] []
|
|
@@ -97,13 +117,13 @@ block slots codeView node =
|
|
|
97
117
|
BlockComponent "ui-cards" props children ->
|
|
98
118
|
case cardGroups children of
|
|
99
119
|
Just groups ->
|
|
100
|
-
cardsGroupView slots codeView groups
|
|
120
|
+
cardsGroupView rewrite slots codeView groups
|
|
101
121
|
|
|
102
122
|
Nothing ->
|
|
103
|
-
slots.component "ui-cards" props (
|
|
123
|
+
slots.component "ui-cards" (rewriteProps rewrite props) (blocksWithHref rewrite slots codeView children)
|
|
104
124
|
|
|
105
125
|
BlockComponent tag props children ->
|
|
106
|
-
slots.component tag props (
|
|
126
|
+
slots.component tag (rewriteProps rewrite props) (blocksWithHref rewrite slots codeView children)
|
|
107
127
|
|
|
108
128
|
|
|
109
129
|
{-| The code panels inside a `<code-group>`: every direct child that is a
|
|
@@ -195,11 +215,12 @@ cardGroups children =
|
|
|
195
215
|
visible. The switching is the theme boot's tab behavior.
|
|
196
216
|
-}
|
|
197
217
|
cardsGroupView :
|
|
198
|
-
|
|
218
|
+
(String -> String)
|
|
219
|
+
-> Slots msg
|
|
199
220
|
-> CodeView msg
|
|
200
221
|
-> List { label : String, cards : List Block }
|
|
201
222
|
-> Html msg
|
|
202
|
-
cardsGroupView slots codeView groups =
|
|
223
|
+
cardsGroupView rewrite slots codeView groups =
|
|
203
224
|
Html.div
|
|
204
225
|
[ A.class "cards-root", A.attribute "data-tabs" "" ]
|
|
205
226
|
([ Html.nav
|
|
@@ -229,14 +250,14 @@ cardsGroupView slots codeView groups =
|
|
|
229
250
|
[]
|
|
230
251
|
)
|
|
231
252
|
)
|
|
232
|
-
[ Html.div [ A.class "cards" ] (
|
|
253
|
+
[ Html.div [ A.class "cards" ] (blocksWithHref rewrite slots codeView group.cards) ]
|
|
233
254
|
)
|
|
234
255
|
groups
|
|
235
256
|
)
|
|
236
257
|
|
|
237
258
|
|
|
238
|
-
inline : Slots msg -> Inline -> Html msg
|
|
239
|
-
inline slots node =
|
|
259
|
+
inline : (String -> String) -> Slots msg -> Inline -> Html msg
|
|
260
|
+
inline rewrite slots node =
|
|
240
261
|
case node of
|
|
241
262
|
Text text ->
|
|
242
263
|
Html.text text
|
|
@@ -245,18 +266,18 @@ inline slots node =
|
|
|
245
266
|
Html.code [ A.class "code-inline" ] [ Html.text text ]
|
|
246
267
|
|
|
247
268
|
Strong children ->
|
|
248
|
-
Html.strong [] (
|
|
269
|
+
Html.strong [] (inlinesWithHref rewrite slots children)
|
|
249
270
|
|
|
250
271
|
Em children ->
|
|
251
|
-
Html.em [] (
|
|
272
|
+
Html.em [] (inlinesWithHref rewrite slots children)
|
|
252
273
|
|
|
253
274
|
Del children ->
|
|
254
|
-
Html.del [] (
|
|
275
|
+
Html.del [] (inlinesWithHref rewrite slots children)
|
|
255
276
|
|
|
256
277
|
Link link children ->
|
|
257
278
|
Html.a
|
|
258
279
|
(A.class "md-link"
|
|
259
|
-
:: A.href link.href
|
|
280
|
+
:: A.href (rewrite link.href)
|
|
260
281
|
:: A.title (Maybe.withDefault "" link.title)
|
|
261
282
|
:: (if link.external then
|
|
262
283
|
[ A.target "_blank", A.rel "noreferrer" ]
|
|
@@ -265,12 +286,12 @@ inline slots node =
|
|
|
265
286
|
[]
|
|
266
287
|
)
|
|
267
288
|
)
|
|
268
|
-
(
|
|
289
|
+
(inlinesWithHref rewrite slots children)
|
|
269
290
|
|
|
270
291
|
Image image ->
|
|
271
292
|
Html.img
|
|
272
293
|
[ A.class "md-image"
|
|
273
|
-
, A.src image.src
|
|
294
|
+
, A.src (rewrite image.src)
|
|
274
295
|
, A.alt image.alt
|
|
275
296
|
, A.title (Maybe.withDefault "" image.title)
|
|
276
297
|
]
|
|
@@ -280,7 +301,7 @@ inline slots node =
|
|
|
280
301
|
Html.br [] []
|
|
281
302
|
|
|
282
303
|
InlineComponent tag props children ->
|
|
283
|
-
slots.component tag props (
|
|
304
|
+
slots.component tag (rewriteProps rewrite props) (inlinesWithHref rewrite slots children)
|
|
284
305
|
|
|
285
306
|
|
|
286
307
|
heading : Int -> String -> List (Html msg) -> Html msg
|
|
@@ -435,11 +456,11 @@ token value =
|
|
|
435
456
|
[ Html.text value.text ]
|
|
436
457
|
|
|
437
458
|
|
|
438
|
-
listBlock : Slots msg -> CodeView msg -> { ordered : Bool, start : Int, items : List (List Block) } -> Html msg
|
|
439
|
-
listBlock slots codeView list =
|
|
459
|
+
listBlock : (String -> String) -> Slots msg -> CodeView msg -> { ordered : Bool, start : Int, items : List (List Block) } -> Html msg
|
|
460
|
+
listBlock rewrite slots codeView list =
|
|
440
461
|
let
|
|
441
462
|
children =
|
|
442
|
-
List.map (\item -> Html.li [] (
|
|
463
|
+
List.map (\item -> Html.li [] (blocksWithHref rewrite slots codeView item)) list.items
|
|
443
464
|
in
|
|
444
465
|
if list.ordered then
|
|
445
466
|
Html.ol
|
|
@@ -457,16 +478,33 @@ listBlock slots codeView list =
|
|
|
457
478
|
Html.ul [ A.class "md-ul" ] children
|
|
458
479
|
|
|
459
480
|
|
|
460
|
-
tableView : Slots msg -> { head : List (List Inline), rows : List (List (List Inline)) } -> Html msg
|
|
461
|
-
tableView slots table =
|
|
481
|
+
tableView : (String -> String) -> Slots msg -> { head : List (List Inline), rows : List (List (List Inline)) } -> Html msg
|
|
482
|
+
tableView rewrite slots table =
|
|
462
483
|
Html.div [ A.class "table-wrap" ]
|
|
463
484
|
[ Html.table []
|
|
464
485
|
[ Html.thead []
|
|
465
|
-
[ Html.tr [] (List.map (\cell -> Html.th [] (
|
|
486
|
+
[ Html.tr [] (List.map (\cell -> Html.th [] (inlinesWithHref rewrite slots cell)) table.head) ]
|
|
466
487
|
, Html.tbody []
|
|
467
488
|
(List.map
|
|
468
|
-
(\row -> Html.tr [] (List.map (\cell -> Html.td [] (
|
|
489
|
+
(\row -> Html.tr [] (List.map (\cell -> Html.td [] (inlinesWithHref rewrite slots cell)) row))
|
|
469
490
|
table.rows
|
|
470
491
|
)
|
|
471
492
|
]
|
|
472
493
|
]
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
{-| Rewrite the URL props a component carries (`href`, `src`, `poster`) before
|
|
497
|
+
the `Slots` renderer sees them, so `ui-card` and custom elements receive the
|
|
498
|
+
base-prefixed value without changing the `Slots` record shape.
|
|
499
|
+
-}
|
|
500
|
+
rewriteProps : (String -> String) -> Dict String String -> Dict String String
|
|
501
|
+
rewriteProps rewrite props =
|
|
502
|
+
Dict.map
|
|
503
|
+
(\key value ->
|
|
504
|
+
if key == "href" || key == "src" || key == "poster" then
|
|
505
|
+
rewrite value
|
|
506
|
+
|
|
507
|
+
else
|
|
508
|
+
value
|
|
509
|
+
)
|
|
510
|
+
props
|
package/src/styles/docs.scss
CHANGED
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
// One value, used by the bar, the rail and the layout's min-height.
|
|
29
29
|
$header-height: 3.8125rem;
|
|
30
30
|
|
|
31
|
+
// The sticky ToC band on the narrow layout: it and the headings' scroll
|
|
32
|
+
// margin share the value, so a fragment jump clears both.
|
|
33
|
+
$toc-band-height: 2.3125rem;
|
|
34
|
+
|
|
31
35
|
.docs {
|
|
32
36
|
display: flex;
|
|
33
37
|
align-items: stretch;
|
|
@@ -75,17 +79,13 @@ $header-height: 3.8125rem;
|
|
|
75
79
|
display: inline-flex;
|
|
76
80
|
align-items: center;
|
|
77
81
|
gap: 0.45rem;
|
|
78
|
-
font-family: "
|
|
82
|
+
font-family: "Charmform Web", system-ui, sans-serif;
|
|
79
83
|
font-size: 1.35rem;
|
|
84
|
+
font-weight: 800;
|
|
80
85
|
color: var(--fg);
|
|
81
86
|
text-decoration: none;
|
|
82
87
|
flex-shrink: 0;
|
|
83
88
|
|
|
84
|
-
// The wordmark wears the house pink, same as the footer's.
|
|
85
|
-
span {
|
|
86
|
-
color: charmtone.$blush;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
89
|
.sprout-mark {
|
|
90
90
|
// Sits a touch high so the leaves read level with the x-height.
|
|
91
91
|
margin-top: -0.1rem;
|
|
@@ -122,6 +122,12 @@ $header-height: 3.8125rem;
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
.site-brand {
|
|
126
|
+
display: inline-flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: 0.45rem;
|
|
129
|
+
}
|
|
130
|
+
|
|
125
131
|
.docs-page {
|
|
126
132
|
position: relative;
|
|
127
133
|
max-width: 60rem;
|
|
@@ -231,7 +237,7 @@ $header-height: 3.8125rem;
|
|
|
231
237
|
|
|
232
238
|
.docs-eof-mark {
|
|
233
239
|
display: block;
|
|
234
|
-
font-family: "
|
|
240
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
235
241
|
font-size: 0.875rem;
|
|
236
242
|
font-weight: 640;
|
|
237
243
|
letter-spacing: 0.16em;
|
|
@@ -266,7 +272,7 @@ $header-height: 3.8125rem;
|
|
|
266
272
|
border-radius: calc(0.4rem * var(--squircle-scale, 1));
|
|
267
273
|
background: var(--well);
|
|
268
274
|
color: var(--fg);
|
|
269
|
-
font-family: "
|
|
275
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
270
276
|
font-size: 0.8125rem;
|
|
271
277
|
overflow-wrap: anywhere;
|
|
272
278
|
}
|
|
@@ -385,13 +391,13 @@ $header-height: 3.8125rem;
|
|
|
385
391
|
}
|
|
386
392
|
|
|
387
393
|
.swatch-name {
|
|
388
|
-
font-family: "JetBrains Mono
|
|
394
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
389
395
|
font-size: 0.75rem;
|
|
390
396
|
font-weight: 620;
|
|
391
397
|
}
|
|
392
398
|
|
|
393
399
|
.swatch-hex {
|
|
394
|
-
font-family: "JetBrains Mono
|
|
400
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
395
401
|
font-size: 0.6875rem;
|
|
396
402
|
color: var(--muted);
|
|
397
403
|
}
|
|
@@ -536,6 +542,7 @@ ul.rows {
|
|
|
536
542
|
.docs-toc-sticky {
|
|
537
543
|
display: flex;
|
|
538
544
|
align-items: center;
|
|
545
|
+
min-height: $toc-band-height;
|
|
539
546
|
padding: 0.55rem 0.9rem;
|
|
540
547
|
|
|
541
548
|
// The nav is a flex item and would shrink to its content;
|
|
@@ -627,6 +634,11 @@ ul.rows {
|
|
|
627
634
|
font-weight: 800;
|
|
628
635
|
font-variation-settings: "OPTK" -10;
|
|
629
636
|
outline: none;
|
|
637
|
+
scroll-margin-top: calc(#{$header-height} + 0.5rem);
|
|
638
|
+
|
|
639
|
+
@media (max-width: 1024px) {
|
|
640
|
+
scroll-margin-top: calc(#{$header-height} + #{$toc-band-height} + 0.5rem);
|
|
641
|
+
}
|
|
630
642
|
}
|
|
631
643
|
|
|
632
644
|
.md-h1 {
|
|
@@ -737,7 +749,7 @@ ul.rows {
|
|
|
737
749
|
}
|
|
738
750
|
|
|
739
751
|
.site-footer-wordmark {
|
|
740
|
-
font-family: "
|
|
752
|
+
font-family: "Charmform Web", system-ui, sans-serif;
|
|
741
753
|
font-size: 2.25rem;
|
|
742
754
|
letter-spacing: -0.03em;
|
|
743
755
|
color: charmtone.$blush;
|
|
@@ -1031,7 +1043,7 @@ ul.rows {
|
|
|
1031
1043
|
|
|
1032
1044
|
.detail {
|
|
1033
1045
|
color: var(--tertiary);
|
|
1034
|
-
font-family: "
|
|
1046
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
1035
1047
|
font-size: 0.65rem;
|
|
1036
1048
|
letter-spacing: 0.06em;
|
|
1037
1049
|
text-transform: uppercase;
|
package/src/styles/fonts.scss
CHANGED
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
@import url("https://stuff.charm.land/fonts/charmform/charmform.css");
|
|
2
|
-
|
|
3
1
|
@font-face {
|
|
4
|
-
font-family: "
|
|
5
|
-
src: url("
|
|
6
|
-
|
|
2
|
+
font-family: "JetBrains Mono";
|
|
3
|
+
src: url("https://stuff.charm.land/fonts/jetbrains-mono/JetBrainsMono-Regular.woff2")
|
|
4
|
+
format("woff2");
|
|
5
|
+
font-weight: 400;
|
|
7
6
|
font-style: normal;
|
|
8
7
|
font-display: swap;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
@font-face {
|
|
12
|
-
font-family: "
|
|
13
|
-
src: url("
|
|
14
|
-
format("
|
|
15
|
-
font-weight:
|
|
11
|
+
font-family: "JetBrains Mono";
|
|
12
|
+
src: url("https://stuff.charm.land/fonts/jetbrains-mono/JetBrainsMono-Italic.woff2")
|
|
13
|
+
format("woff2");
|
|
14
|
+
font-weight: 400;
|
|
16
15
|
font-style: italic;
|
|
17
16
|
font-display: swap;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
@font-face {
|
|
21
|
-
font-family: "
|
|
22
|
-
src: url("
|
|
23
|
-
|
|
20
|
+
font-family: "JetBrains Mono";
|
|
21
|
+
src: url("https://stuff.charm.land/fonts/jetbrains-mono/JetBrainsMono-Medium.woff2")
|
|
22
|
+
format("woff2");
|
|
23
|
+
font-weight: 500;
|
|
24
24
|
font-style: normal;
|
|
25
25
|
font-display: swap;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
@font-face {
|
|
29
|
-
font-family: "
|
|
30
|
-
src: url("
|
|
31
|
-
format("
|
|
32
|
-
font-weight:
|
|
29
|
+
font-family: "JetBrains Mono";
|
|
30
|
+
src: url("https://stuff.charm.land/fonts/jetbrains-mono/JetBrainsMono-Medium-Italic.woff2")
|
|
31
|
+
format("woff2");
|
|
32
|
+
font-weight: 500;
|
|
33
33
|
font-style: italic;
|
|
34
34
|
font-display: swap;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
@font-face {
|
|
38
|
-
font-family: "
|
|
39
|
-
src: url("
|
|
40
|
-
|
|
38
|
+
font-family: "JetBrains Mono";
|
|
39
|
+
src: url("https://stuff.charm.land/fonts/jetbrains-mono/JetBrainsMono-Bold.woff2")
|
|
40
|
+
format("woff2");
|
|
41
|
+
font-weight: 700;
|
|
41
42
|
font-style: normal;
|
|
42
43
|
font-display: swap;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
@font-face {
|
|
46
|
-
font-family: "
|
|
47
|
-
src: url("
|
|
48
|
-
|
|
47
|
+
font-family: "JetBrains Mono";
|
|
48
|
+
src: url("https://stuff.charm.land/fonts/jetbrains-mono/JetBrainsMono-Bold-Italic.woff2")
|
|
49
|
+
format("woff2");
|
|
50
|
+
font-weight: 700;
|
|
49
51
|
font-style: italic;
|
|
50
52
|
font-display: swap;
|
|
51
53
|
}
|
package/src/styles/gem.scss
CHANGED
|
@@ -34,6 +34,73 @@
|
|
|
34
34
|
border-radius: 0.5rem;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
.md-image[role="button"] {
|
|
38
|
+
cursor: zoom-in;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// The module measures the scrollbar into --gem-lightbox-gap.
|
|
42
|
+
:root.gem-lightbox-open {
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
padding-right: var(--gem-lightbox-gap, 0px);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// The image is a child, so the backdrop fades on a pseudo element.
|
|
48
|
+
.gem-lightbox {
|
|
49
|
+
position: fixed;
|
|
50
|
+
inset: 0;
|
|
51
|
+
z-index: 240;
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
padding: clamp(0.5rem, 2vw, 1.5rem);
|
|
56
|
+
|
|
57
|
+
&[hidden] {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:focus {
|
|
62
|
+
outline: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&::before {
|
|
66
|
+
content: "";
|
|
67
|
+
position: absolute;
|
|
68
|
+
inset: 0;
|
|
69
|
+
background: color-mix(in srgb, var(--bg) 55%, transparent);
|
|
70
|
+
backdrop-filter: blur(0.75rem);
|
|
71
|
+
-webkit-backdrop-filter: blur(0.75rem);
|
|
72
|
+
opacity: 0;
|
|
73
|
+
// Matches DURATION in lightbox.ts.
|
|
74
|
+
transition: opacity 300ms ease;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.open::before {
|
|
78
|
+
opacity: 1;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.gem-lightbox-image {
|
|
83
|
+
position: relative;
|
|
84
|
+
max-width: min(94vw, 1600px);
|
|
85
|
+
max-height: 90vh;
|
|
86
|
+
border-radius: calc(0.75rem * var(--squircle-scale, 1));
|
|
87
|
+
box-shadow: 0 1.5rem 4rem rgba(charmtone.$char, 0.45);
|
|
88
|
+
cursor: zoom-out;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Matches NARROW in lightbox.ts.
|
|
92
|
+
@media (max-width: 768px) {
|
|
93
|
+
.gem-lightbox {
|
|
94
|
+
padding: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.gem-lightbox-image {
|
|
98
|
+
max-width: 100vw;
|
|
99
|
+
max-height: 100vh;
|
|
100
|
+
border-radius: 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
37
104
|
.md-quote {
|
|
38
105
|
margin: 1rem 0;
|
|
39
106
|
padding-left: 1rem;
|
|
@@ -152,7 +219,7 @@
|
|
|
152
219
|
|
|
153
220
|
.code-title {
|
|
154
221
|
overflow: hidden;
|
|
155
|
-
font-family: "
|
|
222
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
156
223
|
font-size: 0.72rem;
|
|
157
224
|
font-weight: 600;
|
|
158
225
|
color: var(--fg);
|
|
@@ -171,7 +238,7 @@
|
|
|
171
238
|
border-color: transparent;
|
|
172
239
|
background: transparent;
|
|
173
240
|
color: var(--tertiary);
|
|
174
|
-
font-family: "
|
|
241
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
175
242
|
font-size: 0.6875rem;
|
|
176
243
|
font-weight: 520;
|
|
177
244
|
letter-spacing: 0.06em;
|
|
@@ -208,7 +275,7 @@
|
|
|
208
275
|
.code-block pre {
|
|
209
276
|
margin: 0;
|
|
210
277
|
padding: 0.9rem 1.15rem 1rem 0.5rem;
|
|
211
|
-
font-family: "JetBrains Mono
|
|
278
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
212
279
|
font-size: 0.8125rem;
|
|
213
280
|
line-height: 1.7;
|
|
214
281
|
color: var(--fg);
|
|
@@ -294,14 +361,14 @@
|
|
|
294
361
|
background: color-mix(in srgb, var(--fg) 6%, transparent);
|
|
295
362
|
border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
|
|
296
363
|
border-radius: calc(0.3rem * var(--squircle-scale, 1));
|
|
297
|
-
font-family: "JetBrains Mono
|
|
364
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
298
365
|
font-size: 0.82em;
|
|
299
366
|
color: var(--fg);
|
|
300
367
|
white-space: nowrap;
|
|
301
368
|
}
|
|
302
369
|
|
|
303
370
|
.gem-raw {
|
|
304
|
-
font-family: "
|
|
371
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
305
372
|
font-size: 0.8125rem;
|
|
306
373
|
color: var(--tertiary);
|
|
307
374
|
}
|
|
@@ -318,7 +385,7 @@
|
|
|
318
385
|
content: "unregistered component: " attr(data-component);
|
|
319
386
|
display: block;
|
|
320
387
|
margin-bottom: 0.35rem;
|
|
321
|
-
font-family: "
|
|
388
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
322
389
|
font-size: 0.7rem;
|
|
323
390
|
color: var(--tertiary);
|
|
324
391
|
}
|
|
@@ -327,7 +394,7 @@
|
|
|
327
394
|
.gem-error {
|
|
328
395
|
margin: 2rem;
|
|
329
396
|
padding: 1rem;
|
|
330
|
-
font-family: "
|
|
397
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
331
398
|
font-size: 0.8125rem;
|
|
332
399
|
white-space: pre-wrap;
|
|
333
400
|
color: var(--fg);
|
|
@@ -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: "
|
|
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:
|
|
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
|
|
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.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|