@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.
Files changed (43) hide show
  1. package/assets/material-symbols/celebration_24px.svg +1 -0
  2. package/assets/material-symbols/close_24px.svg +1 -0
  3. package/assets/material-symbols/contrast_24px.svg +1 -0
  4. package/assets/material-symbols/contrast_rtl_off_24px.svg +1 -0
  5. package/assets/material-symbols/info_24px.svg +1 -0
  6. package/assets/material-symbols/menu_24px.svg +1 -0
  7. package/assets/material-symbols/north_east_24px.svg +1 -0
  8. package/assets/material-symbols/search_24px.svg +1 -0
  9. package/assets/material-symbols/south_east_24px.svg +1 -0
  10. package/assets/material-symbols/tag_24px.svg +1 -0
  11. package/assets/material-symbols/warning_24px.svg +1 -0
  12. package/build/bundle.ts +7 -12
  13. package/build/material-symbols.ts +107 -0
  14. package/build/utils/markdown.ts +11 -43
  15. package/fonts/libertinus-mono/LICENSE.txt +99 -0
  16. package/fonts/libertinus-mono/woff2/LibertinusMono-Regular.woff2 +0 -0
  17. package/fonts/source-serif-4/LICENSE.txt +91 -0
  18. package/fonts/source-serif-4/woff2/SourceSerif4-Italic-VariableFont_opsz,wght.woff2 +0 -0
  19. package/fonts/source-serif-4/woff2/SourceSerif4-VariableFont_opsz,wght.woff2 +0 -0
  20. package/package.json +2 -1
  21. package/src/_alerts.scss +1 -1
  22. package/src/_base.scss +2 -16
  23. package/src/anchor/index.ts +14 -10
  24. package/src/anchor/style.scss +10 -10
  25. package/src/appearance-picker/index.ts +168 -0
  26. package/src/appearance-picker/style.scss +119 -0
  27. package/src/code.scss +1 -0
  28. package/src/header/_base.scss +30 -6
  29. package/src/header/index.ts +1 -1
  30. package/src/index.ts +2 -0
  31. package/src/material-symbols.scss +11 -0
  32. package/src/navigate/lifecycle.ts +2 -0
  33. package/src/search/style.scss +0 -1
  34. package/src/slides/style.scss +1 -0
  35. package/src/style.scss +30 -28
  36. package/src/toc/style.scss +3 -1
  37. package/src/trace/style.scss +1 -0
  38. package/templates/_appearance-picker.html +18 -0
  39. package/templates/_theme.scss +43 -13
  40. package/templates/_top.html +13 -1
  41. package/templates/code.html +1 -0
  42. package/templates/default.html +1 -0
  43. package/templates/literate.html +1 -0
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m80-80 200-560 360 360L80-80Zm132-132 282-100-182-182-100 282Zm370-246-42-42 224-224q32-32 77-32t77 32l24 24-42 42-24-24q-14-14-35-14t-35 14L582-458ZM422-618l-42-42 24-24q14-14 14-34t-14-34l-26-26 42-42 26 26q32 32 32 76t-32 76l-24 24Zm80 80-42-42 144-144q14-14 14-35t-14-35l-64-64 42-42 64 64q32 32 32 77t-32 77L502-538Zm160 160-42-42 64-64q32-32 77-32t77 32l64 64-42 42-64-64q-14-14-35-14t-35 14l-64 64ZM212-212Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm40-83q119-15 199.5-104.5T800-480q0-123-80.5-212.5T520-797v634Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M819-28 701-146q-48 32-103.5 49T480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-62 17-117.5T146-701L27-820l57-57L876-85l-57 57ZM480-160q45 0 85.5-12t76.5-33L480-367v207Zm335-100-59-59q21-35 32.5-75.5T800-480q0-133-93.5-226.5T480-800v205L260-815q48-31 103.5-48T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 61-17 116.5T815-260Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m216-160-56-56 464-464H360v-80h400v400h-80v-264L216-160Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M360-200v-80h264L160-744l56-56 464 464v-264h80v400H360Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m240-160 40-160H120l20-80h160l40-160H180l20-80h160l40-160h80l-40 160h160l40-160h80l-40 160h160l-20 80H660l-40 160h160l-20 80H600l-40 160h-80l40-160H360l-40 160h-80Zm140-240h160l40-160H420l-40 160Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m40-120 440-760 440 760H40Zm138-80h604L480-720 178-200Zm302-40q17 0 28.5-11.5T520-280q0-17-11.5-28.5T480-320q-17 0-28.5 11.5T440-280q0 17 11.5 28.5T480-240Zm-40-120h80v-200h-80v200Zm40-100Z"/></svg>
package/build/bundle.ts CHANGED
@@ -18,6 +18,7 @@ import type { PluginBuilder } from 'bun';
18
18
  import type { SiteVariables } from './types';
19
19
  import timezones from '../src/timezone/timezones.json' with { type: 'json' };
20
20
  import pkg from '../package.json' with { type: 'json' };
21
+ import { renderMaterialSymbolVariables } from './material-symbols';
21
22
 
22
23
  interface BunBuildPlugin {
23
24
  name: string;
@@ -52,12 +53,6 @@ function renderThemeScss(siteVariables: SiteVariables): string {
52
53
  const tintHue = siteVariables.tintHue ?? 20;
53
54
  const tintAmount = siteVariables.tintAmount ?? 100;
54
55
 
55
- const iconColor = `hsl(${tintHue}deg ${(8 * tintAmount) / 100}% 8%)`;
56
- const iconColorHover = `hsl(${tintHue}deg ${(6 * tintAmount) / 100}% 45%)`;
57
- const iconColorDark = `hsl(${tintHue}deg ${(20 * tintAmount) / 100}% 90%)`;
58
- const iconColorHoverDark = `hsl(${tintHue}deg ${(6 * tintAmount) / 100}% 60%)`;
59
- const iconColorTranslucentDark = `hsl(${tintHue}deg ${(85 * tintAmount) / 100}% 90%)`;
60
-
61
56
  const linkHue = formatCssNumber(deriveLinkHue(tintHue));
62
57
  const linkColor = `hsl(${linkHue}deg 44.4% 49.4%)`;
63
58
  const linkColorHover = `hsl(${linkHue}deg 34% 60%)`;
@@ -66,16 +61,12 @@ function renderThemeScss(siteVariables: SiteVariables): string {
66
61
  const traceLineActiveHue = formatCssNumber(deriveTraceLineActiveHue(tintHue));
67
62
  const bgTraceLineActive = `hsl(${traceLineActiveHue}deg 100% 86%)`;
68
63
  const bgTraceLineActiveDark = `hsl(${traceLineActiveHue}deg 90% 18%)`;
64
+ const materialSymbolVariables = renderMaterialSymbolVariables();
69
65
 
70
- const rendered = _.template(template)({
66
+ const renderedTemplate = _.template(template)({
71
67
  ...theme,
72
68
  tintHue,
73
69
  tintAmount,
74
- iconColor,
75
- iconColorHover,
76
- iconColorDark,
77
- iconColorHoverDark,
78
- iconColorTranslucentDark,
79
70
  linkColor,
80
71
  linkColorHover,
81
72
  linkColorDark,
@@ -83,6 +74,10 @@ function renderThemeScss(siteVariables: SiteVariables): string {
83
74
  bgTraceLineActive,
84
75
  bgTraceLineActiveDark,
85
76
  });
77
+ const rendered = renderedTemplate.replace(
78
+ '/* TADA_MATERIAL_SYMBOL_VARIABLES */',
79
+ materialSymbolVariables,
80
+ );
86
81
 
87
82
  const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'tada-'));
88
83
  const configDir = path.join(tmpDir, 'config');
@@ -0,0 +1,107 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { getPackageDir } from './utils/paths';
4
+
5
+ export const MATERIAL_SYMBOL_CONFIG = Object.freeze({
6
+ family: 'Material Symbols Outlined',
7
+ fill: 0,
8
+ weight: 400,
9
+ grade: 0,
10
+ opticalSize: 24,
11
+ viewBox: '0 -960 960 960',
12
+ source:
13
+ 'https://github.com/google/material-design-icons/tree/master/symbols/web',
14
+ } as const);
15
+
16
+ export const MATERIAL_SYMBOLS = Object.freeze({
17
+ tada: Object.freeze({ cssVariable: '--icon-tada', symbol: 'celebration' }),
18
+ contrastStandard: Object.freeze({
19
+ cssVariable: '--icon-contrast-standard',
20
+ symbol: 'contrast_rtl_off',
21
+ }),
22
+ contrastHigh: Object.freeze({
23
+ cssVariable: '--icon-contrast-high',
24
+ symbol: 'contrast',
25
+ }),
26
+ info: Object.freeze({ cssVariable: '--icon-info', symbol: 'info' }),
27
+ warning: Object.freeze({ cssVariable: '--icon-warning', symbol: 'warning' }),
28
+ parent: Object.freeze({ cssVariable: '--icon-parent', symbol: 'south_east' }),
29
+ search: Object.freeze({ cssVariable: '--icon-search', symbol: 'search' }),
30
+ externalLink: Object.freeze({
31
+ cssVariable: '--icon-external-link',
32
+ symbol: 'north_east',
33
+ }),
34
+ headingAnchor: Object.freeze({
35
+ cssVariable: '--icon-heading-anchor',
36
+ symbol: 'tag',
37
+ }),
38
+ headerMenu: Object.freeze({
39
+ cssVariable: '--icon-header-menu',
40
+ symbol: 'menu',
41
+ }),
42
+ headerClose: Object.freeze({
43
+ cssVariable: '--icon-header-close',
44
+ symbol: 'close',
45
+ }),
46
+ } as const);
47
+
48
+ type MaterialSymbol = (typeof MATERIAL_SYMBOLS)[keyof typeof MATERIAL_SYMBOLS];
49
+
50
+ interface RenderMaterialSymbolOptions {
51
+ packageDir?: string;
52
+ readFile?: (filePath: string) => string;
53
+ }
54
+
55
+ function getAssetPath(packageDir: string, symbol: MaterialSymbol): string {
56
+ return path.join(
57
+ packageDir,
58
+ 'assets/material-symbols',
59
+ `${symbol.symbol}_${MATERIAL_SYMBOL_CONFIG.opticalSize}px.svg`,
60
+ );
61
+ }
62
+
63
+ function isConfiguredSvg(svg: string): boolean {
64
+ const svgTag = svg.match(/<svg\b[^>]*>/)?.[0];
65
+ if (!svgTag) {
66
+ return false;
67
+ }
68
+
69
+ const hasAttribute = (name: string, value: string) =>
70
+ new RegExp(`\\b${name}=["']${value}["']`).test(svgTag);
71
+
72
+ return (
73
+ hasAttribute('width', String(MATERIAL_SYMBOL_CONFIG.opticalSize)) &&
74
+ hasAttribute('height', String(MATERIAL_SYMBOL_CONFIG.opticalSize)) &&
75
+ hasAttribute('viewBox', MATERIAL_SYMBOL_CONFIG.viewBox)
76
+ );
77
+ }
78
+
79
+ export function renderMaterialSymbolVariables({
80
+ packageDir = getPackageDir(),
81
+ readFile = filePath => fs.readFileSync(filePath, 'utf8'),
82
+ }: RenderMaterialSymbolOptions = {}): string {
83
+ return Object.values(MATERIAL_SYMBOLS)
84
+ .map(symbol => {
85
+ const assetPath = getAssetPath(packageDir, symbol);
86
+ let svg: string;
87
+
88
+ try {
89
+ svg = readFile(assetPath);
90
+ } catch (error) {
91
+ throw new Error(
92
+ `Material Symbol "${symbol.symbol}" could not be read from ${assetPath}`,
93
+ { cause: error },
94
+ );
95
+ }
96
+
97
+ if (!isConfiguredSvg(svg)) {
98
+ throw new Error(
99
+ `Material Symbol "${symbol.symbol}" does not match the configured ${MATERIAL_SYMBOL_CONFIG.opticalSize}px SVG format: ${assetPath}`,
100
+ );
101
+ }
102
+
103
+ const dataUri = `data:image/svg+xml,${encodeURIComponent(svg.trim())}`;
104
+ return ` ${symbol.cssVariable}: url("${dataUri}");`;
105
+ })
106
+ .join('\n');
107
+ }
@@ -49,22 +49,6 @@ function capitalize(str: string): string {
49
49
  return str.charAt(0).toUpperCase() + str.slice(1);
50
50
  }
51
51
 
52
- const MAX_FOOTNOTES = 35;
53
-
54
- export function footnoteLabel(oneBasedIndex: number): string {
55
- if (oneBasedIndex < 1 || oneBasedIndex > MAX_FOOTNOTES) {
56
- throw new Error(
57
- `Tada supports at most ${MAX_FOOTNOTES} footnotes per page ` +
58
- `(9 digits + 26 capital letters), but footnote ${oneBasedIndex} ` +
59
- `was requested. Reduce the number of footnotes on this page.`,
60
- );
61
- }
62
- if (oneBasedIndex <= 9) {
63
- return String(oneBasedIndex);
64
- }
65
- return String.fromCharCode('A'.charCodeAt(0) + (oneBasedIndex - 10));
66
- }
67
-
68
52
  export function createMarkdown(
69
53
  siteVariables: SiteVariables,
70
54
  options: CreateMarkdownOptions = {},
@@ -624,23 +608,22 @@ export function createMarkdown(
624
608
  );
625
609
  };
626
610
 
627
- /*
628
- * Customize markdown-it-footnote renderer.
629
- *
630
- * Footnotes are labeled with single characters from Inter's ss06
631
- * stylistic set: 1-9 for the first nine footnotes, then A-Z. The
632
- * default <ol> numbering is suppressed via CSS and we inject a
633
- * marker span per item so the label sequence can mix digits and
634
- * letters.
635
- */
611
+ /* Customize markdown-it-footnote renderer. */
636
612
  markdown.renderer.rules.footnote_block_open = () =>
637
613
  '<div class="footnotes"><p class="title">Footnotes</p><ol>';
638
614
 
639
615
  markdown.renderer.rules.footnote_block_close = () => '</ol></div>';
640
616
 
641
- markdown.renderer.rules.footnote_caption = (tokens: Token[], idx: number) => {
642
- const id = tokens[idx].meta!.id as number;
643
- return footnoteLabel(id + 1);
617
+ const caption = markdown.renderer.rules.footnote_caption!;
618
+ markdown.renderer.rules.footnote_caption = (
619
+ tokens: Token[],
620
+ idx: number,
621
+ options: Options,
622
+ env: unknown,
623
+ self: Renderer,
624
+ ) => {
625
+ const str = caption(tokens, idx, options, env, self);
626
+ return str.slice(1, str.length - 1);
644
627
  };
645
628
 
646
629
  const footnoteRef = markdown.renderer.rules.footnote_ref!;
@@ -651,26 +634,11 @@ export function createMarkdown(
651
634
  env: unknown,
652
635
  self: Renderer,
653
636
  ) =>
654
- // Prepend a non-breaking space so the reference link cannot wrap
655
- // away from the word it follows.
656
- '\u00a0' +
657
637
  footnoteRef(tokens, idx, options, env, self)
658
638
  .replace('<sup class="footnote-ref">', '')
659
639
  .replace('</sup>', '')
660
640
  .replace('<a href="', '<a class="footnote-ref" href="');
661
641
 
662
- markdown.renderer.rules.footnote_open = (tokens: Token[], idx: number) => {
663
- const id = tokens[idx].meta!.id as number;
664
- const label = footnoteLabel(id + 1);
665
- const refid = id + 1;
666
- return (
667
- `<li id="fn${refid}" class="footnote-item">` +
668
- `<span class="footnote-marker" aria-hidden="true">${label}</span> `
669
- );
670
- };
671
-
672
- markdown.renderer.rules.footnote_close = () => '</li>\n';
673
-
674
642
  const footnoteAnchor = markdown.renderer.rules.footnote_anchor!;
675
643
  markdown.renderer.rules.footnote_anchor = (
676
644
  tokens: Token[],
@@ -0,0 +1,99 @@
1
+ Copyright 2025 The Libertinus Keyboard Project Authors (https://github.com/googlefonts/libertinus)
2
+ Copyright 2025 The Libertinus Math Project Authors (https://github.com/googlefonts/libertinus)
3
+ Copyright 2025 The Libertinus Mono Project Authors (https://github.com/googlefonts/libertinus)
4
+ Copyright 2025 The Libertinus Sans Project Authors (https://github.com/googlefonts/libertinus)
5
+ Copyright 2025 The Libertinus Serif Project Authors (https://github.com/googlefonts/libertinus)
6
+ Copyright 2025 The Libertinus Serif Display Project Authors (https://github.com/googlefonts/libertinus)
7
+ Copyright 2025 The Libertinus Serif Initials Project Authors (https://github.com/googlefonts/libertinus)
8
+
9
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
10
+ This license is copied below, and is also available with a FAQ at:
11
+ https://openfontlicense.org
12
+
13
+
14
+ -----------------------------------------------------------
15
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
16
+ -----------------------------------------------------------
17
+
18
+ PREAMBLE
19
+ The goals of the Open Font License (OFL) are to stimulate worldwide
20
+ development of collaborative font projects, to support the font creation
21
+ efforts of academic and linguistic communities, and to provide a free and
22
+ open framework in which fonts may be shared and improved in partnership
23
+ with others.
24
+
25
+ The OFL allows the licensed fonts to be used, studied, modified and
26
+ redistributed freely as long as they are not sold by themselves. The
27
+ fonts, including any derivative works, can be bundled, embedded,
28
+ redistributed and/or sold with any software provided that any reserved
29
+ names are not used by derivative works. The fonts and derivatives,
30
+ however, cannot be released under any other type of license. The
31
+ requirement for fonts to remain under this license does not apply
32
+ to any document created using the fonts or their derivatives.
33
+
34
+ DEFINITIONS
35
+ "Font Software" refers to the set of files released by the Copyright
36
+ Holder(s) under this license and clearly marked as such. This may
37
+ include source files, build scripts and documentation.
38
+
39
+ "Reserved Font Name" refers to any names specified as such after the
40
+ copyright statement(s).
41
+
42
+ "Original Version" refers to the collection of Font Software components as
43
+ distributed by the Copyright Holder(s).
44
+
45
+ "Modified Version" refers to any derivative made by adding to, deleting,
46
+ or substituting -- in part or in whole -- any of the components of the
47
+ Original Version, by changing formats or by porting the Font Software to a
48
+ new environment.
49
+
50
+ "Author" refers to any designer, engineer, programmer, technical
51
+ writer or other person who contributed to the Font Software.
52
+
53
+ PERMISSION & CONDITIONS
54
+ Permission is hereby granted, free of charge, to any person obtaining
55
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
56
+ redistribute, and sell modified and unmodified copies of the Font
57
+ Software, subject to the following conditions:
58
+
59
+ 1) Neither the Font Software nor any of its individual components,
60
+ in Original or Modified Versions, may be sold by itself.
61
+
62
+ 2) Original or Modified Versions of the Font Software may be bundled,
63
+ redistributed and/or sold with any software, provided that each copy
64
+ contains the above copyright notice and this license. These can be
65
+ included either as stand-alone text files, human-readable headers or
66
+ in the appropriate machine-readable metadata fields within text or
67
+ binary files as long as those fields can be easily viewed by the user.
68
+
69
+ 3) No Modified Version of the Font Software may use the Reserved Font
70
+ Name(s) unless explicit written permission is granted by the corresponding
71
+ Copyright Holder. This restriction only applies to the primary font name as
72
+ presented to the users.
73
+
74
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
75
+ Software shall not be used to promote, endorse or advertise any
76
+ Modified Version, except to acknowledge the contribution(s) of the
77
+ Copyright Holder(s) and the Author(s) or with their explicit written
78
+ permission.
79
+
80
+ 5) The Font Software, modified or unmodified, in part or in whole,
81
+ must be distributed entirely under this license, and must not be
82
+ distributed under any other license. The requirement for fonts to
83
+ remain under this license does not apply to any document created
84
+ using the Font Software.
85
+
86
+ TERMINATION
87
+ This license becomes null and void if any of the above conditions are
88
+ not met.
89
+
90
+ DISCLAIMER
91
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
92
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
93
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
94
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
95
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
96
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
97
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
98
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
99
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,91 @@
1
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
2
+ This license is copied below, and is also available with a FAQ at:
3
+ https://openfontlicense.org
4
+
5
+
6
+ -----------------------------------------------------------
7
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
8
+ -----------------------------------------------------------
9
+
10
+ PREAMBLE
11
+ The goals of the Open Font License (OFL) are to stimulate worldwide
12
+ development of collaborative font projects, to support the font creation
13
+ efforts of academic and linguistic communities, and to provide a free and
14
+ open framework in which fonts may be shared and improved in partnership
15
+ with others.
16
+
17
+ The OFL allows the licensed fonts to be used, studied, modified and
18
+ redistributed freely as long as they are not sold by themselves. The
19
+ fonts, including any derivative works, can be bundled, embedded,
20
+ redistributed and/or sold with any software provided that any reserved
21
+ names are not used by derivative works. The fonts and derivatives,
22
+ however, cannot be released under any other type of license. The
23
+ requirement for fonts to remain under this license does not apply
24
+ to any document created using the fonts or their derivatives.
25
+
26
+ DEFINITIONS
27
+ "Font Software" refers to the set of files released by the Copyright
28
+ Holder(s) under this license and clearly marked as such. This may
29
+ include source files, build scripts and documentation.
30
+
31
+ "Reserved Font Name" refers to any names specified as such after the
32
+ copyright statement(s).
33
+
34
+ "Original Version" refers to the collection of Font Software components as
35
+ distributed by the Copyright Holder(s).
36
+
37
+ "Modified Version" refers to any derivative made by adding to, deleting,
38
+ or substituting -- in part or in whole -- any of the components of the
39
+ Original Version, by changing formats or by porting the Font Software to a
40
+ new environment.
41
+
42
+ "Author" refers to any designer, engineer, programmer, technical
43
+ writer or other person who contributed to the Font Software.
44
+
45
+ PERMISSION & CONDITIONS
46
+ Permission is hereby granted, free of charge, to any person obtaining
47
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
48
+ redistribute, and sell modified and unmodified copies of the Font
49
+ Software, subject to the following conditions:
50
+
51
+ 1) Neither the Font Software nor any of its individual components,
52
+ in Original or Modified Versions, may be sold by itself.
53
+
54
+ 2) Original or Modified Versions of the Font Software may be bundled,
55
+ redistributed and/or sold with any software, provided that each copy
56
+ contains the above copyright notice and this license. These can be
57
+ included either as stand-alone text files, human-readable headers or
58
+ in the appropriate machine-readable metadata fields within text or
59
+ binary files as long as those fields can be easily viewed by the user.
60
+
61
+ 3) No Modified Version of the Font Software may use the Reserved Font
62
+ Name(s) unless explicit written permission is granted by the corresponding
63
+ Copyright Holder. This restriction only applies to the primary font name as
64
+ presented to the users.
65
+
66
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
67
+ Software shall not be used to promote, endorse or advertise any
68
+ Modified Version, except to acknowledge the contribution(s) of the
69
+ Copyright Holder(s) and the Author(s) or with their explicit written
70
+ permission.
71
+
72
+ 5) The Font Software, modified or unmodified, in part or in whole,
73
+ must be distributed entirely under this license, and must not be
74
+ distributed under any other license. The requirement for fonts to
75
+ remain under this license does not apply to any document created
76
+ using the Font Software.
77
+
78
+ TERMINATION
79
+ This license becomes null and void if any of the above conditions are
80
+ not met.
81
+
82
+ DISCLAIMER
83
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
84
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
85
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
86
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
87
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
88
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
89
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
90
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
91
+ OTHER DEALINGS IN THE FONT SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abreen/tada",
3
- "version": "1.15.12",
3
+ "version": "1.16.0",
4
4
  "type": "module",
5
5
  "description": "A static site generator",
6
6
  "license": "MIT",
@@ -17,6 +17,7 @@
17
17
  "build/",
18
18
  "src/",
19
19
  "templates/",
20
+ "assets/",
20
21
  "fonts/",
21
22
  "init/",
22
23
  "schema/",
package/src/_alerts.scss CHANGED
@@ -88,7 +88,7 @@ i.warning {
88
88
  }
89
89
 
90
90
  .alert.note .title::before {
91
- @include contained-mask(var(--icon-note));
91
+ @include contained-mask(var(--icon-info));
92
92
  }
93
93
 
94
94
  .alert .title {
package/src/_base.scss CHANGED
@@ -33,18 +33,7 @@ body {
33
33
  font-family: var(--font);
34
34
  font-size: var(--font-size);
35
35
  font-weight: var(--font-weight);
36
-
37
- /*
38
- * Enable Inter's features:
39
- * liga - standard ligatures
40
- * calt - contextual alternates
41
- * ss07 - square punctuation
42
- * ss08 - square quotes
43
- * cv01 - alternate 1
44
- * cv08 - uppercase I with serif
45
- * cv10 - capital G with spur
46
- */
47
- font-feature-settings: 'liga', 'calt', 'ss07', 'ss08', 'cv01', 'cv08', 'cv10';
36
+ font-feature-settings: var(--font-feature-settings);
48
37
  line-height: var(--line-height);
49
38
  color: var(--fg-color);
50
39
  background-color: var(--bg-color);
@@ -94,6 +83,7 @@ pre,
94
83
  tt,
95
84
  code {
96
85
  font-family: var(--mono-font);
86
+ font-feature-settings: var(--mono-font-feature-settings);
97
87
  }
98
88
 
99
89
  tt,
@@ -182,10 +172,6 @@ input[type='search'] {
182
172
  min-width: 0;
183
173
  padding-left: 2rem;
184
174
  background-color: var(--bg-color);
185
- background-image: var(--icon-search);
186
- background-repeat: no-repeat;
187
- background-position: left 6px center;
188
- background-size: 16px 16px;
189
175
  border-radius: 18px;
190
176
 
191
177
  &:disabled {
@@ -2,7 +2,14 @@ function getElements(parent: HTMLElement): HTMLHeadingElement[] {
2
2
  return Array.from(parent.querySelectorAll('h1, h2, h3, h4, h5, h6'));
3
3
  }
4
4
 
5
- function createIcon(window: Window, type: 'hash' | 'present'): SVGSVGElement {
5
+ function createHeadingAnchorIcon(window: Window): HTMLSpanElement {
6
+ const icon = window.document.createElement('span');
7
+ icon.className = 'material-symbol-icon material-symbol-icon-heading-anchor';
8
+ icon.setAttribute('aria-hidden', 'true');
9
+ return icon;
10
+ }
11
+
12
+ function createPresentIcon(window: Window): SVGSVGElement {
6
13
  const svg = window.document.createElementNS(
7
14
  'http://www.w3.org/2000/svg',
8
15
  'svg',
@@ -17,13 +24,10 @@ function createIcon(window: Window, type: 'hash' | 'present'): SVGSVGElement {
17
24
  svg.setAttribute('stroke-linecap', 'round');
18
25
  svg.setAttribute('stroke-linejoin', 'round');
19
26
 
20
- const paths =
21
- type === 'hash'
22
- ? ['M10 3 8 21', 'M16 3l-2 18', 'M4 9h17', 'M3 15h17']
23
- : [
24
- 'M5 5h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Z',
25
- 'M9 20h6',
26
- ];
27
+ const paths = [
28
+ 'M5 5h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Z',
29
+ 'M9 20h6',
30
+ ];
27
31
 
28
32
  for (const d of paths) {
29
33
  const path = window.document.createElementNS(
@@ -82,7 +86,7 @@ export default (window: Window) => {
82
86
  while (el.firstChild) {
83
87
  link.appendChild(el.firstChild);
84
88
  }
85
- link.appendChild(createIcon(window, 'hash'));
89
+ link.appendChild(createHeadingAnchorIcon(window));
86
90
  el.appendChild(link);
87
91
 
88
92
  const handleClick = () => {
@@ -103,7 +107,7 @@ export default (window: Window) => {
103
107
  button.className = 'heading-present-button';
104
108
  button.setAttribute('aria-label', 'Present from this slide');
105
109
  button.title = 'Present from this slide';
106
- button.appendChild(createIcon(window, 'present'));
110
+ button.appendChild(createPresentIcon(window));
107
111
  el.appendChild(button);
108
112
 
109
113
  const slide = el.parentElement;
@@ -7,7 +7,7 @@ a.heading-anchor {
7
7
  @include subdued-link;
8
8
  }
9
9
 
10
- .heading-anchor svg,
10
+ .heading-anchor .material-symbol-icon,
11
11
  .heading-present-button svg {
12
12
  display: inline-block;
13
13
  width: 1em;
@@ -15,7 +15,7 @@ a.heading-anchor {
15
15
  vertical-align: middle;
16
16
  }
17
17
 
18
- .heading-anchor svg {
18
+ .heading-anchor .material-symbol-icon {
19
19
  margin-left: 4px;
20
20
  vertical-align: middle;
21
21
  opacity: 0;
@@ -39,7 +39,7 @@ a.heading-anchor {
39
39
  opacity: 0;
40
40
  }
41
41
 
42
- a.heading-anchor:focus-visible svg,
42
+ a.heading-anchor:focus-visible .material-symbol-icon,
43
43
  .heading-present-button:focus {
44
44
  opacity: 1;
45
45
  }
@@ -65,12 +65,12 @@ body.is-presenting .heading-present-button {
65
65
  background: transparent;
66
66
  }
67
67
 
68
- h1:hover a.heading-anchor svg,
69
- h2:hover a.heading-anchor svg,
70
- h3:hover a.heading-anchor svg,
71
- h4:hover a.heading-anchor svg,
72
- h5:hover a.heading-anchor svg,
73
- h6:hover a.heading-anchor svg,
68
+ h1:hover a.heading-anchor .material-symbol-icon,
69
+ h2:hover a.heading-anchor .material-symbol-icon,
70
+ h3:hover a.heading-anchor .material-symbol-icon,
71
+ h4:hover a.heading-anchor .material-symbol-icon,
72
+ h5:hover a.heading-anchor .material-symbol-icon,
73
+ h6:hover a.heading-anchor .material-symbol-icon,
74
74
  h1:hover .heading-present-button,
75
75
  h2:hover .heading-present-button,
76
76
  h3:hover .heading-present-button,
@@ -88,7 +88,7 @@ body.is-presenting .heading-present-button {
88
88
  }
89
89
 
90
90
  @media print {
91
- .heading-anchor svg,
91
+ .heading-anchor .material-symbol-icon,
92
92
  .heading-present-button {
93
93
  display: none;
94
94
  }