gp-dimm-city 1.0.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/CHANGELOG.md +86 -0
- package/LICENSE +32 -0
- package/README.md +165 -0
- package/components.yaml +832 -0
- package/fonts/lixdu/LICENSE.txt +34 -0
- package/fonts/lixdu/lixdu.woff +0 -0
- package/fonts/titillium-web/OFL.txt +93 -0
- package/fonts/titillium-web/titillium-web-400-italic.ttf +0 -0
- package/fonts/titillium-web/titillium-web-400.ttf +0 -0
- package/fonts/titillium-web/titillium-web-600-italic.ttf +0 -0
- package/fonts/titillium-web/titillium-web-600.ttf +0 -0
- package/fonts/titillium-web/titillium-web-700-italic.ttf +0 -0
- package/fonts/titillium-web/titillium-web-700.ttf +0 -0
- package/fonts/tomorrow/OFL.txt +93 -0
- package/fonts/tomorrow/tomorrow-400-italic.ttf +0 -0
- package/fonts/tomorrow/tomorrow-400.ttf +0 -0
- package/fonts/tomorrow/tomorrow-500-italic.ttf +0 -0
- package/fonts/tomorrow/tomorrow-500.ttf +0 -0
- package/fonts/tomorrow/tomorrow-700-italic.ttf +0 -0
- package/fonts/tomorrow/tomorrow-700.ttf +0 -0
- package/images/brick-bg-01.png +0 -0
- package/package.json +78 -0
- package/plugin.js +2131 -0
- package/snippets/alert.md +2 -0
- package/snippets/block.md +5 -0
- package/snippets/callout.md +5 -0
- package/snippets/card.md +11 -0
- package/snippets/chapter-start-page.md +11 -0
- package/snippets/credits-page.md +13 -0
- package/snippets/definition.md +7 -0
- package/snippets/dm-note.md +5 -0
- package/snippets/gear.md +9 -0
- package/snippets/learning-path.md +10 -0
- package/snippets/lede.md +5 -0
- package/snippets/outcome.md +8 -0
- package/snippets/procedure.md +7 -0
- package/snippets/sidebar.md +7 -0
- package/snippets/skill.md +9 -0
- package/snippets/specialty-art.md +5 -0
- package/snippets/specialty-card.md +5 -0
- package/snippets/specialty.md +11 -0
- package/snippets/toc-page.md +15 -0
- package/styles/components/callouts.css +227 -0
- package/styles/components/cards.css +487 -0
- package/styles/components/chrome.css +483 -0
- package/styles/components/data.css +1026 -0
- package/styles/components/images.css +215 -0
- package/styles/components/section.css +1074 -0
- package/styles/components/specialty-identity.css +315 -0
- package/styles/components/specialty.css +273 -0
- package/styles/dc-component-defaults.css +214 -0
- package/styles/dc-core.css +268 -0
- package/styles/dc-fonts.css +107 -0
- package/styles/dc-identity.css +66 -0
- package/styles/dc-native.css +330 -0
- package/styles/dc-palette.css +198 -0
- package/styles/page-rules.css +207 -0
- package/styles/page-templates.css +636 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to gp-dimm-city are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/) and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/). The release workflow refuses to
|
|
6
|
+
cut a version that has no `## [X.Y.Z]` heading below.
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.0.0] - unreleased
|
|
11
|
+
|
|
12
|
+
First release as a standalone package. Extracted from the private
|
|
13
|
+
`dimm-city/dc-op-manual` repository, where it lived at `dc-design-guide/` as a
|
|
14
|
+
folder extension that the Dimm City books referenced by relative path. The
|
|
15
|
+
design guide *book* stays in that repository and now consumes this package
|
|
16
|
+
exactly like any other book.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **Installable from npm.** `gutterpress ext add gp-dimm-city` vendors the
|
|
21
|
+
package under a book's `plugins/npm/` and pins the exact version — no Node
|
|
22
|
+
packages in the book repo. `"type": "module"` in `package.json`, which the
|
|
23
|
+
old folder package lacked: Gutterpress's npm loader parses a `.js` entry as
|
|
24
|
+
CommonJS without it and refuses the plugin.
|
|
25
|
+
- **The brick-wall tile ships.** `dc-native.css` paints the page background
|
|
26
|
+
from `images/brick-bg-01.png`; the old package's `files` list never included
|
|
27
|
+
it, so a published copy would have failed every build with a missing asset.
|
|
28
|
+
`test/package.test.js` now follows every `url()` in every stylesheet into
|
|
29
|
+
the tarball.
|
|
30
|
+
- **Font licences.** Titillium Web and Tomorrow ship with the OFL 1.1 text
|
|
31
|
+
from their upstream repositories beside the files; Lixdu ships with its own
|
|
32
|
+
licence file. Fonts are grouped per family under `fonts/` with readable
|
|
33
|
+
names instead of export UUIDs (byte-identical; fonts inline at build time,
|
|
34
|
+
so the rename cannot change a page).
|
|
35
|
+
- **Snippets** for the desktop app's snippet picker: every macro an author
|
|
36
|
+
reaches for (`@skill`, `@learning-path`, `@specialty`, `@callout`, `@card`,
|
|
37
|
+
`@gear`, `@block`, `@outcome`, alerts, …) and the three front-matter pages
|
|
38
|
+
every Dimm City book writes (contents, credits, chapter start).
|
|
39
|
+
- **Tests** (`bun test`): a fixture snapshot of every macro's output, the
|
|
40
|
+
behavioural tests carried over from the book repo, and package checks —
|
|
41
|
+
every declared path and every stylesheet asset in the tarball, one licence
|
|
42
|
+
per font directory, the cascade contract below, and no runtime imports.
|
|
43
|
+
- **CI and release workflows**: tests on every push and PR; a manual release
|
|
44
|
+
workflow that bumps, tags, publishes to npm with provenance via OIDC
|
|
45
|
+
trusted publishing, and cuts the GitHub release.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- **`css/` is `styles/`**, matching Gutterpress's extension template. Same
|
|
50
|
+
sixteen sheets in the same cascade order; `tokensFile` now points at
|
|
51
|
+
`styles/dc-palette.css` (the brand palette) rather than the specialty
|
|
52
|
+
identity tokens.
|
|
53
|
+
- **The layer statement is `@layer dc.tokens, dc.base, dc.components,
|
|
54
|
+
dc.templates, dc.pages, book;`** — `dc.guide` is gone. A book's own sheets
|
|
55
|
+
belong in `@layer book`, the last layer, which outranks every `dc.*` layer;
|
|
56
|
+
a book that must beat the unlayered `dc-native.css` lists an unlayered sheet
|
|
57
|
+
after the extension. (`dc.guide` existed for the design guide's own
|
|
58
|
+
scaffolding; that book now uses `book` like everyone else.)
|
|
59
|
+
- **Front-matter chrome moved in from the books.** The contents-page rows,
|
|
60
|
+
credits role labels and prose, and chapter-start heading rules that lived
|
|
61
|
+
in the design guide's sheet (`dg-overrides.css`, layer `dc.guide`) and the
|
|
62
|
+
credits-page flex layout from the field guide's native sheet are now in
|
|
63
|
+
`page-templates.css` and `dc-native.css`: every Dimm City book writes these
|
|
64
|
+
pages. Values are carried as rendered. Two rules that only ever lost to
|
|
65
|
+
them by layer order were reconciled so nothing changes on the page: the
|
|
66
|
+
dead magenta TOC-divider rule (`page-templates.css`) is removed, and the
|
|
67
|
+
credits role-label colour now says `--ink`, which is what it always
|
|
68
|
+
rendered.
|
|
69
|
+
- **Specialty break control moved in from the field guide**: `.dc-specialty
|
|
70
|
+
.dc-learning-path { break-before: always }` and the `.dc-allow-split`
|
|
71
|
+
escape, in `page-templates.css`.
|
|
72
|
+
- Plugin `metadata` no longer carries its own `version` (17.3.0 in the book
|
|
73
|
+
repo); `package.json` is the only version. Its `name` is now "Dimm City".
|
|
74
|
+
- Stale comments across the stylesheets and plugin that named files from the
|
|
75
|
+
book repo (`dc-components.css`, `native-furniture.css`, `dc-tokens.css`,
|
|
76
|
+
`engineStyles`, `fg-overrides.css`, `dg-overrides.css`, `index.css`) now
|
|
77
|
+
name the package's own files or "the book's own sheet".
|
|
78
|
+
|
|
79
|
+
### Removed
|
|
80
|
+
|
|
81
|
+
- `index.css` (an `@import` entry point that reached into the field guide's
|
|
82
|
+
folder) and `dg-overrides.css` (design-guide-only scaffolding, now that
|
|
83
|
+
book's own sheet) are not part of the package.
|
|
84
|
+
- The catalog entries `palette-swatch` and `table`, and the `ignore:` block —
|
|
85
|
+
all design-guide-only.
|
|
86
|
+
- The `dimm-city-components` package name.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dimm City
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
This licence covers the plugin code, stylesheets, catalog and documentation in
|
|
26
|
+
this package. It does not cover:
|
|
27
|
+
|
|
28
|
+
- The fonts under `fonts/`, which carry their own licences beside the font
|
|
29
|
+
files (`fonts/titillium-web/OFL.txt`, `fonts/tomorrow/OFL.txt`,
|
|
30
|
+
`fonts/lixdu/LICENSE.txt`).
|
|
31
|
+
- The Dimm City name, logo, artwork and game text, which remain the property
|
|
32
|
+
of their owners and are not licensed by this package.
|
package/README.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# gp-dimm-city
|
|
2
|
+
|
|
3
|
+
The Dimm City design system for [Gutterpress](https://github.com/dimm-city/gutterpress):
|
|
4
|
+
the markdown-it macros, print stylesheets, design tokens, fonts and page
|
|
5
|
+
templates that the Dimm City TTRPG books are set in. Install it into a book
|
|
6
|
+
and write `@skill`, `@specialty`, `@learning-path`, `@callout` and the rest;
|
|
7
|
+
the package renders them and prints them.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
**In the Gutterpress app:** open the book, then Project settings → Features →
|
|
12
|
+
*Find more on npm* (search "dimm city") or *Install from npm* and enter
|
|
13
|
+
`gp-dimm-city`. Confirm the install prompt. The package appears under Features
|
|
14
|
+
with a "+ look" badge, and its sheets and snippets are live in the preview.
|
|
15
|
+
|
|
16
|
+
**From the command line**, in the folder that holds the book:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
gutterpress ext add gp-dimm-city my-book
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Either way Gutterpress downloads the package from npm, verifies the registry
|
|
23
|
+
hash, writes a copy under `my-book/plugins/npm/`, and pins the exact version
|
|
24
|
+
in the manifest:
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
extensions:
|
|
28
|
+
- gp-dimm-city@1.0.0
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Commit `plugins/npm/`.** Builds never fetch from the registry; the vendored
|
|
32
|
+
copy is what builds your book, on every machine and in CI. If your repo
|
|
33
|
+
ignores `node_modules`, add `!**/plugins/npm/**` as the last line of
|
|
34
|
+
`.gitignore` — the vendored tree has a `node_modules` folder inside it — and
|
|
35
|
+
`**/plugins/npm/** -text` to `.gitattributes`, because the copy is verified
|
|
36
|
+
byte for byte on every build.
|
|
37
|
+
|
|
38
|
+
`gutterpress ext list my-book` shows `gp-dimm-city@1.0.0 [npm; markdown, styles, components, snippets]`.
|
|
39
|
+
|
|
40
|
+
## What you get
|
|
41
|
+
|
|
42
|
+
- **Macros**, from `plugin.js`: `@specialty` / `@specialty-intro` /
|
|
43
|
+
`@specialty-art` / `@specialty-card`, `@learning-path`, `@skill` (with
|
|
44
|
+
`@continue` for a card that spans a page break), `@outcome`, `@callout`,
|
|
45
|
+
`@dm-note`, `@sidebar`, `@sidebar-box`, `@block`, `@card`, `@gear`,
|
|
46
|
+
`@definition`, `@procedure`, `@lede`, `@toc`, `@tape`, `@glossary`, GFM
|
|
47
|
+
alerts (`> [!NOTE]`, `[!WARNING]`, `[!DM]`, `[!VIBE]`, `[!ORIGIN]`,
|
|
48
|
+
`[!VISIT]`, `[!GEAR]`, `[!FLAVOR]`, `[!PULLQUOTE]`), and the automatic
|
|
49
|
+
`ROLL THE DIE!` chip. `docs/macros.md` is the inventory;
|
|
50
|
+
`docs/components-and-palette-reference.md` maps each to the classes it
|
|
51
|
+
emits.
|
|
52
|
+
- **Sixteen stylesheets** under `styles/`, listed in `package.json` in
|
|
53
|
+
cascade order: fonts and the layer statement, the palette and identity
|
|
54
|
+
tokens, the element baseline, eight component sheets, page templates,
|
|
55
|
+
paged-media rules, and `dc-native.css` — the engine-specific page chrome
|
|
56
|
+
(brick-wall background, folios, chapter chips) that must stay last.
|
|
57
|
+
- **Fonts**: Titillium Web, Tomorrow and Lixdu, embedded into the PDF at
|
|
58
|
+
build time.
|
|
59
|
+
- **Page templates** every Dimm City book writes: `.page-toc`,
|
|
60
|
+
`.page-credits .dc-credits`, `.page-chapter-start .dc-chapter-start`,
|
|
61
|
+
`.dc-full-page`, plus the folio/chapter-chip chrome driven by
|
|
62
|
+
`@chapter #id ch="N"`.
|
|
63
|
+
- **Snippets** for the app's snippet picker (`snippets/`): one per macro and
|
|
64
|
+
one per front-matter page, with placeholders for the parts you fill in.
|
|
65
|
+
- **`components.yaml`**: the catalog of every component — what you write,
|
|
66
|
+
what lands in the HTML, which tokens are public, which sheet owns it.
|
|
67
|
+
|
|
68
|
+
## Quick start
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
gutterpress new "My Book" --preset dtrpg
|
|
72
|
+
gutterpress ext remove ./extensions/clean-book my-book && rm -r my-book/extensions
|
|
73
|
+
gutterpress ext add gp-dimm-city my-book
|
|
74
|
+
gutterpress preview my-book
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The second line matters. `gutterpress new` gives every book a starter look
|
|
78
|
+
(`./extensions/clean-book`), and a look's CSS is unlayered, so it beats this
|
|
79
|
+
package's layered rules on anything the look styles — plain prose comes out in
|
|
80
|
+
the starter's serif instead of Titillium Web. This package *is* the look;
|
|
81
|
+
remove the starter before adding it. (In the app: Project settings → Look →
|
|
82
|
+
remove *Clean book*.)
|
|
83
|
+
|
|
84
|
+
Then insert the *Toc Page*, *Credits Page* and *Chapter Start Page* snippets
|
|
85
|
+
to lay down the front matter, and reach for *Skill*, *Learning Path* and
|
|
86
|
+
*Specialty* as you write. `page-rules.css` sets a Letter page with bleed; keep
|
|
87
|
+
the manifest's `page:` in step with it.
|
|
88
|
+
|
|
89
|
+
## Your own CSS: the layer convention
|
|
90
|
+
|
|
91
|
+
List your sheets under `styles:` in the manifest. Extension styles always load
|
|
92
|
+
first, so yours come after. Wrap them in the `book` layer:
|
|
93
|
+
|
|
94
|
+
```css
|
|
95
|
+
@layer book {
|
|
96
|
+
#chapter-03 { --dc-section-accent: var(--hud-magenta); }
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The package declares `@layer dc.tokens, dc.base, dc.components, dc.templates,
|
|
101
|
+
dc.pages, book;` in its first sheet. `book` is last, so anything you put there
|
|
102
|
+
outranks every `dc.*` rule without a specificity contest. Two things to know:
|
|
103
|
+
|
|
104
|
+
- `dc-native.css` is deliberately **unlayered** so it beats every layered rule
|
|
105
|
+
— a book that must override it lists an **unlayered** sheet after the
|
|
106
|
+
extension; the last unlayered sheet wins.
|
|
107
|
+
- Do not invent layer names. A layer the package's statement does not name is
|
|
108
|
+
created where it is first used, which puts it *after* `book` and silently
|
|
109
|
+
above your own overrides.
|
|
110
|
+
|
|
111
|
+
Never write bare `.dc-*` rules in a book to change a component; that fights
|
|
112
|
+
the package on every update. Reset the component's public tokens on a context
|
|
113
|
+
selector instead:
|
|
114
|
+
|
|
115
|
+
```css
|
|
116
|
+
@layer book {
|
|
117
|
+
.chapter-05 .dc-alert { --dc-alert-accent: var(--hud-blue); }
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The tokens each component exposes are listed under `tokens:` in
|
|
122
|
+
`components.yaml`, and `styles/dc-component-defaults.css` is where their
|
|
123
|
+
defaults live.
|
|
124
|
+
|
|
125
|
+
## Versioning
|
|
126
|
+
|
|
127
|
+
Books pin an exact version, so nothing changes under you. To move a book to a
|
|
128
|
+
new release:
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
gutterpress ext add gp-dimm-city@1.1.0 my-book
|
|
132
|
+
git rm -r my-book/plugins/npm/gp-dimm-city/1.0.0 # ext add leaves the old copy in place
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Rebuild and compare before you commit — the Dimm City books gate every bump
|
|
136
|
+
with a render-parity run (text runs, image placement, and a pixel comparison
|
|
137
|
+
of every page). Public API for semver purposes: the macro vocabulary, the
|
|
138
|
+
classes and tokens marked `live` in `components.yaml`, the page templates, and
|
|
139
|
+
the layer names. `CHANGELOG.md` lists what each release changes.
|
|
140
|
+
|
|
141
|
+
## Licences
|
|
142
|
+
|
|
143
|
+
Code, stylesheets, catalog and docs: [MIT](LICENSE). Fonts carry their own
|
|
144
|
+
licences beside the files — `fonts/titillium-web/OFL.txt`,
|
|
145
|
+
`fonts/tomorrow/OFL.txt`, `fonts/lixdu/LICENSE.txt`. The Dimm City name, logo,
|
|
146
|
+
artwork and game text are not licensed by this package.
|
|
147
|
+
|
|
148
|
+
## Development
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
bun install
|
|
152
|
+
bun test # snapshot, behaviour, package and convention tests
|
|
153
|
+
bun run test:update-snapshot # only when the plugin's output is meant to change
|
|
154
|
+
bun run pack:check # what npm would publish
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
`plugin.js` imports nothing at runtime — `gutterpress/render` is a
|
|
158
|
+
devDependency used only by the tests to run the plugin inside core's markdown
|
|
159
|
+
pipeline. Releases are cut from the *Release* workflow (version in, npm and
|
|
160
|
+
GitHub release out); it refuses a version with no `## [X.Y.Z]` heading in
|
|
161
|
+
`CHANGELOG.md`.
|
|
162
|
+
|
|
163
|
+
The design guide that documents this system in depth is a book in the
|
|
164
|
+
`dimm-city/dc-op-manual` repository. Issues about the package — a macro, a
|
|
165
|
+
sheet, a token, a font — belong here.
|