@abreen/tada 1.15.12 → 1.16.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/assets/material-symbols/celebration_24px.svg +1 -0
- package/assets/material-symbols/close_24px.svg +1 -0
- package/assets/material-symbols/contrast_24px.svg +1 -0
- package/assets/material-symbols/contrast_rtl_off_24px.svg +1 -0
- package/assets/material-symbols/info_24px.svg +1 -0
- package/assets/material-symbols/menu_24px.svg +1 -0
- package/assets/material-symbols/north_east_24px.svg +1 -0
- package/assets/material-symbols/search_24px.svg +1 -0
- package/assets/material-symbols/south_east_24px.svg +1 -0
- package/assets/material-symbols/tag_24px.svg +1 -0
- package/assets/material-symbols/warning_24px.svg +1 -0
- package/build/bundle.ts +7 -12
- package/build/material-symbols.ts +107 -0
- package/build/utils/markdown.ts +11 -43
- package/fonts/libertinus-mono/LICENSE.txt +99 -0
- package/fonts/libertinus-mono/woff2/LibertinusMono-Regular.woff2 +0 -0
- package/fonts/source-serif-4/LICENSE.txt +91 -0
- package/fonts/source-serif-4/woff2/SourceSerif4-Italic-VariableFont_opsz,wght.woff2 +0 -0
- package/fonts/source-serif-4/woff2/SourceSerif4-VariableFont_opsz,wght.woff2 +0 -0
- package/package.json +2 -1
- package/src/_alerts.scss +1 -1
- package/src/_base.scss +2 -16
- package/src/anchor/index.ts +14 -10
- package/src/anchor/style.scss +10 -10
- package/src/appearance-picker/index.ts +168 -0
- package/src/appearance-picker/style.scss +119 -0
- package/src/code.scss +1 -0
- package/src/header/_base.scss +30 -6
- package/src/header/index.ts +1 -1
- package/src/index.ts +2 -0
- package/src/material-symbols.scss +11 -0
- package/src/navigate/lifecycle.ts +2 -0
- package/src/search/style.scss +0 -1
- package/src/slides/style.scss +1 -0
- package/src/style.scss +30 -28
- package/src/toc/style.scss +3 -1
- package/src/trace/style.scss +1 -0
- package/templates/_appearance-picker.html +18 -0
- package/templates/_theme.scss +43 -13
- package/templates/_top.html +13 -1
- package/templates/code.html +1 -0
- package/templates/default.html +1 -0
- package/templates/literate.html +1 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
export type FontPreference = 'sans' | 'serif';
|
|
2
|
+
export type ContrastPreference = 'standard' | 'high';
|
|
3
|
+
|
|
4
|
+
const FONT_STORAGE_KEY = 'fontPreference';
|
|
5
|
+
const CONTRAST_STORAGE_KEY = 'contrastPreference';
|
|
6
|
+
|
|
7
|
+
function getStorage(window: Window): Storage | null {
|
|
8
|
+
try {
|
|
9
|
+
return window.localStorage;
|
|
10
|
+
} catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function getStoredPreference<T extends string>(
|
|
16
|
+
storage: Storage | null,
|
|
17
|
+
key: string,
|
|
18
|
+
storedValue: T,
|
|
19
|
+
defaultValue: T,
|
|
20
|
+
): T {
|
|
21
|
+
try {
|
|
22
|
+
return storage?.getItem(key) === storedValue ? storedValue : defaultValue;
|
|
23
|
+
} catch {
|
|
24
|
+
return defaultValue;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function saveStoredPreference<T extends string>(
|
|
29
|
+
storage: Storage | null,
|
|
30
|
+
key: string,
|
|
31
|
+
preference: T,
|
|
32
|
+
storedValue: T,
|
|
33
|
+
): void {
|
|
34
|
+
try {
|
|
35
|
+
if (preference === storedValue) {
|
|
36
|
+
storage?.setItem(key, preference);
|
|
37
|
+
} else {
|
|
38
|
+
storage?.removeItem(key);
|
|
39
|
+
}
|
|
40
|
+
} catch {
|
|
41
|
+
// Storage can be unavailable in privacy-restricted contexts.
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function getFontPreference(storage: Storage | null): FontPreference {
|
|
46
|
+
return getStoredPreference(storage, FONT_STORAGE_KEY, 'serif', 'sans');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function getContrastPreference(
|
|
50
|
+
storage: Storage | null,
|
|
51
|
+
): ContrastPreference {
|
|
52
|
+
return getStoredPreference(storage, CONTRAST_STORAGE_KEY, 'high', 'standard');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function saveFontPreference(
|
|
56
|
+
storage: Storage | null,
|
|
57
|
+
preference: FontPreference,
|
|
58
|
+
): void {
|
|
59
|
+
saveStoredPreference(storage, FONT_STORAGE_KEY, preference, 'serif');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function saveContrastPreference(
|
|
63
|
+
storage: Storage | null,
|
|
64
|
+
preference: ContrastPreference,
|
|
65
|
+
): void {
|
|
66
|
+
saveStoredPreference(storage, CONTRAST_STORAGE_KEY, preference, 'high');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function applyFontPreference(
|
|
70
|
+
document: Document,
|
|
71
|
+
preference: FontPreference,
|
|
72
|
+
): void {
|
|
73
|
+
if (preference === 'serif') {
|
|
74
|
+
document.documentElement.dataset.fontPreference = preference;
|
|
75
|
+
} else {
|
|
76
|
+
delete document.documentElement.dataset.fontPreference;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function applyContrastPreference(
|
|
81
|
+
document: Document,
|
|
82
|
+
preference: ContrastPreference,
|
|
83
|
+
): void {
|
|
84
|
+
if (preference === 'high') {
|
|
85
|
+
document.documentElement.dataset.contrastPreference = preference;
|
|
86
|
+
} else {
|
|
87
|
+
delete document.documentElement.dataset.contrastPreference;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function syncControls(
|
|
92
|
+
document: Document,
|
|
93
|
+
selector: string,
|
|
94
|
+
preference: string,
|
|
95
|
+
): void {
|
|
96
|
+
document.querySelectorAll<HTMLButtonElement>(selector).forEach(button => {
|
|
97
|
+
button.disabled = false;
|
|
98
|
+
button.setAttribute(
|
|
99
|
+
'aria-pressed',
|
|
100
|
+
String(
|
|
101
|
+
button.dataset.fontPreferenceValue === preference ||
|
|
102
|
+
button.dataset.contrastPreferenceValue === preference,
|
|
103
|
+
),
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function syncAppearance(
|
|
109
|
+
document: Document,
|
|
110
|
+
fontPreference: FontPreference,
|
|
111
|
+
contrastPreference: ContrastPreference,
|
|
112
|
+
): void {
|
|
113
|
+
syncControls(document, '[data-font-preference-value]', fontPreference);
|
|
114
|
+
syncControls(
|
|
115
|
+
document,
|
|
116
|
+
'[data-contrast-preference-value]',
|
|
117
|
+
contrastPreference,
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export default function mountAppearancePicker(window: Window): () => void {
|
|
122
|
+
const { document } = window;
|
|
123
|
+
const container = document.querySelector<HTMLElement>('.appearance-pickers');
|
|
124
|
+
if (!container) {
|
|
125
|
+
return () => {};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const buttons = Array.from(
|
|
129
|
+
container.querySelectorAll<HTMLButtonElement>('button'),
|
|
130
|
+
);
|
|
131
|
+
const storage = getStorage(window);
|
|
132
|
+
let fontPreference = getFontPreference(storage);
|
|
133
|
+
let contrastPreference = getContrastPreference(storage);
|
|
134
|
+
|
|
135
|
+
applyFontPreference(document, fontPreference);
|
|
136
|
+
applyContrastPreference(document, contrastPreference);
|
|
137
|
+
syncAppearance(document, fontPreference, contrastPreference);
|
|
138
|
+
|
|
139
|
+
const handleClick = (event: Event) => {
|
|
140
|
+
const button = event.currentTarget as HTMLButtonElement;
|
|
141
|
+
const fontValue = button.dataset.fontPreferenceValue;
|
|
142
|
+
const contrastValue = button.dataset.contrastPreferenceValue;
|
|
143
|
+
|
|
144
|
+
if (fontValue === 'sans' || fontValue === 'serif') {
|
|
145
|
+
fontPreference = fontValue;
|
|
146
|
+
saveFontPreference(storage, fontPreference);
|
|
147
|
+
applyFontPreference(document, fontPreference);
|
|
148
|
+
} else if (contrastValue === 'standard' || contrastValue === 'high') {
|
|
149
|
+
contrastPreference = contrastValue;
|
|
150
|
+
saveContrastPreference(storage, contrastPreference);
|
|
151
|
+
applyContrastPreference(document, contrastPreference);
|
|
152
|
+
} else {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
syncAppearance(document, fontPreference, contrastPreference);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
for (const button of buttons) {
|
|
160
|
+
button.addEventListener('click', handleClick);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return () => {
|
|
164
|
+
for (const button of buttons) {
|
|
165
|
+
button.removeEventListener('click', handleClick);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
.appearance-pickers {
|
|
4
|
+
display: flex;
|
|
5
|
+
gap: 0.5rem;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
margin: 2rem auto 1rem;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.preference-picker {
|
|
11
|
+
--preference-picker-option-width: 2.5rem;
|
|
12
|
+
--preference-picker-gap: 0.5rem;
|
|
13
|
+
--preference-picker-padding: 6px;
|
|
14
|
+
|
|
15
|
+
@include user-select(none);
|
|
16
|
+
|
|
17
|
+
position: relative;
|
|
18
|
+
display: grid;
|
|
19
|
+
grid-template-columns: repeat(2, var(--preference-picker-option-width));
|
|
20
|
+
gap: var(--preference-picker-gap);
|
|
21
|
+
width: fit-content;
|
|
22
|
+
padding: var(--preference-picker-padding);
|
|
23
|
+
background: var(--bg2-color);
|
|
24
|
+
border-radius: calc(var(--border-radius) + 4px);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.preference-picker::before {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: var(--preference-picker-padding);
|
|
30
|
+
bottom: var(--preference-picker-padding);
|
|
31
|
+
left: var(--preference-picker-padding);
|
|
32
|
+
width: var(--preference-picker-option-width);
|
|
33
|
+
content: '';
|
|
34
|
+
background: var(--bg-color);
|
|
35
|
+
border-radius: var(--border-radius);
|
|
36
|
+
box-shadow: 0 0 0 var(--control-border-width) var(--fg2-color);
|
|
37
|
+
transform: translateX(0);
|
|
38
|
+
|
|
39
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
40
|
+
transition: transform 0.2s ease;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:root[data-font-preference='serif'] .font-picker::before,
|
|
45
|
+
:root[data-contrast-preference='high'] .contrast-picker::before {
|
|
46
|
+
transform: translateX(calc(100% + var(--preference-picker-gap)));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.preference-picker:has(
|
|
50
|
+
.preference-picker-option[aria-pressed='true']:is(:hover, :focus)
|
|
51
|
+
)::before {
|
|
52
|
+
background: var(--bg2-color);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.preference-picker:has(
|
|
56
|
+
.preference-picker-option[aria-pressed='true']:active:not(:disabled)
|
|
57
|
+
)::before {
|
|
58
|
+
background: var(--link-active-color);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.preference-picker-option {
|
|
62
|
+
position: relative;
|
|
63
|
+
z-index: 1;
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
width: var(--preference-picker-option-width);
|
|
68
|
+
height: 2rem;
|
|
69
|
+
padding: 0;
|
|
70
|
+
font-size: var(--font-size-smaller);
|
|
71
|
+
color: var(--fg2-color);
|
|
72
|
+
background: transparent;
|
|
73
|
+
border: 0;
|
|
74
|
+
border-radius: var(--border-radius);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.font-picker-option-sans {
|
|
78
|
+
font-family: var(--sans-font);
|
|
79
|
+
font-feature-settings: var(--sans-font-feature-settings);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.font-picker-option-serif {
|
|
83
|
+
// Avoid requesting the bundled serif face just to render the inactive
|
|
84
|
+
// preview on a default sans page.
|
|
85
|
+
font-family: var(--serif-preview-font);
|
|
86
|
+
font-feature-settings: var(--serif-font-feature-settings);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.material-symbol-icon {
|
|
90
|
+
width: 1.25rem;
|
|
91
|
+
height: 1.25rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.material-symbol-icon-contrast-standard {
|
|
95
|
+
--material-symbol-icon: var(--icon-contrast-standard);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.material-symbol-icon-contrast-high {
|
|
99
|
+
--material-symbol-icon: var(--icon-contrast-high);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.preference-picker-option[aria-pressed='true'] {
|
|
103
|
+
color: var(--fg-color);
|
|
104
|
+
background: transparent;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.preference-picker-option[aria-pressed='true']:is(:hover, :focus) {
|
|
108
|
+
background: transparent;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.preference-picker-option[aria-pressed='true']:active:not(:disabled) {
|
|
112
|
+
background: transparent !important;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@media print {
|
|
116
|
+
.appearance-pickers {
|
|
117
|
+
display: none;
|
|
118
|
+
}
|
|
119
|
+
}
|
package/src/code.scss
CHANGED
package/src/header/_base.scss
CHANGED
|
@@ -56,15 +56,20 @@ header details summary::marker {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
header summary::after {
|
|
59
|
+
flex: 0 0 24px;
|
|
59
60
|
order: -1;
|
|
61
|
+
width: 24px;
|
|
60
62
|
height: 24px;
|
|
61
63
|
margin-right: 8px;
|
|
62
64
|
margin-left: var(--gap);
|
|
63
|
-
content:
|
|
65
|
+
content: '';
|
|
66
|
+
|
|
67
|
+
@include contained-mask(var(--icon-header-menu));
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
header details[open] summary::after {
|
|
67
|
-
|
|
71
|
+
-webkit-mask-image: var(--icon-header-close);
|
|
72
|
+
mask-image: var(--icon-header-close);
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
header .content {
|
|
@@ -131,16 +136,35 @@ header .results-container {
|
|
|
131
136
|
}
|
|
132
137
|
|
|
133
138
|
header .search-controls {
|
|
139
|
+
position: relative;
|
|
134
140
|
display: flex;
|
|
135
141
|
align-items: center;
|
|
136
142
|
height: var(--header-collapsed-height);
|
|
137
143
|
|
|
144
|
+
@media (width <= 400px) {
|
|
145
|
+
display: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&::before {
|
|
149
|
+
position: absolute;
|
|
150
|
+
top: 50%;
|
|
151
|
+
left: 7px;
|
|
152
|
+
z-index: 1;
|
|
153
|
+
width: 22px;
|
|
154
|
+
height: 22px;
|
|
155
|
+
pointer-events: none;
|
|
156
|
+
content: '';
|
|
157
|
+
transform: translateY(-50%);
|
|
158
|
+
|
|
159
|
+
@include contained-mask(var(--icon-search));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&:has(input:disabled)::before {
|
|
163
|
+
opacity: 0.4;
|
|
164
|
+
}
|
|
165
|
+
|
|
138
166
|
input.search {
|
|
139
167
|
width: 180px;
|
|
140
|
-
|
|
141
|
-
@media (width <= 400px) {
|
|
142
|
-
display: none;
|
|
143
|
-
}
|
|
144
168
|
}
|
|
145
169
|
}
|
|
146
170
|
|
package/src/header/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './style.scss';
|
|
2
2
|
|
|
3
|
+
import './material-symbols.scss';
|
|
3
4
|
import './anchor/style.scss';
|
|
4
5
|
import './code.scss';
|
|
5
6
|
import './code/style.scss';
|
|
@@ -12,6 +13,7 @@ import './slides/style.scss';
|
|
|
12
13
|
import './timezone/style.scss';
|
|
13
14
|
import './toc/style.scss';
|
|
14
15
|
import './trace/style.scss';
|
|
16
|
+
import './appearance-picker/style.scss';
|
|
15
17
|
import './navigate/style.scss';
|
|
16
18
|
import './page-update/style.scss';
|
|
17
19
|
|
|
@@ -6,6 +6,7 @@ import mountCode from '../code';
|
|
|
6
6
|
import mountTrace from '../trace';
|
|
7
7
|
import mountPrint from '../print';
|
|
8
8
|
import mountSlides from '../slides';
|
|
9
|
+
import mountAppearancePicker from '../appearance-picker';
|
|
9
10
|
import { scheduleTask } from '../util';
|
|
10
11
|
|
|
11
12
|
const PER_PAGE_COMPONENTS: Record<
|
|
@@ -20,6 +21,7 @@ const PER_PAGE_COMPONENTS: Record<
|
|
|
20
21
|
trace: mountTrace,
|
|
21
22
|
slides: mountSlides,
|
|
22
23
|
print: mountPrint,
|
|
24
|
+
appearancePicker: mountAppearancePicker,
|
|
23
25
|
};
|
|
24
26
|
|
|
25
27
|
let cleanups: (() => void)[] = [];
|
package/src/search/style.scss
CHANGED
package/src/slides/style.scss
CHANGED
|
@@ -94,6 +94,7 @@ body.is-presenting header,
|
|
|
94
94
|
body.is-presenting .title-and-info,
|
|
95
95
|
body.is-presenting nav.toc,
|
|
96
96
|
body.is-presenting footer,
|
|
97
|
+
body.is-presenting .appearance-pickers,
|
|
97
98
|
body.is-presenting .slides-header,
|
|
98
99
|
body.is-presenting .trace-toolbar {
|
|
99
100
|
display: none;
|
package/src/style.scss
CHANGED
|
@@ -37,6 +37,32 @@
|
|
|
37
37
|
font-display: swap;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
@font-face {
|
|
41
|
+
font-family: 'Source Serif 4';
|
|
42
|
+
font-style: normal;
|
|
43
|
+
font-weight: 200 900;
|
|
44
|
+
src: url('source-serif-4/SourceSerif4-VariableFont_opsz,wght.woff2')
|
|
45
|
+
format('woff2');
|
|
46
|
+
font-display: swap;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@font-face {
|
|
50
|
+
font-family: 'Source Serif 4';
|
|
51
|
+
font-style: italic;
|
|
52
|
+
font-weight: 200 900;
|
|
53
|
+
src: url('source-serif-4/SourceSerif4-Italic-VariableFont_opsz,wght.woff2')
|
|
54
|
+
format('woff2');
|
|
55
|
+
font-display: swap;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@font-face {
|
|
59
|
+
font-family: 'Libertinus Mono';
|
|
60
|
+
font-style: normal;
|
|
61
|
+
font-weight: 400;
|
|
62
|
+
src: url('libertinus-mono/LibertinusMono-Regular.woff2') format('woff2');
|
|
63
|
+
font-display: swap;
|
|
64
|
+
}
|
|
65
|
+
|
|
40
66
|
::selection {
|
|
41
67
|
color: var(--bg-color);
|
|
42
68
|
background: var(--fg-color);
|
|
@@ -93,35 +119,14 @@ a.external:not(:has(.external-link-tail))::after {
|
|
|
93
119
|
margin: 0;
|
|
94
120
|
}
|
|
95
121
|
|
|
96
|
-
.footnotes ol {
|
|
97
|
-
padding-left: 0;
|
|
98
|
-
list-style: none;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
122
|
.footnotes li {
|
|
102
|
-
position: relative;
|
|
103
|
-
padding-left: 1.8em;
|
|
104
123
|
margin-bottom: 8px;
|
|
105
124
|
}
|
|
106
125
|
|
|
107
126
|
a.footnote-ref {
|
|
108
127
|
font-size: 0.8em;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.footnote-marker {
|
|
114
|
-
@include user-select(none);
|
|
115
|
-
|
|
116
|
-
position: absolute;
|
|
117
|
-
top: 0;
|
|
118
|
-
left: 0;
|
|
119
|
-
font-weight: 500;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
a.footnote-ref,
|
|
123
|
-
.footnote-marker {
|
|
124
|
-
font-feature-settings: 'ss06'; // squared numbers
|
|
128
|
+
vertical-align: super;
|
|
129
|
+
border-bottom: none;
|
|
125
130
|
}
|
|
126
131
|
|
|
127
132
|
.footnote-item {
|
|
@@ -131,10 +136,7 @@ a.footnote-ref,
|
|
|
131
136
|
}
|
|
132
137
|
}
|
|
133
138
|
|
|
134
|
-
a.footnote-ref
|
|
135
|
-
@include user-select(none);
|
|
136
|
-
}
|
|
137
|
-
|
|
139
|
+
a.footnote-ref,
|
|
138
140
|
.footnotes .footnote-backref {
|
|
139
141
|
display: inline-block;
|
|
140
142
|
|
|
@@ -416,7 +418,7 @@ a.breadcrumb {
|
|
|
416
418
|
vertical-align: middle;
|
|
417
419
|
content: '';
|
|
418
420
|
|
|
419
|
-
@include contained-mask(var(--icon-
|
|
421
|
+
@include contained-mask(var(--icon-parent));
|
|
420
422
|
}
|
|
421
423
|
}
|
|
422
424
|
|
package/src/toc/style.scss
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
body.code .toc ol li:has(a) {
|
|
18
18
|
font-family: var(--mono-font);
|
|
19
19
|
font-size: var(--mono-font-size);
|
|
20
|
+
font-feature-settings: var(--mono-font-feature-settings);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
body.code .toc ol a {
|
|
@@ -30,6 +31,7 @@ body.code .toc ol a {
|
|
|
30
31
|
font-family: var(--mono-font);
|
|
31
32
|
font-size: var(--font-size-small);
|
|
32
33
|
font-style: italic;
|
|
34
|
+
font-feature-settings: var(--mono-font-feature-settings);
|
|
33
35
|
text-align: center;
|
|
34
36
|
content: 'On this page';
|
|
35
37
|
}
|
|
@@ -144,7 +146,7 @@ body.code .toc ol a {
|
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
.toc ol li.alert-item.note a::before {
|
|
147
|
-
@include contained-mask(var(--icon-
|
|
149
|
+
@include contained-mask(var(--icon-info));
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
.toc ol li.label {
|
package/src/trace/style.scss
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div class="appearance-pickers" data-pagefind-ignore>
|
|
2
|
+
<div class="preference-picker font-picker" role="group" aria-label="Font style">
|
|
3
|
+
<button type="button" class="preference-picker-option font-picker-option-sans" data-font-preference-value="sans" aria-label="Use sans-serif fonts" aria-pressed="true" disabled>
|
|
4
|
+
<span aria-hidden="true">Aa</span>
|
|
5
|
+
</button>
|
|
6
|
+
<button type="button" class="preference-picker-option font-picker-option-serif" data-font-preference-value="serif" aria-label="Use serif fonts" aria-pressed="false" disabled>
|
|
7
|
+
<span aria-hidden="true">Aa</span>
|
|
8
|
+
</button>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="preference-picker contrast-picker" role="group" aria-label="Contrast">
|
|
11
|
+
<button type="button" class="preference-picker-option contrast-picker-option-standard" data-contrast-preference-value="standard" aria-label="Use standard contrast" aria-pressed="true" disabled>
|
|
12
|
+
<span class="material-symbol-icon material-symbol-icon-contrast-standard" aria-hidden="true"></span>
|
|
13
|
+
</button>
|
|
14
|
+
<button type="button" class="preference-picker-option contrast-picker-option-high" data-contrast-preference-value="high" aria-label="Use high contrast" aria-pressed="false" disabled>
|
|
15
|
+
<span class="material-symbol-icon material-symbol-icon-contrast-high" aria-hidden="true"></span>
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
package/templates/_theme.scss
CHANGED
|
@@ -36,13 +36,25 @@
|
|
|
36
36
|
--box-shadow: 0 2px 9px
|
|
37
37
|
hsl(var(--tint-hue) calc(85% * var(--tint-amount)) 10% / 25%);
|
|
38
38
|
--backdrop-filter: blur(10px);
|
|
39
|
-
--font:
|
|
39
|
+
--sans-font:
|
|
40
40
|
'Inter', -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto',
|
|
41
41
|
'Helvetica', 'Arial', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
|
42
42
|
'Segoe UI Symbol';
|
|
43
|
+
--sans-mono-font: 'Google Sans Code', 'Consolas', 'Courier', monospace;
|
|
44
|
+
--serif-font: 'Source Serif 4', 'Times New Roman', 'Times', serif;
|
|
45
|
+
--serif-preview-font: 'Times New Roman', 'Times', serif;
|
|
46
|
+
--serif-mono-font: 'Libertinus Mono', 'Courier New', 'Courier', monospace;
|
|
47
|
+
--sans-font-feature-settings:
|
|
48
|
+
'liga', 'calt', 'ss07', 'ss08', 'cv01', 'cv08', 'cv10';
|
|
49
|
+
--sans-mono-font-feature-settings: normal;
|
|
50
|
+
--serif-font-feature-settings: normal;
|
|
51
|
+
--serif-mono-font-feature-settings: normal;
|
|
52
|
+
--font: var(--sans-font);
|
|
43
53
|
--heading-font: var(--font);
|
|
44
54
|
--heading-line-height: 1.3;
|
|
45
|
-
--mono-font:
|
|
55
|
+
--mono-font: var(--sans-mono-font);
|
|
56
|
+
--font-feature-settings: var(--sans-font-feature-settings);
|
|
57
|
+
--mono-font-feature-settings: var(--sans-mono-font-feature-settings);
|
|
46
58
|
--font-size: 1rem;
|
|
47
59
|
--font-size-smaller: 0.9375em;
|
|
48
60
|
--font-size-small: 0.8125em;
|
|
@@ -55,19 +67,30 @@
|
|
|
55
67
|
|
|
56
68
|
// SVG icons
|
|
57
69
|
// Mask icons (color-agnostic, painted via background-color: currentColor)
|
|
58
|
-
--icon-external-link: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'><path d='M6 18 L20 4 M10 4 H20 V14' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/></svg>");
|
|
59
|
-
--icon-anchor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 28'><path d='M11 4 L8 20 M17 4 L14 20 M5 9 H21 M3 15 H19' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/></svg>");
|
|
60
|
-
--icon-warning: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M10.8 4.2 Q12 2 13.2 4.2 L20.8 17.9 Q22 20 19.6 20 H4.4 Q2 20 3.2 17.9 Z' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/><line x1='12' y1='9' x2='12' y2='13' stroke='black' stroke-width='2' stroke-linecap='square'/><line x1='12' y1='16' x2='12' y2='16' stroke='black' stroke-width='2' stroke-linecap='square'/></svg>");
|
|
61
|
-
--icon-note: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='9.5' fill='none' stroke='black' stroke-width='1.5'/><line x1='12' y1='10' x2='12' y2='16' stroke='black' stroke-width='2' stroke-linecap='square'/><line x1='12' y1='7' x2='12' y2='7' stroke='black' stroke-width='2' stroke-linecap='square'/></svg>");
|
|
62
70
|
--icon-check: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'><path d='M5 12.5 10 17 19 7' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/></svg>");
|
|
63
|
-
|
|
64
|
-
--icon-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><polyline points='9 18 15 12 9 6' stroke='<%= iconColor %>' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
|
|
65
|
-
--icon-breadcrumb: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'><path d='M3 7 H17 V22' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/><polyline points='11 16 17 22 23 16' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/></svg>");
|
|
66
|
-
--icon-tada: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 -960 960 960'><path d='m121-172 151-426q4-11 13.48-17.5 9.47-6.5 20.3-6.5 7.22 0 13.52 2.5T331-612l277 276q5 5.4 7.5 11.7 2.5 6.3 2.5 13.5 0 10.8-6.5 20.3T594-277L167-126q-11 4-20.53.97-9.54-3.04-16.47-9.97-6.93-6.93-9.97-16.47Q117-161 121-172Zm791-506q-8 8-17 8t-17-8l-17-17q-13.8-14-34.5-14T792-695L589-491q-7.36 7-17.18 7T555-491q-7-7-7-16.82t7-17.18l203-204q28.07-28 67.53-28Q865-757 894-729l18 18q7 7.09 7 16.55 0 9.45-7 16.45ZM418-797q7.36-7 17.18-7t16.82 7l17 17q27 28.53 27 67.77Q496-673 469-644l-17 17q-7.36 7-17.18 7T418-627q-7-7-7-16.82t7-17.18l17-17q14-13.79 14-33.5T435-745l-18-18q-7-7.09-7-16.55 0-9.45 8-17.45Zm119-50q7-7 16.82-7t17.18 7l51 51q29 29 29 68.47 0 39.46-29 67.53L521-559q-7.09 7-16.55 7-9.45 0-17.45-7t-8-17.18q0-10.18 8-17.82l101-101q14-13.6 14-34t-14-34l-51-50q-7-7.36-7-17.18t7-16.82Zm340 407q-7 7-16.82 7T843-440l-51-51q-13.6-14-34-14t-34 14l-68 68q-7.36 7-17.18 7T622-423q-7-7-7-16.82t7-17.18l68-68q29-27 68.5-27.5T826-525l51 51q7 7.36 7 17.18T877-440Z'/></svg>");
|
|
71
|
+
/* TADA_MATERIAL_SYMBOL_VARIABLES */
|
|
67
72
|
|
|
68
73
|
color-scheme: light dark;
|
|
69
74
|
}
|
|
70
75
|
|
|
76
|
+
:root[data-font-preference='serif'] {
|
|
77
|
+
--font: var(--serif-font);
|
|
78
|
+
--mono-font: var(--serif-mono-font);
|
|
79
|
+
--font-feature-settings: var(--serif-font-feature-settings);
|
|
80
|
+
--mono-font-feature-settings: var(--serif-mono-font-feature-settings);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:root[data-contrast-preference='high'] {
|
|
84
|
+
--fg-color: hsl(0deg 0% 0%);
|
|
85
|
+
--fg-color-translucent: hsl(0deg 0% 0% / 33%);
|
|
86
|
+
--fg2-color: hsl(0deg 0% 30%);
|
|
87
|
+
--bg-color: hsl(0deg 0% 100%);
|
|
88
|
+
--bg-color-translucent: hsl(0deg 0% 100% / 66%);
|
|
89
|
+
--bg2-color: #f4f4f4;
|
|
90
|
+
--bg2-color-translucent: rgb(244 244 244 / 66%);
|
|
91
|
+
--box-shadow: 0 2px 9px hsl(0deg 0% 0% / 25%);
|
|
92
|
+
}
|
|
93
|
+
|
|
71
94
|
@media (prefers-color-scheme: dark) {
|
|
72
95
|
:root {
|
|
73
96
|
--theme-color: <%= themeColorDark %>;
|
|
@@ -94,9 +117,16 @@
|
|
|
94
117
|
--link-active-color: #fff;
|
|
95
118
|
--warning-bg-color: hsl(36deg 77% 27%);
|
|
96
119
|
--note-bg-color: hsl(209deg 90% 25%);
|
|
120
|
+
}
|
|
97
121
|
|
|
98
|
-
|
|
99
|
-
--
|
|
100
|
-
--
|
|
122
|
+
:root[data-contrast-preference='high'] {
|
|
123
|
+
--fg-color: hsl(0deg 0% 100%);
|
|
124
|
+
--fg-color-translucent: hsl(0deg 0% 100% / 33%);
|
|
125
|
+
--fg2-color: hsl(0deg 0% 70%);
|
|
126
|
+
--bg-color: hsl(0deg 0% 0%);
|
|
127
|
+
--bg-color-translucent: hsl(0deg 0% 0% / 66%);
|
|
128
|
+
--bg2-color: hsl(0deg 0% 15%);
|
|
129
|
+
--bg2-color-translucent: hsl(0deg 0% 15% / 66%);
|
|
130
|
+
--box-shadow: 0 3px 8px hsl(0deg 0% 0% / 70%);
|
|
101
131
|
}
|
|
102
132
|
}
|