astro-nosferatu 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/README.md +39 -7
- package/package.json +20 -1
- package/src/components/Accordion.astro +446 -0
- package/src/components/Button.astro +190 -35
- package/src/components/Callout.astro +286 -0
- package/src/components/Container.astro +27 -0
- package/src/components/NavItemsDesktop.astro +77 -0
- package/src/components/NavItemsMobile.astro +76 -0
- package/src/components/NavLogo.astro +40 -0
- package/src/components/NavSocial.astro +62 -0
- package/src/components/Navbar.astro +311 -0
- package/src/components/ReadingProgress.astro +166 -0
- package/src/components/TableOfContent.astro +221 -0
- package/src/html/BaseHead.astro +51 -0
- package/src/html/BaseHtml.astro +22 -0
- package/src/layouts/BlogArticle.astro +79 -0
- package/src/styles/borders.css +12 -0
- package/src/styles/colors/colors-dark.css +219 -0
- package/src/styles/colors/colors-light.css +219 -0
- package/src/styles/colors/index.css +2 -0
- package/src/styles/generic.css +8 -0
- package/src/styles/index.css +5 -5
- package/src/styles/reset.css +53 -0
- package/src/styles/shadows.css +222 -0
- package/src/styles/spacings.css +21 -0
- package/src/styles/tokens.css +12 -41
- package/src/styles/typography.css +97 -68
- package/src/types/components.ts +42 -0
- package/src/styles/base.css +0 -24
|
@@ -1,81 +1,110 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
font-size: var(--nf-font-size-2xl);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
h3 {
|
|
21
|
-
font-size: var(--nf-font-size-xl);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
h4 {
|
|
25
|
-
font-size: var(--nf-font-size-lg);
|
|
26
|
-
}
|
|
1
|
+
:root {
|
|
2
|
+
/*
|
|
3
|
+
* Base fonts. The library names the families and never loads them: a
|
|
4
|
+
* consumer installs the matching Fontsource package (or supplies the font
|
|
5
|
+
* itself) and each stack falls through to a system font when they do not.
|
|
6
|
+
* The variable family name comes first, then the static one, so either
|
|
7
|
+
* @fontsource-variable/* or @fontsource/* works.
|
|
8
|
+
*/
|
|
9
|
+
--nf-font-family:
|
|
10
|
+
"Outfit Variable", "Outfit", system-ui, -apple-system, sans-serif;
|
|
11
|
+
--nf-font-family-blog-post:
|
|
12
|
+
"Plus Jakarta Sans Variable", "Plus Jakarta Sans", system-ui, -apple-system,
|
|
13
|
+
sans-serif;
|
|
14
|
+
--nf-font-family-code-blog-post:
|
|
15
|
+
"Geist Mono Variable", "Geist Mono", ui-monospace, monospace;
|
|
16
|
+
--nf-font-weight: 400;
|
|
27
17
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
/* Viewport interpolation */
|
|
19
|
+
--nf-typography-viewport-min: 560px;
|
|
20
|
+
--nf-typography-viewport-max: 1088px;
|
|
21
|
+
--nf-typography-viewport-progress: progress(
|
|
22
|
+
100svw,
|
|
23
|
+
var(--nf-typography-viewport-min),
|
|
24
|
+
var(--nf-typography-viewport-max)
|
|
25
|
+
);
|
|
32
26
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
/* h1 */
|
|
28
|
+
--nf-typography-font-size-h1-min: 3rem;
|
|
29
|
+
--nf-typography-font-size-h1-max: 3.5rem;
|
|
30
|
+
--nf-typography-font-size-h1: calc(
|
|
31
|
+
var(--nf-typography-font-size-h1-min) +
|
|
32
|
+
var(--nf-typography-viewport-progress) *
|
|
33
|
+
(
|
|
34
|
+
var(--nf-typography-font-size-h1-max) -
|
|
35
|
+
var(--nf-typography-font-size-h1-min)
|
|
36
|
+
)
|
|
37
|
+
);
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
/* h2 */
|
|
40
|
+
--nf-typography-font-size-h2-min: 2.5rem;
|
|
41
|
+
--nf-typography-font-size-h2-max: 3rem;
|
|
42
|
+
--nf-typography-font-size-h2: calc(
|
|
43
|
+
var(--nf-typography-font-size-h2-min) +
|
|
44
|
+
var(--nf-typography-viewport-progress) *
|
|
45
|
+
(
|
|
46
|
+
var(--nf-typography-font-size-h2-max) -
|
|
47
|
+
var(--nf-typography-font-size-h2-min)
|
|
48
|
+
)
|
|
49
|
+
);
|
|
43
50
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
/* h3 */
|
|
52
|
+
--nf-typography-font-size-h3-min: 2rem;
|
|
53
|
+
--nf-typography-font-size-h3-max: 2.5rem;
|
|
54
|
+
--nf-typography-font-size-h3: calc(
|
|
55
|
+
var(--nf-typography-font-size-h3-min) +
|
|
56
|
+
var(--nf-typography-viewport-progress) *
|
|
57
|
+
(
|
|
58
|
+
var(--nf-typography-font-size-h3-max) -
|
|
59
|
+
var(--nf-typography-font-size-h3-min)
|
|
60
|
+
)
|
|
61
|
+
);
|
|
48
62
|
|
|
49
|
-
|
|
50
|
-
|
|
63
|
+
/* p */
|
|
64
|
+
--nf-typography-font-size-base-min: 1rem;
|
|
65
|
+
--nf-typography-font-size-base-max: 1.125rem;
|
|
66
|
+
--nf-typography-font-size-base: calc(
|
|
67
|
+
var(--nf-typography-font-size-base-min) +
|
|
68
|
+
var(--nf-typography-viewport-progress) *
|
|
69
|
+
(
|
|
70
|
+
var(--nf-typography-font-size-base-max) -
|
|
71
|
+
var(--nf-typography-font-size-base-min)
|
|
72
|
+
)
|
|
73
|
+
);
|
|
51
74
|
}
|
|
52
75
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
/*
|
|
77
|
+
* The one element the library gives a font to; everything else inherits.
|
|
78
|
+
* This sits outside the @supports guard below, which is about progress() and
|
|
79
|
+
* not about fonts: a browser without it still gets the typeface.
|
|
80
|
+
*/
|
|
81
|
+
body {
|
|
82
|
+
font-family: var(--nf-font-family);
|
|
83
|
+
font-weight: var(--nf-font-weight);
|
|
58
84
|
}
|
|
59
85
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
86
|
+
/*
|
|
87
|
+
* The scale is progressive enhancement. Without this guard, a browser with no
|
|
88
|
+
* progress() support still accepts the custom properties above — custom
|
|
89
|
+
* properties take arbitrary tokens — and fails later, on the calc() here. Since
|
|
90
|
+
* font-size inherits, every heading would then render at body size. Inside the
|
|
91
|
+
* guard such a browser simply keeps the sizes it already had.
|
|
92
|
+
*/
|
|
93
|
+
@supports (font-size: calc(1rem + progress(100svw, 0px, 1px) * 1rem)) {
|
|
94
|
+
h1 {
|
|
95
|
+
font-size: var(--nf-typography-font-size-h1);
|
|
96
|
+
}
|
|
65
97
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
background-color: var(--nf-color-surface);
|
|
70
|
-
overflow-x: auto;
|
|
71
|
-
}
|
|
98
|
+
h2 {
|
|
99
|
+
font-size: var(--nf-typography-font-size-h2);
|
|
100
|
+
}
|
|
72
101
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
102
|
+
h3 {
|
|
103
|
+
font-size: var(--nf-typography-font-size-h3);
|
|
104
|
+
}
|
|
77
105
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
106
|
+
button,
|
|
107
|
+
p {
|
|
108
|
+
font-size: var(--nf-typography-font-size-base);
|
|
109
|
+
}
|
|
81
110
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared prop types for the library's components.
|
|
3
|
+
*
|
|
4
|
+
* Published components import this file by **relative** path, never through
|
|
5
|
+
* the `@/*` alias: the library ships source, and a consumer's TypeScript has
|
|
6
|
+
* no such alias, so an aliased import would resolve to `any` on their side and
|
|
7
|
+
* silently drop the prop's type checking.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** The palette hues a component's `color` prop accepts. */
|
|
11
|
+
export type ColorPalette =
|
|
12
|
+
| "blue"
|
|
13
|
+
| "cyan"
|
|
14
|
+
| "green"
|
|
15
|
+
| "grey"
|
|
16
|
+
| "orange"
|
|
17
|
+
| "pink"
|
|
18
|
+
| "purple"
|
|
19
|
+
| "red"
|
|
20
|
+
| "yellow";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Any component a prop renders as an icon: an `.astro` file, an imported
|
|
24
|
+
* `.svg`, a framework component. The receiving component is never told what
|
|
25
|
+
* an icon is: it renders it with no props, or, where it fixes the icon's look
|
|
26
|
+
* (the navbar parts), with `width` and `height` of `1em` and a `stroke-width`
|
|
27
|
+
* of `2`, which an imported `.svg` honours and any other component may ignore.
|
|
28
|
+
*/
|
|
29
|
+
export type IconComponent = (props: Record<string, any>) => any;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* One link in a navigation list. `NavItemsDesktop` and `NavItemsMobile` both
|
|
33
|
+
* take an array of these, so the two lists can differ in items, order and icons.
|
|
34
|
+
*/
|
|
35
|
+
export type NavItem = {
|
|
36
|
+
text: string;
|
|
37
|
+
href: string;
|
|
38
|
+
/** Rendered before the text, hidden from assistive technology. */
|
|
39
|
+
icon?: IconComponent;
|
|
40
|
+
/** Marks the link `aria-current="page"` and draws it in the active color. */
|
|
41
|
+
current?: boolean;
|
|
42
|
+
};
|
package/src/styles/base.css
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
html {
|
|
2
|
-
-webkit-text-size-adjust: 100%;
|
|
3
|
-
text-size-adjust: 100%;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
body {
|
|
7
|
-
min-height: 100vh;
|
|
8
|
-
background-color: var(--nf-color-background);
|
|
9
|
-
color: var(--nf-color-text);
|
|
10
|
-
font-family: var(--nf-font-body);
|
|
11
|
-
font-size: var(--nf-font-size-md);
|
|
12
|
-
line-height: var(--nf-line-height-body);
|
|
13
|
-
-webkit-font-smoothing: antialiased;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
:focus-visible {
|
|
17
|
-
outline: 2px solid var(--nf-color-focus);
|
|
18
|
-
outline-offset: 2px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
::selection {
|
|
22
|
-
background-color: var(--nf-color-primary);
|
|
23
|
-
color: var(--nf-color-on-primary);
|
|
24
|
-
}
|