@allons-y/webc-patterns 0.1.0-beta.0 → 0.1.0-beta.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.
- package/README.md +506 -5
- package/components/norn-accordion.webc +124 -0
- package/components/norn-breadcrumbs.webc +71 -0
- package/components/norn-callout.webc +97 -0
- package/components/norn-card-grid.webc +60 -0
- package/components/norn-card.webc +143 -0
- package/components/norn-code-tabs.webc +270 -0
- package/components/norn-copy-button.webc +220 -0
- package/components/norn-fact-list.webc +52 -0
- package/components/norn-footer.webc +122 -0
- package/components/norn-head.webc +59 -0
- package/components/norn-header.webc +238 -0
- package/components/norn-heading-anchor.webc +71 -0
- package/components/norn-hero.webc +81 -0
- package/components/norn-icon.webc +140 -0
- package/components/norn-link-button.webc +96 -0
- package/components/norn-notice.webc +94 -0
- package/components/norn-pager.webc +67 -0
- package/components/norn-rich-text.webc +105 -0
- package/components/norn-search.webc +303 -0
- package/components/norn-segmented-control.webc +143 -0
- package/components/norn-side-nav.webc +149 -0
- package/components/norn-sidebar-layout.webc +185 -0
- package/components/norn-simple-table.webc +120 -0
- package/components/norn-skip-link.webc +41 -0
- package/components/norn-theme-toggle.webc +127 -0
- package/components/norn-toc.webc +260 -0
- package/css/base.css +75 -0
- package/css/print.css +8 -0
- package/css/reset.css +45 -0
- package/fallback/norn-code-block.webc +13 -0
- package/index.js +170 -1
- package/layouts/norn-base.webc +137 -0
- package/layouts/norn-docs-home.webc +109 -0
- package/layouts/norn-docs.webc +77 -0
- package/layouts/norn-landing.webc +73 -0
- package/layouts/norn-workspace.webc +25 -0
- package/layouts/norn-workspaces-home.webc +44 -0
- package/lib/icons.js +166 -0
- package/lib/npm.js +49 -0
- package/lib/optional.js +25 -0
- package/lib/site.js +87 -0
- package/lib/workspaces.js +71 -0
- package/markdown.js +278 -0
- package/package.json +32 -3
- package/plugin.js +279 -0
- package/project.js +15 -0
- package/schema/project.schema.json +112 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<!---
|
|
2
|
+
/*
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
--->
|
|
9
|
+
<div><slot></slot></div>
|
|
10
|
+
<style>
|
|
11
|
+
@layer norn.components {
|
|
12
|
+
norn-accordion {
|
|
13
|
+
display: block;
|
|
14
|
+
interpolate-size: allow-keywords;
|
|
15
|
+
overflow-wrap: anywhere;
|
|
16
|
+
|
|
17
|
+
& > div > details {
|
|
18
|
+
border-block-end: 1px solid var(--norn-ui-border-color, light-dark(#d3d8e2, #2d323e));
|
|
19
|
+
|
|
20
|
+
&:first-child {
|
|
21
|
+
border-block-start: 1px solid var(--norn-ui-border-color, light-dark(#d3d8e2, #2d323e));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&[open] > summary::after {
|
|
25
|
+
rotate: 225deg;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&::details-content {
|
|
29
|
+
block-size: 0;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&[open]::details-content {
|
|
34
|
+
block-size: auto;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
& > div > details > summary {
|
|
39
|
+
--_state: 0%;
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
gap: var(--norn-space-s, 0.75rem);
|
|
45
|
+
min-block-size: var(--norn-ui-control-height, 2.25rem);
|
|
46
|
+
padding: var(--norn-space-s, 0.75rem) var(--norn-space-xs, 0.5rem);
|
|
47
|
+
border-radius: var(--norn-ui-radius-s, 4px);
|
|
48
|
+
background-color: color-mix(in oklab, currentcolor var(--_state), transparent);
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
list-style: none;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
|
|
53
|
+
&::-webkit-details-marker {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:hover {
|
|
58
|
+
--_state: var(--norn-ui-state-hover, 8%);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:active {
|
|
62
|
+
--_state: var(--norn-ui-state-press, 12%);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* The ring sits inside the summary, clear of the rules above and below. */
|
|
66
|
+
&:focus-visible {
|
|
67
|
+
outline-offset: calc(-1 * var(--norn-ui-focus-offset, 2px));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* A chevron drawn with two borders, pointing down when closed and up when open. */
|
|
71
|
+
&::after {
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
content: "";
|
|
74
|
+
flex: none;
|
|
75
|
+
inline-size: 0.5em;
|
|
76
|
+
block-size: 0.5em;
|
|
77
|
+
margin-inline-end: var(--norn-space-2xs, 0.25rem);
|
|
78
|
+
border-block-end: 2px solid var(--norn-text-accent, light-dark(oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 82%, black) min(l, 0.5) c h), oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 55%, white) max(l, 0.72) c h)));
|
|
79
|
+
border-inline-end: 2px solid var(--norn-text-accent, light-dark(oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 82%, black) min(l, 0.5) c h), oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 55%, white) max(l, 0.72) c h)));
|
|
80
|
+
rotate: 45deg;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
& > div > details > :not(summary) {
|
|
85
|
+
margin-block: 0 var(--norn-space-s, 0.75rem);
|
|
86
|
+
padding-inline: var(--norn-space-xs, 0.5rem);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@media (pointer: coarse) {
|
|
90
|
+
& > div > details > summary {
|
|
91
|
+
min-block-size: 2.75rem;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
96
|
+
& > div > details > summary {
|
|
97
|
+
transition: background-color var(--norn-ui-motion-duration, 150ms) var(--norn-ui-motion-easing, cubic-bezier(0.2, 0, 0, 1));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
& > div > details > summary::after {
|
|
101
|
+
transition: rotate 200ms var(--norn-ui-motion-easing, cubic-bezier(0.2, 0, 0, 1));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
& > div > details::details-content {
|
|
105
|
+
transition: block-size 200ms var(--norn-ui-motion-easing, cubic-bezier(0.2, 0, 0, 1)),
|
|
106
|
+
content-visibility 200ms allow-discrete;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@media (forced-colors: active) {
|
|
111
|
+
& > div > details > summary::after {
|
|
112
|
+
border-color: CanvasText;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@media print {
|
|
117
|
+
& > div > details::details-content {
|
|
118
|
+
block-size: auto;
|
|
119
|
+
content-visibility: visible;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
</style>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<!---
|
|
2
|
+
/*
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
--->
|
|
9
|
+
<nav webc:if="items && items.length" :aria-labelledby="'norn-breadcrumbs-' + uid">
|
|
10
|
+
<span data-label :id="'norn-breadcrumbs-' + uid"><slot name="label"><span webc:nokeep @text="nornComponentStrings?.('norn-breadcrumbs', 'label', $data.page) || 'Breadcrumb'"></span></slot></span>
|
|
11
|
+
<ol>
|
|
12
|
+
<li webc:for="(item, index) of items">
|
|
13
|
+
<norn-icon webc:if="index" @name="chevron-end"></norn-icon>
|
|
14
|
+
<a :href="item.href" :aria-current="index === items.length - 1 ? 'page' : undefined" @text="item.title"></a>
|
|
15
|
+
</li>
|
|
16
|
+
</ol>
|
|
17
|
+
</nav>
|
|
18
|
+
<style>
|
|
19
|
+
@layer norn.components {
|
|
20
|
+
norn-breadcrumbs {
|
|
21
|
+
display: block;
|
|
22
|
+
font-size: var(--norn-font-size-s, 0.875rem);
|
|
23
|
+
|
|
24
|
+
& nav > [data-label] {
|
|
25
|
+
position: absolute;
|
|
26
|
+
inline-size: 1px;
|
|
27
|
+
block-size: 1px;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
clip-path: inset(50%);
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
& nav > ol {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-wrap: wrap;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: var(--norn-space-2xs, 0.25rem) var(--norn-space-xs, 0.5rem);
|
|
38
|
+
margin: 0;
|
|
39
|
+
padding: 0;
|
|
40
|
+
list-style: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
& nav > ol > li {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: var(--norn-space-xs, 0.5rem);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
& nav > ol > li > norn-icon {
|
|
50
|
+
color: var(--norn-text-muted, light-dark(#4b5160, #a4abba));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* The links are quiet until the pointer or focus is on one. */
|
|
54
|
+
& nav > ol > li > a {
|
|
55
|
+
padding-block: var(--norn-space-2xs, 0.25rem);
|
|
56
|
+
color: var(--norn-text-muted, light-dark(#4b5160, #a4abba));
|
|
57
|
+
text-decoration: none;
|
|
58
|
+
|
|
59
|
+
&:is(:hover, :focus-visible) {
|
|
60
|
+
color: var(--norn-text-base, light-dark(#16181d, #eceef3));
|
|
61
|
+
text-decoration: underline;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&[aria-current="page"] {
|
|
65
|
+
color: var(--norn-text-base, light-dark(#16181d, #eceef3));
|
|
66
|
+
text-decoration: none;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<!---
|
|
2
|
+
/*
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
--->
|
|
9
|
+
<script webc:setup>
|
|
10
|
+
const VARIANTS = { note: ["Note", "info"], tip: ["Tip", "tip"], important: ["Important", "important"], warning: ["Warning", "warning"], caution: ["Caution", "caution"] };
|
|
11
|
+
|
|
12
|
+
/** A known variant, else `note`. */
|
|
13
|
+
const kind = (variant) => (Object.hasOwn(VARIANTS, variant) ? variant : "note");
|
|
14
|
+
</script>
|
|
15
|
+
<div role="note" :data-variant="kind(variant)">
|
|
16
|
+
<p><norn-icon :@name="VARIANTS[kind(variant)][1]"></norn-icon><slot name="heading"><span @text="nornComponentStrings?.('norn-callout', kind(variant), $data.page) || VARIANTS[kind(variant)][0]"></span></slot></p>
|
|
17
|
+
<slot></slot>
|
|
18
|
+
</div>
|
|
19
|
+
<style>
|
|
20
|
+
@layer norn.components {
|
|
21
|
+
norn-callout {
|
|
22
|
+
--_color: var(--norn-text-accent, light-dark(oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 82%, black) min(l, 0.5) c h), oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 55%, white) max(l, 0.72) c h)));
|
|
23
|
+
display: block;
|
|
24
|
+
|
|
25
|
+
&:has(> [data-variant="tip"]) {
|
|
26
|
+
--_color: var(--norn-status-success, light-dark(#0b6b3a, #7ed6a1));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:has(> [data-variant="warning"]) {
|
|
30
|
+
--_color: var(--norn-status-warning, light-dark(#9a4a00, #ffb36b));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:has(> [data-variant="caution"]) {
|
|
34
|
+
--_color: var(--norn-status-danger, light-dark(#b42318, #ff8a80));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* A quiet raised panel: a short rule, a small label, then the body set like a pull quote. */
|
|
38
|
+
& > div {
|
|
39
|
+
display: grid;
|
|
40
|
+
grid-template-columns: minmax(0, 1fr);
|
|
41
|
+
gap: var(--norn-space-s, 0.75rem);
|
|
42
|
+
padding: var(--norn-space-m, 1.25rem) var(--norn-space-l, 2rem);
|
|
43
|
+
overflow-wrap: anywhere;
|
|
44
|
+
border-radius: var(--norn-ui-border-radius, 6px);
|
|
45
|
+
background: var(--norn-surface-raised, light-dark(hsl(40, 14%, 96%), #242932));
|
|
46
|
+
color: var(--norn-text-base, light-dark(#16181d, #eceef3));
|
|
47
|
+
font-family: var(--norn-font-heading, var(--norn-font-body, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif));
|
|
48
|
+
font-size: var(--norn-font-size-l, 1.25rem);
|
|
49
|
+
line-height: 1.4;
|
|
50
|
+
text-wrap: pretty;
|
|
51
|
+
|
|
52
|
+
&::before {
|
|
53
|
+
content: "";
|
|
54
|
+
inline-size: 2rem;
|
|
55
|
+
block-size: 2px;
|
|
56
|
+
background: var(--_color);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
& > div > p:first-child {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: var(--norn-space-xs, 0.5rem);
|
|
64
|
+
margin: 0;
|
|
65
|
+
color: var(--_color);
|
|
66
|
+
font-family: var(--norn-font-body, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
|
|
67
|
+
font-size: var(--norn-font-size-s, 0.875rem);
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
letter-spacing: 0.08em;
|
|
70
|
+
line-height: 1.15;
|
|
71
|
+
text-transform: uppercase;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
& > div > p:first-child > norn-icon {
|
|
75
|
+
flex: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
& > div > :not(:first-child) {
|
|
79
|
+
margin: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* A fill that forced colors replaces still shows as a border. */
|
|
83
|
+
@media (forced-colors: active) {
|
|
84
|
+
& > div {
|
|
85
|
+
border: 1px solid CanvasText;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@media print {
|
|
90
|
+
& > div {
|
|
91
|
+
border: 1px solid currentcolor;
|
|
92
|
+
background: none;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
</style>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<!---
|
|
2
|
+
/*
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
--->
|
|
9
|
+
<ul role="list" :data-gap="['s', 'l'].includes(gap) ? gap : undefined" :style="typeof min === 'string' && min ? '--_min: ' + min : ''"><slot></slot></ul>
|
|
10
|
+
<style>
|
|
11
|
+
@layer norn.components {
|
|
12
|
+
norn-card-grid {
|
|
13
|
+
display: block;
|
|
14
|
+
|
|
15
|
+
& > ul {
|
|
16
|
+
--_gap: var(--norn-space-m, 1.25rem);
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--_min, 17rem)), 1fr));
|
|
19
|
+
gap: var(--_gap);
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
list-style: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
& > ul[data-gap="s"] {
|
|
26
|
+
--_gap: var(--norn-space-s, 0.75rem);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
& > ul[data-gap="l"] {
|
|
30
|
+
--_gap: var(--norn-space-l, 2rem);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Each card spans three rows, and its heading, body, and footer take one each, so they line up across a row. The rows have no gap, so a card with no footer leaves no blank space; the space between cards is a margin on each, taken back from the end of the list. */
|
|
35
|
+
@supports (grid-template-rows: subgrid) {
|
|
36
|
+
norn-card-grid {
|
|
37
|
+
& > ul {
|
|
38
|
+
row-gap: 0;
|
|
39
|
+
margin-block-end: calc(-1 * var(--_gap));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
& > ul > li {
|
|
43
|
+
display: grid;
|
|
44
|
+
grid-row: span 3;
|
|
45
|
+
grid-template-rows: subgrid;
|
|
46
|
+
margin-block-end: var(--_gap);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
& > ul > li > * {
|
|
50
|
+
grid-row: 1 / -1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* A card lays its heading, body, and footer on the rows of its tag. */
|
|
54
|
+
& > ul > li > norn-card {
|
|
55
|
+
grid-template-rows: subgrid;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<!---
|
|
2
|
+
/*
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
--->
|
|
9
|
+
<article :data-accent="['accent', 'info', 'success', 'warning', 'danger'].includes(accent) ? accent : undefined" :data-title-face="titleFace === 'mono' ? 'mono' : undefined"><slot></slot></article>
|
|
10
|
+
<style>
|
|
11
|
+
@layer norn.components {
|
|
12
|
+
norn-card {
|
|
13
|
+
display: grid;
|
|
14
|
+
grid-template-columns: minmax(0, 1fr);
|
|
15
|
+
block-size: 100%;
|
|
16
|
+
|
|
17
|
+
/* The article takes the rows the tag has. A norn-card-grid gives the tag three subgrid rows, one each for the heading, the body, and a footer, so they line up across a row. */
|
|
18
|
+
& > article {
|
|
19
|
+
--_state: 0%;
|
|
20
|
+
--_accent: initial;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
position: relative;
|
|
23
|
+
display: grid;
|
|
24
|
+
grid-row: 1 / -1;
|
|
25
|
+
grid-template-columns: minmax(0, 1fr);
|
|
26
|
+
grid-template-rows: inherit;
|
|
27
|
+
align-content: start;
|
|
28
|
+
row-gap: 0;
|
|
29
|
+
block-size: 100%;
|
|
30
|
+
padding: var(--norn-space-m, 1.25rem);
|
|
31
|
+
/* Without an accent the declaration is invalid, so there is no line and no space for one. */
|
|
32
|
+
border-block-start: 2px solid var(--_accent);
|
|
33
|
+
border-radius: var(--norn-ui-border-radius, 6px);
|
|
34
|
+
background-color: color-mix(in oklab, currentcolor var(--_state), var(--norn-surface-raised, light-dark(hsl(40, 14%, 96%), #242932)));
|
|
35
|
+
|
|
36
|
+
/* A fourth child has no row to take, so a card with more than a heading, a body, and a footer lays out on its own. */
|
|
37
|
+
&:has(> :nth-child(4)) {
|
|
38
|
+
grid-template-rows: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&[data-accent="accent"] {
|
|
42
|
+
--_accent: var(--norn-ui-accent, #2346d4);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&[data-accent="info"] {
|
|
46
|
+
--_accent: var(--norn-status-info, light-dark(#1b4fc4, #8fb0ff));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&[data-accent="success"] {
|
|
50
|
+
--_accent: var(--norn-status-success, light-dark(#0b6b3a, #7ed6a1));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&[data-accent="warning"] {
|
|
54
|
+
--_accent: var(--norn-status-warning, light-dark(#9a4a00, #ffb36b));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&[data-accent="danger"] {
|
|
58
|
+
--_accent: var(--norn-status-danger, light-dark(#b42318, #ff8a80));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:has(a:hover) {
|
|
62
|
+
--_state: var(--norn-ui-state-hover, 8%);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:has(a:active) {
|
|
66
|
+
--_state: var(--norn-ui-state-press, 12%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* The ring goes around the card, not around the link text. */
|
|
70
|
+
&:has(a:focus-visible) {
|
|
71
|
+
outline: var(--norn-ui-focus-width, 2px) solid var(--norn-text-accent, light-dark(oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 82%, black) min(l, 0.5) c h), oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 55%, white) max(l, 0.72) c h)));
|
|
72
|
+
outline-offset: var(--norn-ui-focus-offset, 2px);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
& > article > * {
|
|
77
|
+
margin: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
& > article > :not(:last-child) {
|
|
81
|
+
margin-block-end: var(--norn-space-s, 0.75rem);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
& > article > :is(h2, h3, h4, h5, h6),
|
|
85
|
+
& > article > norn-heading-anchor > :is(h2, h3, h4, h5, h6) {
|
|
86
|
+
font-family: var(--norn-font-heading, var(--norn-font-body, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif));
|
|
87
|
+
font-size: var(--norn-font-size-l, 1.25rem);
|
|
88
|
+
line-height: 1.15;
|
|
89
|
+
text-wrap: balance;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
& > article > :is(h2, h3, h4, h5, h6) a,
|
|
93
|
+
& > article > norn-heading-anchor > :is(h2, h3, h4, h5, h6) a {
|
|
94
|
+
color: var(--norn-text-accent, light-dark(oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 82%, black) min(l, 0.5) c h), oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 55%, white) max(l, 0.72) c h)));
|
|
95
|
+
text-decoration: none;
|
|
96
|
+
overflow-wrap: anywhere;
|
|
97
|
+
|
|
98
|
+
/* The link reaches over the whole card. */
|
|
99
|
+
&::after {
|
|
100
|
+
content: "";
|
|
101
|
+
position: absolute;
|
|
102
|
+
inset: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:hover {
|
|
106
|
+
text-decoration: underline;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&:focus-visible {
|
|
110
|
+
outline: none;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
& > article > p {
|
|
115
|
+
color: var(--norn-text-muted, light-dark(#4b5160, #a4abba));
|
|
116
|
+
text-wrap: pretty;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
& > article[data-title-face="mono"] > :is(h2, h3, h4, h5, h6),
|
|
120
|
+
& > article[data-title-face="mono"] > norn-heading-anchor > :is(h2, h3, h4, h5, h6) {
|
|
121
|
+
font-family: var(--norn-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
122
|
+
font-size: var(--norn-font-size-m, 1rem);
|
|
123
|
+
font-weight: 700;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
127
|
+
& > article {
|
|
128
|
+
transition: background-color var(--norn-ui-motion-duration, 150ms) var(--norn-ui-motion-easing, cubic-bezier(0.2, 0, 0, 1));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@media (forced-colors: active) {
|
|
133
|
+
& > article {
|
|
134
|
+
border: 1px solid CanvasText;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@media print {
|
|
139
|
+
break-inside: avoid;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
</style>
|