gp-dimm-city 1.0.0 → 1.0.1

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 CHANGED
@@ -7,7 +7,32 @@ cut a version that has no `## [X.Y.Z]` heading below.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [1.0.0] - unreleased
10
+ ## [1.0.1] - 2026-09-25
11
+
12
+ ### Changed
13
+
14
+ - **The layer statement drops `book`**: `dc-fonts.css` now declares `@layer
15
+ dc.tokens, dc.base, dc.components, dc.templates, dc.pages;`. Gutterpress
16
+ 0.11.0 wraps every extension's CSS in its own cascade layer (`@layer
17
+ ext.gp-dimm-city` for this package), so the package's own `dc.*` layers are
18
+ now sublayers nested inside that wrapper rather than top-level layers, and
19
+ a `book` sublayer declared here would only be reachable from inside this
20
+ package — a consuming book's separate `styles:` sheet can't nest into it.
21
+ Nothing in this package or any known consuming book ever put rules inside
22
+ `@layer book`, so there is no rendered change.
23
+
24
+ ### Docs
25
+
26
+ - **README quick start now requires Gutterpress 0.11.0+** and drops the
27
+ `gutterpress ext remove ./extensions/clean-book` workaround: Gutterpress
28
+ now layers every extension's CSS itself (in `extensions:` list order), so
29
+ this package's rules can no longer be jumped by an unlayered starter look,
30
+ and `gutterpress new` no longer scaffolds one anyway. The "Your own CSS"
31
+ section no longer recommends wrapping book overrides in `@layer book` —
32
+ a book's own `styles:` sheets are unlayered by the engine and already beat
33
+ this whole package at any specificity.
34
+
35
+ ## [1.0.0] - 2026-09-25
11
36
 
12
37
  First release as a standalone package. Extracted from the private
13
38
  `dimm-city/dc-op-manual` repository, where it lived at `dc-design-guide/` as a
package/README.md CHANGED
@@ -67,20 +67,16 @@ byte for byte on every build.
67
67
 
68
68
  ## Quick start
69
69
 
70
+ Requires Gutterpress **0.11.0** or later — it wraps every extension's CSS in
71
+ its own cascade layer, so a book no longer needs a starter look removed
72
+ before this package can win the cascade.
73
+
70
74
  ```sh
71
75
  gutterpress new "My Book" --preset dtrpg
72
- gutterpress ext remove ./extensions/clean-book my-book && rm -r my-book/extensions
73
76
  gutterpress ext add gp-dimm-city my-book
74
77
  gutterpress preview my-book
75
78
  ```
76
79
 
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
80
  Then insert the *Toc Page*, *Credits Page* and *Chapter Start Page* snippets
85
81
  to lay down the front matter, and reach for *Skill*, *Learning Path* and
86
82
  *Specialty* as you write. `page-rules.css` sets a Letter page with bleed; keep
@@ -88,34 +84,28 @@ the manifest's `page:` in step with it.
88
84
 
89
85
  ## Your own CSS: the layer convention
90
86
 
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:
87
+ List your sheets under `styles:` in the manifest. Gutterpress (0.11.0+) wraps
88
+ this whole package in its own cascade layer, `@layer ext.gp-dimm-city`, and
89
+ keeps the book's own `styles:` unlayered — so anything you write there beats
90
+ every rule in this package at any specificity, with no layer of your own to
91
+ declare:
93
92
 
94
93
  ```css
95
- @layer book {
96
- #chapter-03 { --dc-section-accent: var(--hud-magenta); }
97
- }
94
+ #chapter-03 { --dc-section-accent: var(--hud-magenta); }
98
95
  ```
99
96
 
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.
97
+ The package's own sheets are layered internally (`@layer dc.tokens, dc.base,
98
+ dc.components, dc.templates, dc.pages`, nested inside `ext.gp-dimm-city`), and
99
+ `dc-native.css` stays last and unlayered within that internal stack — that's
100
+ a package-internal ordering concern, not something your book needs to work
101
+ around.
110
102
 
111
103
  Never write bare `.dc-*` rules in a book to change a component; that fights
112
104
  the package on every update. Reset the component's public tokens on a context
113
105
  selector instead:
114
106
 
115
107
  ```css
116
- @layer book {
117
- .chapter-05 .dc-alert { --dc-alert-accent: var(--hud-blue); }
118
- }
108
+ .chapter-05 .dc-alert { --dc-alert-accent: var(--hud-blue); }
119
109
  ```
120
110
 
121
111
  The tokens each component exposes are listed under `tokens:` in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gp-dimm-city",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Dimm City design system for Gutterpress: the markdown-it macros (@skill, @specialty, @learning-path, @callout, …), print stylesheets, design tokens, fonts and page templates the Dimm City TTRPG books are set in.",
5
5
  "type": "module",
6
6
  "main": "plugin.js",
@@ -25,10 +25,10 @@
25
25
  - :root token definitions (→ dc-component-defaults.css)
26
26
  - @media screen rules (print-only project)
27
27
  - Element selectors scoped to page/chapter context classes
28
- (→ the book's own sheet (`@layer book`))
28
+ (→ the book's own sheet (unlayered))
29
29
 
30
30
  CORE CONSTRAINT — COMPONENT STYLE ISOLATION:
31
- If a bare .dc-* rule needs different values in the book's own sheet (`@layer book`), the
31
+ If a bare .dc-* rule needs different values in the book's own sheet (unlayered), the
32
32
  components/*.css value is WRONG — fix it here. The override files own
33
33
  layout context only. Never split a component's appearance across files.
34
34
 
@@ -75,7 +75,7 @@
75
75
  `var(--x, fallback)`. A token declared at :root needs no fallback, and
76
76
  an inline fallback that duplicates the :root value is dead weight that
77
77
  invites the two to drift (found and corrected during dc#34).
78
- - Variants and contexts set tokens on ANCESTORS (the book's own sheet (`@layer book`)
78
+ - Variants and contexts set tokens on ANCESTORS (the book's own sheet (unlayered)
79
79
  chapter/page scopes) or on VARIANT CLASSES on the same element
80
80
  (`.dc-ap.free`, `.dc-sidebar.inset`, `.dc-specialty.<name> .dc-X`) —
81
81
  never by re-declaring the token on the base component selector itself.
@@ -92,7 +92,7 @@
92
92
 
93
93
  /* ── Base shell — player-facing: pale cyan HUD panel, blue border ─────────── */
94
94
  /* Token defaults for .dc-alert are declared in :root in dc-component-defaults.css.
95
- Override at chapter-id scope in the book's own sheet (`@layer book`), or in variant rules below. */
95
+ Override at chapter-id scope in the book's own sheet (unlayered), or in variant rules below. */
96
96
  .dc-alert {
97
97
  background: var(--dc-alert-bg);
98
98
  border-left: var(--dc-alert-border-width) solid var(--dc-alert-border);
@@ -48,7 +48,7 @@
48
48
  6px. The old margin-bottom was exactly 6px, so it was entirely consumed
49
49
  and consecutive cards rendered touching (screenshot-confirmed on the
50
50
  Augmerc BODYCOVER/BLITZ seam). Same class of fix as .fg-art-portrait's
51
- margin-bottom in the book's own sheet (`@layer book`). */
51
+ margin-bottom in the book's own sheet (unlayered). */
52
52
  margin-bottom: calc(var(--dc-card-gap) + 6px);
53
53
  max-width: 100%;
54
54
  /* 4-way ink outline (2px on each side) + HARD offset poster shadow. The
@@ -99,7 +99,7 @@ h1.dc-chevron {
99
99
  line-height: 1.2;
100
100
  }
101
101
 
102
- /* Front-matter chevron font-size overrides moved to the book's own sheet (`@layer book`) per A1
102
+ /* Front-matter chevron font-size overrides moved to the book's own sheet (unlayered) per A1
103
103
  layer-ownership (page-context rules belong in the guide-specific override
104
104
  file, not the portable component library). Three-judge gate iteration 3. */
105
105
 
@@ -672,7 +672,7 @@ h3 + .section {
672
672
 
673
673
  To tune the walkthrough's accent or substrate, override the existing
674
674
  --dc-section-accent / --dc-section-bg custom properties at the chapter
675
- id scope in the book's own sheet (`@layer book`) — do NOT add bespoke rules here unless an
675
+ id scope in the book's own sheet (unlayered) — do NOT add bespoke rules here unless an
676
676
  observed problem requires it.
677
677
 
678
678
  OBSERVED PROBLEM (2026-05-25): When the walkthrough's first card uses
@@ -865,7 +865,7 @@ h3 + .section {
865
865
 
866
866
 
867
867
 
868
- /* Per-book variant assignment lives in the book's own sheet (`@layer book`) using natural
868
+ /* Per-book variant assignment lives in the book's own sheet (unlayered) using natural
869
869
  selector chains (chapter id → page template class → section component
870
870
  class) that set component CSS custom properties. No utility-variant
871
871
  classes here — that would force authors to re-type variant intent. */
@@ -1036,7 +1036,7 @@ h3 + .section {
1036
1036
  declared in :root in dc-component-defaults.css — same values as before this moved
1037
1037
  (the 3in art width: user feedback said the previous 1.85in "Lil Thump
1038
1038
  placeholder image is too small... should take up more of the left side
1039
- of the page"). Per-page/per-chapter variants override via the book's own sheet (`@layer book`)
1039
+ of the page"). Per-page/per-chapter variants override via the book's own sheet (unlayered)
1040
1040
  context selectors, e.g. `.page....chapter-01 .section.dc-fiction-excerpt`. */
1041
1041
  .section.dc-fiction-excerpt {
1042
1042
  background: var(--dc-fiction-bg);
@@ -2,7 +2,8 @@
2
2
 
3
3
  :root { /* ── Section Component Public Tokens ────────────────────────────────────
4
4
  Default theming for .section / @section macros. Chapter-scoped overrides
5
- live in the book's own sheet (`@layer book`) and win via the parent-context cascade —
5
+ live in the book's own sheet (unlayered — it wins over this whole package
6
+ regardless of specificity) and win via the parent-context cascade —
6
7
  typically by applying a .dc-accent-X utility on @chapter / @section
7
8
  (see components/*.css "ACCENT IDENTITY UTILITIES" section). */
8
9
  --dc-section-bg: var(--paper-cream);
@@ -12,9 +13,9 @@
12
13
  Override surface for per-chapter and per-project theming. These are the
13
14
  defaults that were previously declared inside each component class rule.
14
15
  Moving them to :root makes them visible to the theming system and lets
15
- the book's own sheet (`@layer book`) override them at chapter-id scope instead of having to
16
+ the book's own sheet override them at chapter-id scope instead of having to
16
17
  write a full component selector chain.
17
- Set them here; override at chapter id scope in the book's own sheet (`@layer book`).
18
+ Set them here; override at chapter id scope in the book's own sheet.
18
19
  ──────────────────────────────────────────────────────────────────────── */
19
20
 
20
21
  /* .dc-alert public API */
@@ -15,29 +15,32 @@
15
15
  - .page.* layout or column rules (→ page-templates.css)
16
16
  - .dc-* component/utility styles (→ components/*.css / page-templates.css)
17
17
  - Design tokens (→ dc-palette.css, dc-identity.css, dc-component-defaults.css)
18
- - Anything a single book needs (→ that book's own sheet, `@layer book`)
18
+ - Anything a single book needs (→ that book's own sheet, unlayered — no
19
+ `@layer` needed)
19
20
  - @media screen rules (print-only project)
20
21
 
21
22
  AGENT RULE: "Is this a token or a font?" — if NO, use another file.
22
23
 
23
24
  ──────────────────────────────────────────────────────────────────────── */
24
25
 
25
- /* Layer order for the whole DC stack, declared here because this is the
26
- first sheet the cascade sees — so layer order stops depending on the
27
- manifest's file order. `dc-fonts.css` itself is deliberately NOT wrapped
28
- in a layer: @font-face inside a layer is legal but pointless (font-family
29
- lookup is not a cascade contest). `dc-native.css`, the last sheet in this
30
- package, is ALSO deliberately unlayered — not because it is special, but
31
- because it is LAST, and anything that must beat unlayered author CSS
32
- cannot be layered (see docs/css-architecture.md).
26
+ /* Sublayer order for this package's OWN stack, declared here because this is
27
+ the first sheet the cascade sees — so layer order stops depending on the
28
+ manifest's file order. Gutterpress ≥0.11.0 wraps every extension's CSS in
29
+ `@layer ext.<name>` (this package is `ext.gp-dimm-city`), so this
30
+ statement declares sublayers nested inside that wrapper, not top-level
31
+ layers.
33
32
 
34
- `book` is the layer for a consuming book's own sheets: declared last here,
35
- it outranks every dc.* layer, so a book wins any cross-layer tie without
36
- fighting specificity. A book that must beat dc-native.css lists an
37
- UNLAYERED sheet after it in its manifest instead. Do not invent further
38
- layers in a book — a layer this statement does not name sorts after
39
- `book`, silently above your own overrides. */
40
- @layer dc.tokens, dc.base, dc.components, dc.templates, dc.pages, book;
33
+ `dc-fonts.css` itself is deliberately NOT wrapped in a layer: @font-face
34
+ inside a layer is legal but pointless (font-family lookup is not a
35
+ cascade contest). `dc-native.css`, the last sheet in this package, is
36
+ ALSO deliberately unlayered — not because it is special, but because it
37
+ is LAST, and anything that must beat the other dc.* sublayers cannot
38
+ itself be layered. That ordering is internal to this package only: a
39
+ consuming book's own `styles:` sheets stay unlayered by the engine and
40
+ beat this whole `ext.gp-dimm-city` stack — dc-native.css included —
41
+ automatically, at any specificity, so a book needs no layer of its own to
42
+ win (see docs/css-architecture.md). */
43
+ @layer dc.tokens, dc.base, dc.components, dc.templates, dc.pages;
41
44
 
42
45
  /* ── WEBFONTS (local) ─────────────────────────────────────────────────────── */
43
46
  @font-face {
@@ -2,9 +2,13 @@
2
2
  DC-NATIVE.CSS — engine-specific page chrome
3
3
  =============================================================================
4
4
  The LAST entry in package.json `gutterpress.styles`, and deliberately
5
- unlayered, so it beats every layered sheet in this package and in the
6
- book. A book's own unlayered sheet listed after the extension still wins
7
- over it — that is the one hook a book has above this file.
5
+ unlayered *within this package's own layer stack* — so it beats every
6
+ `dc.*` sublayer in this package, which is why it must stay last in the
7
+ array. Gutterpress ≥0.11.0 wraps the whole package in a layer of its own,
8
+ `ext.gp-dimm-city`, so from outside the package that unlayered status
9
+ doesn't matter: the book's own `styles:` sheets stay unlayered by the
10
+ engine and beat this whole file automatically, at any specificity, with
11
+ no unlayered-sheet trick required on the book's side.
8
12
 
9
13
  Mechanics, each measured against Chromium 151 (gutterpress ENGINE.md §5/§8):
10
14
  - ONE `@page { background }` rule paints the brick wall across the whole
@@ -317,7 +317,7 @@
317
317
  inside the composite.
318
318
 
319
319
  This block is the SINGLE location where TOC and Credits styling lives —
320
- do not split it across the book's own sheet (`@layer book`). */
320
+ do not split it across the book's own sheet. */
321
321
 
322
322
  /* Identity tokens for the spread. --dc-intro-accent / --dc-intro-bg feed
323
323
  the .dc-intro component's gradient via its own var() fallback chain. */