@rxova/brand 0.10.0 → 0.11.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 +18 -11
- package/package.json +2 -1
- package/src/astro.css +11 -32
- package/src/chrome.css +51 -0
- package/src/footer.css +2 -2
package/README.md
CHANGED
|
@@ -69,20 +69,27 @@ import { PROJECTS } from '@rxova/brand'
|
|
|
69
69
|
---
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
`astro.css` pulls in `
|
|
73
|
-
|
|
72
|
+
`astro.css` pulls in `chrome.css` — the tokens, the footer's styles and the
|
|
73
|
+
short aliases — and adds the reset and base element styles that Starlight gives
|
|
74
|
+
docs sites for free.
|
|
75
|
+
|
|
76
|
+
Use `chrome.css` on its own where something else already owns the document, such
|
|
77
|
+
as rxova-website's shell templates: their body is composed into a built
|
|
78
|
+
Starlight page, and the reset in `astro.css` is unlayered, so it would outrank
|
|
79
|
+
everything in `@layer starlight.*` and flatten that page.
|
|
74
80
|
|
|
75
81
|
## What's in it
|
|
76
82
|
|
|
77
|
-
| Export | What it is
|
|
78
|
-
| --------------------------------- |
|
|
79
|
-
| `@rxova/brand` | `PROJECTS`, `docsUrl()`, `siteUrl()`, `sharedStarlightConfig()`
|
|
80
|
-
| `@rxova/brand/tokens.css` | The `--rx-*` custom properties. Everything derives from these.
|
|
81
|
-
| `@rxova/brand/starlight.css` | For docs sites: maps `--rx-*` onto Starlight's `--sl-*`, plus chrome
|
|
82
|
-
| `@rxova/brand/astro.css` | For plain Astro sites:
|
|
83
|
-
| `@rxova/brand/
|
|
84
|
-
| `@rxova/brand/
|
|
85
|
-
| `@rxova/brand/
|
|
83
|
+
| Export | What it is |
|
|
84
|
+
| --------------------------------- | ---------------------------------------------------------------------- |
|
|
85
|
+
| `@rxova/brand` | `PROJECTS`, `docsUrl()`, `siteUrl()`, `sharedStarlightConfig()` |
|
|
86
|
+
| `@rxova/brand/tokens.css` | The `--rx-*` custom properties. Everything derives from these. |
|
|
87
|
+
| `@rxova/brand/starlight.css` | For docs sites: maps `--rx-*` onto Starlight's `--sl-*`, plus chrome |
|
|
88
|
+
| `@rxova/brand/astro.css` | For plain Astro sites: `chrome.css`, a reset, and base element styling |
|
|
89
|
+
| `@rxova/brand/chrome.css` | What the shared header and footer need, with nothing document-level |
|
|
90
|
+
| `@rxova/brand/fonts.css` | Self-hosted Space Grotesk + IBM Plex Mono |
|
|
91
|
+
| `@rxova/brand/components/*.astro` | `SiteTitle`, `SocialIcons`, `Footer`, `SiteFooter`, `ProjectSwitcher` |
|
|
92
|
+
| `@rxova/brand/assets/*` | The mark, logos and per-project OG images |
|
|
86
93
|
|
|
87
94
|
## The palette
|
|
88
95
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxova/brand",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Design tokens, Starlight theme and shared site chrome for rxova.org",
|
|
6
6
|
"keywords": [
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
".": "./src/index.ts",
|
|
34
34
|
"./tokens.css": "./src/tokens.css",
|
|
35
35
|
"./astro.css": "./src/astro.css",
|
|
36
|
+
"./chrome.css": "./src/chrome.css",
|
|
36
37
|
"./starlight.css": "./src/starlight.css",
|
|
37
38
|
"./fonts.css": "./src/fonts.css",
|
|
38
39
|
"./components/*": "./src/components/*",
|
package/src/astro.css
CHANGED
|
@@ -1,42 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Entry point for plain Astro surfaces
|
|
2
|
+
* Entry point for plain Astro surfaces that own their whole document — the
|
|
3
|
+
* rxova.org landing, /blog and /updates.
|
|
3
4
|
*
|
|
4
5
|
* Starlight sites use `starlight.css` instead; it maps the same tokens onto
|
|
5
|
-
* Starlight's own variables. This file
|
|
6
|
+
* Starlight's own variables. This file is `chrome.css` — the tokens, the footer
|
|
7
|
+
* and the short aliases — plus the two things a bare Astro page needs and
|
|
6
8
|
* Starlight already provides: a reset and base element styling.
|
|
7
9
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Load this only where nothing else owns the document. A surface that renders
|
|
11
|
+
* the shared chrome *into* someone else's document — rxova-website's shell
|
|
12
|
+
* templates, whose body is composed into a built Starlight page — must load
|
|
13
|
+
* `chrome.css` instead. The reset below is unlayered, so inside a Starlight
|
|
14
|
+
* document it would outrank every rule in `@layer starlight.*` and flatten the
|
|
15
|
+
* page; see chrome.css.
|
|
13
16
|
*/
|
|
14
17
|
|
|
15
|
-
@import './
|
|
16
|
-
/* The shared site footer, which /blog, /updates and the landing all render. It
|
|
17
|
-
is the one piece of chrome common to these surfaces and the Starlight ones,
|
|
18
|
-
so its rules sit in their own file and both entry points pull them in. */
|
|
19
|
-
@import './footer.css';
|
|
20
|
-
|
|
21
|
-
:root {
|
|
22
|
-
--bg: var(--rx-bg);
|
|
23
|
-
--fg: var(--rx-fg);
|
|
24
|
-
--muted: var(--rx-muted);
|
|
25
|
-
--faint: var(--rx-faint);
|
|
26
|
-
--rule: var(--rx-rule);
|
|
27
|
-
--card: var(--rx-card);
|
|
28
|
-
--tag-bg: var(--rx-tag-bg);
|
|
29
|
-
--glow-tint: var(--rx-glow-tint);
|
|
30
|
-
--font: var(--rx-font-sans);
|
|
31
|
-
--mono: var(--rx-font-mono);
|
|
32
|
-
--max: var(--rx-max);
|
|
33
|
-
|
|
34
|
-
/* The landing's `--accent` is the foreground, not the brand violet: its
|
|
35
|
-
design is deliberately monochrome and uses the gradient only as an accent
|
|
36
|
-
rule. Mapping this to --rx-primary would tint every focus ring on the
|
|
37
|
-
site. */
|
|
38
|
-
--accent: var(--rx-fg);
|
|
39
|
-
}
|
|
18
|
+
@import './chrome.css';
|
|
40
19
|
|
|
41
20
|
/* --- Reset ---------------------------------------------------------------- */
|
|
42
21
|
|
package/src/chrome.css
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the shared chrome needs, and nothing that touches the document.
|
|
3
|
+
*
|
|
4
|
+
* `Header`, `SiteFooter` and `ThemeToggle` are rendered on two kinds of page:
|
|
5
|
+
* plain Astro surfaces that own their whole document (the landing, /blog,
|
|
6
|
+
* /updates — see astro.css), and rxova-website's shell templates, whose body is
|
|
7
|
+
* composed into an already-complete Starlight document at deploy time.
|
|
8
|
+
*
|
|
9
|
+
* The second case is why this file exists. It carries the tokens, the footer's
|
|
10
|
+
* styles and the short aliases the chrome's scoped CSS is written against — but
|
|
11
|
+
* no reset and no base element styling. Those belong to whoever owns the
|
|
12
|
+
* document, and a shell that brings its own into a Starlight page destroys that
|
|
13
|
+
* page: Starlight puts all of its CSS in `@layer starlight.*`, and an unlayered
|
|
14
|
+
* `* { margin: 0; padding: 0 }` arriving from the shell beats every layered rule
|
|
15
|
+
* it has, whatever the specificity. That is not a hypothetical — it flattened
|
|
16
|
+
* every /packages/* docs page on rxova.org.
|
|
17
|
+
*
|
|
18
|
+
* So: load this to render the chrome, and astro.css (which is this plus the
|
|
19
|
+
* reset) to own a document.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
@import './tokens.css';
|
|
23
|
+
/* The shared site footer, which /blog, /updates and the landing all render. It
|
|
24
|
+
is the one piece of chrome common to these surfaces and the Starlight ones,
|
|
25
|
+
so its rules sit in their own file and both entry points pull them in. */
|
|
26
|
+
@import './footer.css';
|
|
27
|
+
|
|
28
|
+
/* The short token names the landing and the shared chrome were written against
|
|
29
|
+
(`--bg`, `--fg`, `--rule`, …), aliased onto their `--rx-*` equivalents, so
|
|
30
|
+
adopting this package did not require rewriting several hundred lines of
|
|
31
|
+
scoped component styles in one go. New work should use `--rx-*` directly; the
|
|
32
|
+
aliases exist to make the migration incremental, not to be a second API. */
|
|
33
|
+
:root {
|
|
34
|
+
--bg: var(--rx-bg);
|
|
35
|
+
--fg: var(--rx-fg);
|
|
36
|
+
--muted: var(--rx-muted);
|
|
37
|
+
--faint: var(--rx-faint);
|
|
38
|
+
--rule: var(--rx-rule);
|
|
39
|
+
--card: var(--rx-card);
|
|
40
|
+
--tag-bg: var(--rx-tag-bg);
|
|
41
|
+
--glow-tint: var(--rx-glow-tint);
|
|
42
|
+
--font: var(--rx-font-sans);
|
|
43
|
+
--mono: var(--rx-font-mono);
|
|
44
|
+
--max: var(--rx-max);
|
|
45
|
+
|
|
46
|
+
/* The landing's `--accent` is the foreground, not the brand violet: its
|
|
47
|
+
design is deliberately monochrome and uses the gradient only as an accent
|
|
48
|
+
rule. Mapping this to --rx-primary would tint every focus ring on the
|
|
49
|
+
site. */
|
|
50
|
+
--accent: var(--rx-fg);
|
|
51
|
+
}
|
package/src/footer.css
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* is why /blog and /updates shipped a dot-separated link row instead — the
|
|
8
8
|
* shared footer would have rendered unstyled there.
|
|
9
9
|
*
|
|
10
|
-
* Imported by both `starlight.css` and `
|
|
10
|
+
* Imported by both `starlight.css` and `chrome.css`; nothing needs to import it
|
|
11
11
|
* directly. Written against `--rx-*` tokens only, so it does not depend on the
|
|
12
|
-
* short aliases
|
|
12
|
+
* short aliases chrome.css defines.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
@import './tokens.css';
|