ghostcn 1.4.0 → 1.5.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 +16 -425
- package/dist/commands/create.js +6 -6
- package/dist/commands/init.js +5 -2
- package/dist/index.js +2 -1
- package/dist/registry/components/alert.json +1 -1
- package/dist/registry/components/archive-header.json +1 -1
- package/dist/registry/components/author-card.json +1 -1
- package/dist/registry/components/author-list.json +1 -1
- package/dist/registry/components/badge.json +1 -1
- package/dist/registry/components/button.json +1 -1
- package/dist/registry/components/card.json +1 -1
- package/dist/registry/components/featured-posts.json +2 -2
- package/dist/registry/components/input.json +1 -1
- package/dist/registry/components/member-cta.json +1 -1
- package/dist/registry/components/newsletter-form.json +1 -1
- package/dist/registry/components/pagination.json +1 -1
- package/dist/registry/components/post-card.json +1 -1
- package/dist/registry/components/post-grid.json +1 -1
- package/dist/registry/components/post-header.json +1 -1
- package/dist/registry/components/post-navigation.json +1 -1
- package/dist/registry/components/pricing-table.json +2 -2
- package/dist/registry/components/related-posts.json +1 -1
- package/dist/registry/components/site-footer.json +1 -1
- package/dist/registry/components/site-header.json +1 -1
- package/dist/registry/components/table-of-contents.json +3 -3
- package/dist/registry/components/tag-grid.json +1 -1
- package/dist/registry/components/tag-list.json +1 -1
- package/dist/utils/design-defaults.json +17 -0
- package/dist/utils/preview-renderer.js +11 -3
- package/dist/utils/theme-scaffold.js +7 -8
- package/dist/utils/theme.d.ts +3 -3
- package/dist/utils/theme.js +69 -17
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,443 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Ghostcn
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
<strong>The <code>shadcn/ui</code> for Ghost CMS themes.</strong><br>
|
|
5
|
-
Beautiful, accessible, copy-pasteable Handlebars partials and stylesheets for modern Ghost theme development.
|
|
6
|
-
</p>
|
|
3
|
+
Copy Ghost-native Handlebars components and styles into a theme you own. Use Tailwind CSS or vanilla CSS.
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
<a href="https://www.npmjs.com/package/ghostcn"><img src="https://img.shields.io/npm/v/ghostcn?color=6366f1&style=flat-square" alt="npm version" /></a>
|
|
10
|
-
<a href="https://www.npmjs.com/package/ghostcn"><img src="https://img.shields.io/npm/dm/ghostcn?color=3b82f6&style=flat-square" alt="npm downloads" /></a>
|
|
11
|
-
<a href="https://ghost.org"><img src="https://img.shields.io/badge/Ghost-%3E%3D5.0.0-15171a?style=flat-square" alt="Ghost Version" /></a>
|
|
12
|
-
<a href="https://github.com/Geekbits-Org/ghost-ui/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License" /></a>
|
|
13
|
-
</p>
|
|
5
|
+
**[Documentation](https://ghostcn.geekbits.dev)** · [Component reference](https://ghostcn.geekbits.dev/docs/components) · [Changelog](https://ghostcn.geekbits.dev/changelog)
|
|
14
6
|
|
|
15
|
-
|
|
7
|
+
## Start a new theme
|
|
16
8
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
**ghostcn** brings the modern component distribution model to **Ghost CMS**.
|
|
20
|
-
|
|
21
|
-
Instead of installing cumbersome plugins or monolithic npm modules that lock down your markup, ghostcn injects clean, production-ready **Handlebars (`.hbs`) partials** and **CSS** directly into your theme repository.
|
|
22
|
-
|
|
23
|
-
You own the code. You customize the classes. Zero vendor lock-in.
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Features
|
|
28
|
-
|
|
29
|
-
- 📦 **Theme-Native**: Directly installs raw Handlebars partials and CSS into your theme folders.
|
|
30
|
-
- ⚡ **Zero Latency**: Bundled offline registry ensures blazing fast installation even without internet.
|
|
31
|
-
- 🎯 **Interactive Multi-Select**: Run `npx ghostcn add` without arguments to select and batch-install multiple components interactively.
|
|
32
|
-
- 🎨 **Tailwind & Vanilla CSS**: Pre-styled with utility classes and full Vanilla CSS stylesheets with Ghost CSS custom properties.
|
|
33
|
-
- 🔑 **Ghost Members API**: Native support for Ghost attributes (`data-members-form="subscribe"`, Portal checkout triggers).
|
|
34
|
-
- 🛡️ **Theme validation**: Generated themes include offline diagnostics and official gscan validation. Validate your customized theme against your target Ghost version before shipping.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Available Components
|
|
39
|
-
|
|
40
|
-
| Component | Description | Files |
|
|
41
|
-
| :--- | :--- | :--- |
|
|
42
|
-
| **`newsletter-form`** | Native Ghost members subscription form with success/error states | `newsletter-form.hbs`, `newsletter-form.css` |
|
|
43
|
-
| **`pricing-table`** | Public Ghost tiers with live prices, currencies, benefits and tier-specific Portal checkout | `pricing-table.hbs`, `pricing-table.css` |
|
|
44
|
-
| **`author-card`** | Author bio box with avatar, biography, social links, and post counts | `author-card.hbs`, `author-card.css` |
|
|
45
|
-
| **`post-card`** | Post loop preview card with feature image, tags, excerpt, and reading time | `post-card.hbs`, `post-card.css` |
|
|
46
|
-
| **`site-header`** | Responsive navigation with search, mobile menu, sign-in, and subscribe actions | `site-header.hbs`, `site-header.css` |
|
|
47
|
-
| **`site-footer`** | Secondary navigation, publication information, social links, and attribution | `site-footer.hbs`, `site-footer.css` |
|
|
48
|
-
| **`featured-posts`** | Homepage hero grid backed by Ghost featured posts | `featured-posts.hbs`, `featured-posts.css` |
|
|
49
|
-
| **`pagination`** | Accessible replacement for Ghost’s native pagination partial | `partials/pagination.hbs`, `pagination.css` |
|
|
50
|
-
| **`post-header`** | Editorial post heading, author metadata, reading time, and responsive image | `post-header.hbs`, `post-header.css` |
|
|
51
|
-
| **`member-cta`** | Context-aware calls to action for visitors, free members, and paid members | `member-cta.hbs`, `member-cta.css` |
|
|
52
|
-
| **`related-posts`** | Related stories by primary tag, with an untagged fallback | `related-posts.hbs`, `related-posts.css` |
|
|
53
|
-
| **`post-navigation`** | Chronological previous/next story links | `post-navigation.hbs`, `post-navigation.css` |
|
|
54
|
-
| **`table-of-contents`** | Accessible article heading navigation with unique anchors | `table-of-contents.hbs`, `table-of-contents.css`, `table-of-contents.js` |
|
|
55
|
-
| **`tag-list`** | Public post tags, with internal tags hidden | `tag-list.hbs`, `tag-list.css` |
|
|
56
|
-
| **`button`** | Native button or link, with variants, sizes and disabled states | `button.hbs`, `button.css` |
|
|
57
|
-
| **`card`** | Content card accepting text or nested template blocks | `card.hbs`, `card.css` |
|
|
58
|
-
| **`badge`** | Non-interactive label with variants and sizes | `badge.hbs`, `badge.css` |
|
|
59
|
-
| **`input`** | Repeat-safe labeled native input and optional help text | `input.hbs`, `input.css` |
|
|
60
|
-
| **`alert`** | Accessible status message with optional urgent announcement | `alert.hbs`, `alert.css` |
|
|
61
|
-
| **`post-grid`** | Responsive current-post collection composed from post cards | `post-grid.hbs`, `post-grid.css` |
|
|
62
|
-
| **`author-list`** | Publication author collection composed from author cards | `author-list.hbs`, `author-list.css` |
|
|
63
|
-
| **`tag-grid`** | Public tag archive links composed from cards and buttons | `tag-grid.hbs`, `tag-grid.css` |
|
|
64
|
-
| **`archive-header`** | Shared author/tag archive heading with an optional badge/image | `archive-header.hbs`, `archive-header.css` |
|
|
65
|
-
|
|
66
|
-
The five primitives, four composed blocks, dependency installation, and local playground are **unreleased development features**. Use this checkout's built CLI to test them; updating an older npm release will not provide them.
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## Quick Start
|
|
71
|
-
|
|
72
|
-
### Create a complete Ghost theme
|
|
73
|
-
|
|
74
|
-
Start a new, production-ready theme with an interactive setup:
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
npx ghostcn create my-theme
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
The wizard configures Tailwind CSS or vanilla CSS, design tokens, color mode, package manager, optional components, and dependency installation. The generated theme includes Ghost templates for the home page, posts, pages, tags, and authors; responsive navigation; member flows; build scripts; and gscan validation.
|
|
81
|
-
|
|
82
|
-
Use recommended defaults without installing dependencies:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
npx ghostcn create my-theme -y --skip-install
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Tailwind themes include a complete Tailwind CLI build and watch pipeline. Vanilla themes include a zero-dependency CSS copy/watch pipeline. In both cases:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
9
|
+
```sh
|
|
10
|
+
npx ghostcn@latest create my-theme
|
|
91
11
|
cd my-theme
|
|
92
12
|
npm run dev
|
|
93
13
|
```
|
|
94
14
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
`npm run dev` watches CSS; it does **not** start Ghost. To preview, place the theme folder under a local Ghost installation's `content/themes`, restart Ghost from its installation directory, activate the theme in Ghost Admin → Settings → Design → Change theme, then visit your site's URL. Follow the [local Ghost setup guide](https://docs.ghost.org/install/local/) if you do not have an installation yet. Generated starters require Ghost 5.54.1+; use Node 22.13.1+ or Node 24 for gscan (Tailwind builds need Node 20+).
|
|
98
|
-
|
|
99
|
-
Build, validate and package for a remote site:
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
npm test
|
|
103
|
-
npm run validate
|
|
104
|
-
npm run zip
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
The ZIP is written to `dist/<theme-name>-<version>.zip`, with runtime templates and assets at its root. It excludes dependencies, scripts, lockfiles and repository metadata. Upload it in Ghost Admin's theme picker. Re-running replaces the generated ZIP.
|
|
108
|
-
|
|
109
|
-
For an existing theme, run `npx ghostcn doctor` to check configuration, linked assets, partials and Ghost hooks. After running **your theme's build**, `npx ghostcn pack` packages it without invoking or changing its build system. Doctor is an offline diagnostic, not a replacement for gscan or browser testing.
|
|
110
|
-
|
|
111
|
-
### Styling components
|
|
112
|
-
|
|
113
|
-
For a generated Tailwind theme, customize the markup with ordinary utilities:
|
|
114
|
-
|
|
115
|
-
```handlebars
|
|
116
|
-
<a class="ghcn-button bg-purple-600 hover:bg-purple-700 text-white" href="#/portal/signup" data-portal="signup">Subscribe</a>
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
No `!` modifier is required to override ghostcn defaults. Component styles and primitives use Tailwind's `components` layer; utilities take precedence, even if a component stylesheet loads later. Semantic colors (`bg-primary`, `text-muted-foreground`, `border-border`, `ring-ring`) and `rounded-ghostcn` are mapped by `assets/css/ghostcn-tailwind.css`. Ghost's explicit and automatic dark modes are supported.
|
|
120
|
-
|
|
121
|
-
For **existing Tailwind v4 themes**, import the generated `ghostcn-tailwind.css` into your Tailwind source and make sure the build scans `.hbs` files. For example, when using `assets/css/source.css`:
|
|
122
|
-
|
|
123
|
-
```css
|
|
124
|
-
@import "tailwindcss";
|
|
125
|
-
@import "./ghostcn-tailwind.css";
|
|
126
|
-
@source "../../**/*.hbs";
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
`init` and `add` do not replace an existing theme's build pipeline. Unlayered host CSS can still override layered styles; place such host rules in an appropriate lower layer or adjust your theme deliberately. Older Tailwind builds must configure their own semantic token mappings.
|
|
130
|
-
|
|
131
|
-
Vanilla themes ship standalone CSS: edit component files or put token and selector overrides in `assets/css/source.css`. The generated build stylesheet loads after ghostcn defaults. On an existing theme, link your override stylesheet after the managed ghostcn block.
|
|
132
|
-
|
|
133
|
-
Membership components respect disabled, invite-only and self-signup settings. Paid pricing is shown only when Ghost enables paid membership, using active public tiers configured in Ghost Admin—not sample amounts or invented benefits. The starter uses `partials/content-cta.hbs` for one custom paywall; adding `member-cta` below native `{{content}}` on an existing protected post can otherwise duplicate Ghost's paywall. Follow the starter pattern rather than rendering both.
|
|
134
|
-
|
|
135
|
-
### Updating an existing ghostcn theme
|
|
136
|
-
|
|
137
|
-
Your copied files are yours; an npm update does not silently rewrite them. Back up or commit your theme first, then review changes without modifying any files:
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
npx ghostcn@latest diff
|
|
141
|
-
npx ghostcn@latest diff pricing-table --latest
|
|
142
|
-
npx ghostcn@latest diff pricing-table --json
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
By default, `diff` uses the bundled registry (or your configured registry). `--latest` explicitly checks the remote registry's current branch, which may be ahead of npm; a failed request is reported, not silently replaced by an older bundled version. It compares the installed baseline, your current file, and the incoming version. Review upstream changes and conflicts, then manually merge what you want. New installs record content baselines in `.ghostcn/installed.json`; older files without a baseline are labeled **untracked**, not presumed safe to overwrite. Keep this file with your theme to retain three-way comparison history.
|
|
146
|
-
|
|
147
|
-
`diff` never installs, deletes, or merges files. `add -y` still deliberately overwrites component files. Initialization regenerates tokens, so preserve your chosen palette and paths. Existing Tailwind styles from older releases are unlayered and need the new token/component CSS for ordinary utility overrides.
|
|
148
|
-
|
|
149
|
-
### 1. Initialize your Ghost Theme
|
|
150
|
-
|
|
151
|
-
Run the `init` command from the root of any Ghost theme (must have `engines.ghost` in its `package.json`):
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
npx ghostcn init
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Or pass `-y` to use default paths non-interactively:
|
|
158
|
-
```bash
|
|
159
|
-
npx ghostcn init -y
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
This prompts you to choose your styling system (`tailwind` or `css`), base color palette (`zinc`, `slate`, `stone`, `gray`, `neutral`), accent color (`ghost` native dynamic accent, `indigo`, `violet`, etc.), and border radius (`none`, `sm`, `md`, `lg`, `full`).
|
|
163
|
-
|
|
164
|
-
It generates `assets/css/ghostcn.css` with semantic design tokens, creates `components.json`, and adds a managed stylesheet block to `default.hbs`:
|
|
165
|
-
```json
|
|
166
|
-
{
|
|
167
|
-
"$schema": "https://ghostcn.com/schema.json",
|
|
168
|
-
"style": "tailwind",
|
|
169
|
-
"theme": {
|
|
170
|
-
"baseColor": "zinc",
|
|
171
|
-
"accentColor": "ghost",
|
|
172
|
-
"radius": "0.5rem"
|
|
173
|
-
},
|
|
174
|
-
"aliases": {
|
|
175
|
-
"partials": "partials/components",
|
|
176
|
-
"styles": "assets/css/components"
|
|
177
|
-
},
|
|
178
|
-
"cssFile": "assets/css/ghostcn.css"
|
|
179
|
-
}
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
The CLI keeps the token stylesheet and every installed component stylesheet linked automatically:
|
|
183
|
-
```handlebars
|
|
184
|
-
{{!-- ghostcn:styles:start --}}
|
|
185
|
-
<link rel="stylesheet" href="{{asset "css/ghostcn.css"}}" />
|
|
186
|
-
{{!-- Component styles are added here by `ghostcn add` --}}
|
|
187
|
-
{{!-- ghostcn:styles:end --}}
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
If a theme uses a layout other than `default.hbs`, the CLI leaves the layout untouched and prints the link you need to add manually.
|
|
191
|
-
|
|
192
|
-
### 2. Browse Components
|
|
193
|
-
|
|
194
|
-
List all available components in the registry:
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
npx ghostcn list
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### 3. Add Components
|
|
201
|
-
|
|
202
|
-
Add a specific component:
|
|
203
|
-
```bash
|
|
204
|
-
npx ghostcn add newsletter-form
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
Add multiple components in one command (unreleased development CLI):
|
|
208
|
-
|
|
209
|
-
```bash
|
|
210
|
-
ghostcn add button card badge input alert post-grid author-list tag-grid archive-header
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
For existing files, the spinner pauses before a single overwrite decision per requested component. Enter / N preserves them and continues with the rest; Y replaces that component's existing files. Ctrl+C cancels the remaining work (earlier installs are not rolled back). Review `ghostcn diff <name>` before replacing customizations.
|
|
214
|
-
|
|
215
|
-
For scripts or a quick safe re-run, `ghostcn add button card --skip-existing` installs missing files and preserves existing ones without prompts. Without a terminal, existing files are also preserved and the CLI prints review/replacement directions. Use `--yes` only for deliberate replacement; do not combine it with `--skip-existing`.
|
|
216
|
-
|
|
217
|
-
Or run `add` without arguments to pick interactively from a checklist:
|
|
218
|
-
```bash
|
|
219
|
-
npx ghostcn add
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
To overwrite existing files without prompts:
|
|
223
|
-
```bash
|
|
224
|
-
npx ghostcn add pricing-table -y
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
### 4. Use in your Templates
|
|
228
|
-
|
|
229
|
-
Include the installed partial anywhere in your Handlebars templates:
|
|
230
|
-
|
|
231
|
-
```handlebars
|
|
232
|
-
{{!-- Newsletter Form --}}
|
|
233
|
-
{{> "components/newsletter-form" title="Subscribe to our Newsletter"}}
|
|
15
|
+
The dev command watches CSS; it does not start Ghost. Follow the [theme setup guide](https://ghostcn.geekbits.dev/docs/getting-started/create-a-theme) to activate and preview the theme in Ghost.
|
|
234
16
|
|
|
235
|
-
|
|
236
|
-
{{> "components/pricing-table" title="Choose your membership plan"}}
|
|
17
|
+
## Add to an existing theme
|
|
237
18
|
|
|
238
|
-
|
|
239
|
-
{{#primary_author}}
|
|
240
|
-
{{> "components/author-card"}}
|
|
241
|
-
{{/primary_author}}
|
|
19
|
+
From your Ghost theme directory:
|
|
242
20
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
{{/foreach}}
|
|
21
|
+
```sh
|
|
22
|
+
npx ghostcn@latest init
|
|
23
|
+
npx ghostcn@latest add newsletter-form --skip-existing
|
|
247
24
|
```
|
|
248
25
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
Every component accepts `class` for its root element. Optional named slots style specific parts **inside** a component: `buttonClass` styles its theme-owned buttons, while `cardClass` styles nested pricing/featured cards. These are ordinary class strings, not new CSS syntax, and work with Tailwind or your own vanilla CSS.
|
|
26
|
+
Call the installed partial from a Handlebars template:
|
|
252
27
|
|
|
253
28
|
```handlebars
|
|
254
|
-
{{> "components/
|
|
255
|
-
class="mx-auto my-12 w-full max-w-md"
|
|
256
|
-
cardClass="rounded-2xl bg-card p-8 shadow-lg"
|
|
257
|
-
buttonClass="bg-purple-600 hover:bg-purple-700 text-white"
|
|
258
|
-
}}
|
|
259
|
-
|
|
260
|
-
{{!-- Another independent instance; the shared partial stays unchanged --}}
|
|
261
|
-
{{> "components/pricing-table"
|
|
262
|
-
class="mx-auto max-w-6xl"
|
|
263
|
-
cardClass="rounded-lg p-4 shadow-none"
|
|
264
|
-
buttonClass="bg-emerald-600 hover:bg-emerald-700 text-white"
|
|
265
|
-
}}
|
|
266
|
-
|
|
267
|
-
{{> "components/newsletter-form"
|
|
268
|
-
class="max-w-lg p-4 shadow-none"
|
|
269
|
-
inputClass="rounded-xl"
|
|
270
|
-
buttonClass="rounded-xl bg-purple-600 text-white"
|
|
271
|
-
}}
|
|
272
|
-
|
|
273
|
-
{{#foreach posts}}
|
|
274
|
-
{{> "components/post-card" class="rounded-xl shadow-none" titleClass="text-2xl"}}
|
|
275
|
-
{{/foreach}}
|
|
29
|
+
{{> "components/newsletter-form"}}
|
|
276
30
|
```
|
|
277
31
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
| Component | Root | Additional styling parameters |
|
|
281
|
-
| --- | --- | --- |
|
|
282
|
-
| `pricing-table` | `class` | `titleClass`, `gridClass`, `cardClass`, `buttonClass`, `cardTitleClass`, `descriptionClass`, `priceClass`, `benefitsClass` |
|
|
283
|
-
| `newsletter-form` | `class` | `titleClass`, `descriptionClass`, `formClass`, `inputClass`, `buttonClass` |
|
|
284
|
-
| `post-card` | `class` | `imageClass`, `contentClass`, `titleClass`, `descriptionClass`, `metaClass`, `footerClass` |
|
|
285
|
-
| `author-card` | `class` | `avatarClass`, `contentClass`, `titleClass`, `descriptionClass`, `metaClass` |
|
|
286
|
-
| `site-header` | `class` | `innerClass`, `navClass`, `buttonClass` |
|
|
287
|
-
| `site-footer` | `class` | `innerClass`, `navClass`, `socialClass` |
|
|
288
|
-
| `featured-posts` | `class` | `titleClass`, `gridClass`, `cardClass`, `contentClass` |
|
|
289
|
-
| `pagination` | `class` | `buttonClass`, `statusClass` |
|
|
290
|
-
| `post-header` | `class` | `titleClass`, `descriptionClass`, `metaClass`, `imageClass` |
|
|
291
|
-
| `member-cta` | `class` | `titleClass`, `descriptionClass`, `buttonClass` |
|
|
292
|
-
| `related-posts` | `class` | `titleClass`, `gridClass`, `cardClass`, `cardTitleClass`, `imageClass`, `contentClass`, `descriptionClass` |
|
|
293
|
-
| `post-navigation` | `class` | `cardClass`, `titleClass`, `labelClass` |
|
|
294
|
-
| `table-of-contents` | `class` | `titleClass`, `listClass`, `linkClass` |
|
|
295
|
-
| `tag-list` | `class` | `listClass`, `linkClass` |
|
|
296
|
-
|
|
297
|
-
Slots only affect elements that render for the current content/member state. `buttonClass` applies to all theme-owned buttons in that component, not individual monthly/yearly actions and not Ghost-generated search/Portal/comments UI. Use scoped descendant selectors for more granular targeting. Root `class` does not automatically recolor children that have their own colors; use the corresponding slot. To customize pagination at the call site, use `{{> "pagination" pagination class="my-pagination"}}`; the native `{{pagination}}` helper retains its default appearance.
|
|
298
|
-
|
|
299
|
-
### Pair custom backgrounds with foregrounds
|
|
300
|
-
|
|
301
|
-
Default semantic surfaces (`bg-card text-card-foreground`) follow Light/Dark/Auto. Arbitrary background utilities do **not** select a matching text color automatically. For example, `bg-purple-50` alone leaves dark-mode foreground tokens white. Always pair custom surfaces and text, including their dark variants:
|
|
302
|
-
|
|
303
|
-
```handlebars
|
|
304
|
-
{{> "components/pricing-table"
|
|
305
|
-
class="mx-auto my-12 max-w-5xl"
|
|
306
|
-
cardClass="rounded-2xl bg-purple-50 text-purple-950 dark:bg-purple-950 dark:text-purple-50 p-8 shadow-lg"
|
|
307
|
-
buttonClass="bg-purple-600 text-white hover:bg-purple-700"
|
|
308
|
-
}}
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
Pricing titles, descriptions, benefits, prices, and billing intervals inherit the card's local text color; use their named slots for individual overrides. Standalone cards use the same pairing on `class`, not `cardClass`. For vanilla custom surfaces, set **both** `background` and `color` on your own class. Review contrast in every color mode; arbitrary custom colors are not automatically contrast-corrected.
|
|
312
|
-
|
|
313
|
-
For vanilla CSS, pass custom class names and define them in your theme-owned `assets/css/source.css`:
|
|
314
|
-
|
|
315
|
-
```handlebars
|
|
316
|
-
{{> "components/pricing-table" class="membership" cardClass="membership-card" buttonClass="membership-button"}}
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
```css
|
|
320
|
-
.membership { max-width: 40rem; }
|
|
321
|
-
.membership .membership-card { border-radius: 1.5rem; box-shadow: 0 8px 24px #0002; }
|
|
322
|
-
.membership .membership-button { background: #7c3aed; color: white; }
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
Load custom CSS after component styles and match selector specificity where needed. Re-adding a component with `-y` still overwrites its copied partial/CSS, but **not** the calling page template or `source.css`. Back up first when upgrading old customized partials. Existing installations must merge or re-add the new partials to gain these parameters; updating the CLI alone does not rewrite your theme. A future component release may still require migration if it changes or removes a documented slot.
|
|
326
|
-
|
|
327
|
-
---
|
|
328
|
-
|
|
329
|
-
## Project Structure
|
|
330
|
-
|
|
331
|
-
```text
|
|
332
|
-
ghostcn/
|
|
333
|
-
├── packages/
|
|
334
|
-
│ └── cli/ # ghostcn CLI (Commander, Prompts, TypeScript, tests)
|
|
335
|
-
├── registry/
|
|
336
|
-
│ ├── index.json # Registry catalog index
|
|
337
|
-
│ └── components/ # Component manifests and templates
|
|
338
|
-
├── example-theme/ # Sample Ghost theme showing integration
|
|
339
|
-
└── .github/workflows/ # Automated CI pipeline
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
---
|
|
343
|
-
|
|
344
|
-
## Development & Testing
|
|
345
|
-
|
|
346
|
-
### Composable components (unreleased)
|
|
347
|
-
|
|
348
|
-
Every component still accepts `class`. A standalone button or card uses `class` for itself; `cardClass` and `buttonClass` belong only to blocks containing those elements. Primitives support `size="sm|default|lg"`. Their supported variants are:
|
|
349
|
-
|
|
350
|
-
| Component | Variants |
|
|
351
|
-
| :--- | :--- |
|
|
352
|
-
| `button` | `default`, `secondary`, `outline`, `ghost`, `destructive`, `link` |
|
|
353
|
-
| `card` | `default`, `secondary`, `outline` |
|
|
354
|
-
| `badge` | `default`, `secondary`, `outline`, `destructive` |
|
|
355
|
-
| `input` | `default`, `filled` |
|
|
356
|
-
| `alert` | `default`, `secondary`, `outline`, `destructive` |
|
|
357
|
-
|
|
358
|
-
Unknown variants/sizes fall back to `default`. Existing components do not gain invented variant parameters. Pass booleans as `disabled=true`, not `disabled="false"` (a nonempty string is truthy in Handlebars).
|
|
359
|
-
|
|
360
|
-
```handlebars
|
|
361
|
-
{{> "components/button" text="Subscribe" href="#/portal/signup" dataPortal="signup"
|
|
362
|
-
variant="outline" size="sm" class="bg-purple-600 hover:bg-purple-700 text-white"
|
|
363
|
-
}}
|
|
364
|
-
|
|
365
|
-
{{#> "components/card" heading="Join the publication" class="mx-auto max-w-md p-8"}}
|
|
366
|
-
<p>Your own content, in your own template.</p>
|
|
367
|
-
{{> "components/button" text="Learn more" href="/about/" class="rounded-xl"}}
|
|
368
|
-
{{/components/card}}
|
|
369
|
-
|
|
370
|
-
{{> "components/input" label="Email" type="email" name="email" required=true
|
|
371
|
-
hint="Used for replies only" hintId="contact-email-hint" inputClass="rounded-xl"
|
|
372
|
-
}}
|
|
373
|
-
|
|
374
|
-
{{> "components/post-grid" posts=posts heading="Latest stories" cardClass="rounded-xl"}}
|
|
375
|
-
{{> "components/author-list" heading="Our authors"}}
|
|
376
|
-
{{> "components/tag-grid" heading="Topics" cardVariant="outline"}}
|
|
377
|
-
{{#tag}}{{> "components/archive-header" eyebrow="Topic" archiveImage=feature_image}}{{/tag}}
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
Use ordinary CSS classes instead of utilities in vanilla themes, with your stylesheet loaded after component defaults. Variants deliberately use low-specificity selectors. `input`'s root class styles the field wrapper; `inputClass` targets the control. Each label wraps its input, so no ID is required; provide a **unique** `hintId` with `hint` for an accessible help-text association. These inputs do not submit to Ghost by themselves. Use `newsletter-form` for native member signup.
|
|
381
|
-
|
|
382
|
-
Cards accept escaped `body` text or a trusted Handlebars partial block as above—never pass untrusted raw HTML. Partial calls follow normal Handlebars context inheritance: explicitly set/reset nested parameters (e.g. `class=""`, `variant="default"`) when you don't want an outer card's values. Button `href` values must come from trusted theme code or Ghost URLs; HTML escaping is not URL sanitization. Disabled links have no `href` or Portal action. Alerts default to `role="status"`; use `urgent=true` only for urgent dynamic announcements.
|
|
383
|
-
|
|
384
|
-
Adding a composed block installs missing dependencies first. **Existing dependency files are preserved even with `add -y`.** To replace a dependency deliberately, add that component explicitly. Requested root components use one overwrite decision each; Enter preserves existing files and continues. Custom partial aliases under `partials/` are reflected in nested references. Review `ghostcn diff` before merging updates.
|
|
385
|
-
|
|
386
|
-
`author-list` and `tag-grid` query up to 100 records; they are compact discovery blocks, not paginated directories. Use a custom paginated Ghost query with the reusable cards for larger archives. `post-grid` renders the collection you pass. Empty collections render nothing unless the block receives `emptyText`.
|
|
387
|
-
|
|
388
|
-
### Local playground (unreleased)
|
|
389
|
-
|
|
390
|
-
Build the CLI in this repository, then invoke its absolute `packages/cli/dist/index.js` path from your **theme directory**:
|
|
391
|
-
|
|
392
|
-
```bash
|
|
393
|
-
# Repository directory:
|
|
394
|
-
npm run build
|
|
395
|
-
|
|
396
|
-
# Theme directory, replacing the placeholder with this checkout's actual path:
|
|
397
|
-
node /absolute/path/to/ghost/packages/cli/dist/index.js add tag-grid
|
|
398
|
-
node /absolute/path/to/ghost/packages/cli/dist/index.js playground
|
|
399
|
-
# Optional: --port 4191 (or --port 0 for an available port)
|
|
400
|
-
```
|
|
401
|
-
|
|
402
|
-
Open the printed localhost URL. The playground reads your installed partials and layout's local stylesheet links, shows controls for supported parameters, and reloads when theme files change. Keep `npm run dev` running in another terminal. Tailwind classes typed only into a preview field are not compiled automatically: add complete class literals to a scanned `.hbs` file first. Preview controls are temporary; copy the generated usage into your theme to save it.
|
|
403
|
-
|
|
404
|
-
The server binds to loopback only, rejects writes and unsafe/symlinked paths, and sandbox-previews synthetic data. It does not start Ghost, send emails, perform payments or change your theme files. Custom Ghost helpers, real query results, Portal, comments, access control and the rest of your theme must still be tested in Ghost. Stop with Ctrl+C.
|
|
405
|
-
|
|
406
|
-
The real-Ghost browser suite builds both styling systems in Light/Dark/Auto, exercises desktop/mobile layouts, reading navigation, real comments, and visitor/free/paid access. It runs an isolated database and content directory; it never changes your installed publication. See [the regression setup](tests/e2e/README.md) for prerequisites, commands, and coverage boundaries.
|
|
407
|
-
|
|
408
|
-
```bash
|
|
409
|
-
# Install dependencies
|
|
410
|
-
npm install
|
|
411
|
-
|
|
412
|
-
# Build CLI and bundle registry
|
|
413
|
-
npm run build
|
|
414
|
-
|
|
415
|
-
# Run automated tests
|
|
416
|
-
npm test
|
|
417
|
-
|
|
418
|
-
# Local playground UI and documentation browser checks
|
|
419
|
-
npm run docs:build
|
|
420
|
-
npm run docs:check
|
|
421
|
-
npm run docs:browser
|
|
422
|
-
npm run test:playground
|
|
423
|
-
|
|
424
|
-
# Verify theme compatibility with Ghost validator
|
|
425
|
-
cd example-theme
|
|
426
|
-
npx gscan .
|
|
427
|
-
```
|
|
428
|
-
|
|
429
|
-
---
|
|
430
|
-
|
|
431
|
-
## Troubleshooting
|
|
432
|
-
|
|
433
|
-
### Clearing npx cache
|
|
434
|
-
If you've previously run an older version of `ghostcn`, npx may cache it locally. To always run the latest version:
|
|
435
|
-
```bash
|
|
436
|
-
npx ghostcn@latest <command>
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
---
|
|
440
|
-
|
|
441
|
-
## License
|
|
32
|
+
See the [existing theme guide](https://ghostcn.geekbits.dev/docs/getting-started/existing-theme) for stylesheet setup. Updating the CLI does not rewrite your copied components; [review changes](https://ghostcn.geekbits.dev/docs/guides/updating-components) before replacing them.
|
|
442
33
|
|
|
443
|
-
|
|
34
|
+
[Source code](https://github.com/Geekbits-Org/ghost-ui) · [Report an issue](https://github.com/Geekbits-Org/ghost-ui/issues)
|
package/dist/commands/create.js
CHANGED
|
@@ -15,9 +15,9 @@ const theme_scaffold_1 = require("../utils/theme-scaffold");
|
|
|
15
15
|
async function create(themeNameArgument, options = {}) {
|
|
16
16
|
let themeName = themeNameArgument || '';
|
|
17
17
|
let style = 'tailwind';
|
|
18
|
-
let baseColor = '
|
|
19
|
-
let accentColor = '
|
|
20
|
-
let radius = '0.
|
|
18
|
+
let baseColor = 'doks';
|
|
19
|
+
let accentColor = 'doks';
|
|
20
|
+
let radius = '0.625rem';
|
|
21
21
|
let colorScheme = 'Auto';
|
|
22
22
|
let packageManager = 'npm';
|
|
23
23
|
let authorName = 'Theme Author';
|
|
@@ -28,9 +28,9 @@ async function create(themeNameArgument, options = {}) {
|
|
|
28
28
|
const response = await (0, prompts_1.default)([
|
|
29
29
|
...(!themeName ? [{ type: 'text', name: 'themeName', message: 'What should the theme be called?', initial: 'my-ghost-theme' }] : []),
|
|
30
30
|
{ type: 'select', name: 'style', message: 'Which styling system?', choices: [{ title: 'Tailwind CSS', value: 'tailwind' }, { title: 'Vanilla CSS', value: 'css' }], initial: 0 },
|
|
31
|
-
{ type: 'select', name: 'baseColor', message: 'Choose a base palette', choices: ['zinc', 'slate', 'stone', 'gray', 'neutral'].map(value => ({ title: value[0].toUpperCase() + value.slice(1), value })), initial: 0 },
|
|
32
|
-
{ type: 'select', name: 'accentColor', message: 'Choose an accent color', choices: ['ghost', 'indigo', 'violet', 'blue', 'emerald', 'rose', 'orange', 'zinc'].map(value => ({ title: value
|
|
33
|
-
{ type: 'select', name: 'radius', message: 'Choose a border radius', choices: [{ title: 'Medium', value: '0.5rem' }, { title: 'Small', value: '0.25rem' }, { title: 'Large', value: '0.75rem' }, { title: 'Extra large', value: '1rem' }, { title: 'None', value: '0' }, { title: 'Pill', value: '9999px' }], initial: 0 },
|
|
31
|
+
{ type: 'select', name: 'baseColor', message: 'Choose a base palette', choices: [{ title: 'Doks (Recommended)', value: 'doks', description: 'Warm editorial surfaces in light and dark' }, ...['zinc', 'slate', 'stone', 'gray', 'neutral'].map(value => ({ title: value[0].toUpperCase() + value.slice(1), value }))], initial: 0 },
|
|
32
|
+
{ type: 'select', name: 'accentColor', message: 'Choose an accent color', choices: [{ title: 'Doks / Monochrome', value: 'doks' }, { title: 'Ghost publication accent', value: 'ghost' }, ...['indigo', 'violet', 'blue', 'emerald', 'rose', 'orange', 'zinc'].map(value => ({ title: value[0].toUpperCase() + value.slice(1), value }))], initial: 0 },
|
|
33
|
+
{ type: 'select', name: 'radius', message: 'Choose a border radius', choices: [{ title: 'Doks (10px)', value: '0.625rem' }, { title: 'Medium', value: '0.5rem' }, { title: 'Small', value: '0.25rem' }, { title: 'Large', value: '0.75rem' }, { title: 'Extra large', value: '1rem' }, { title: 'None', value: '0' }, { title: 'Pill', value: '9999px' }], initial: 0 },
|
|
34
34
|
{ type: 'select', name: 'colorScheme', message: 'Choose the initial color scheme', choices: ['Auto', 'Light', 'Dark'].map(value => ({ title: value, value })), initial: 0 },
|
|
35
35
|
{ type: 'multiselect', name: 'optionalComponents', message: 'Add optional starter components', choices: [{ title: 'Newsletter form', value: 'newsletter-form', selected: true }, { title: 'Author card', value: 'author-card', selected: true }, { title: 'Pricing table', value: 'pricing-table', selected: false }], hint: '- Space to select. Return to submit' },
|
|
36
36
|
{ type: 'select', name: 'packageManager', message: 'Choose a package manager', choices: ['npm', 'pnpm', 'yarn', 'bun'].map(value => ({ title: value, value })), initial: 0 },
|
package/dist/commands/init.js
CHANGED
|
@@ -54,6 +54,7 @@ async function init(options = {}) {
|
|
|
54
54
|
message: 'Which base color palette would you like to use?',
|
|
55
55
|
choices: [
|
|
56
56
|
{ title: 'Zinc', value: 'zinc', description: 'Modern neutral with cool undertones' },
|
|
57
|
+
{ title: 'Doks', value: 'doks', description: 'Warm editorial surfaces in light and dark' },
|
|
57
58
|
{ title: 'Slate', value: 'slate', description: 'Cool gray with subtle blue tones' },
|
|
58
59
|
{ title: 'Stone', value: 'stone', description: 'Warm, earthy neutral' },
|
|
59
60
|
{ title: 'Gray', value: 'gray', description: 'Clean, balanced neutral gray' },
|
|
@@ -77,7 +78,8 @@ async function init(options = {}) {
|
|
|
77
78
|
{ title: 'Emerald', value: 'emerald', description: 'Lush natural green' },
|
|
78
79
|
{ title: 'Rose', value: 'rose', description: 'Warm crimson rose' },
|
|
79
80
|
{ title: 'Orange', value: 'orange', description: 'Energetic warm orange' },
|
|
80
|
-
{ title: 'Zinc / Monochrome', value: 'zinc', description: 'Minimalist black/white' }
|
|
81
|
+
{ title: 'Zinc / Monochrome', value: 'zinc', description: 'Minimalist black/white' },
|
|
82
|
+
{ title: 'Doks / Monochrome', value: 'doks', description: 'Neutral controls with an inverted dark palette' }
|
|
81
83
|
],
|
|
82
84
|
initial: 0
|
|
83
85
|
},
|
|
@@ -91,7 +93,8 @@ async function init(options = {}) {
|
|
|
91
93
|
{ title: 'Large (0.75rem)', value: '0.75rem' },
|
|
92
94
|
{ title: 'Extra Large (1.0rem)', value: '1rem' },
|
|
93
95
|
{ title: 'None (0px)', value: '0' },
|
|
94
|
-
{ title: 'Full (Pill / 9999px)', value: '9999px' }
|
|
96
|
+
{ title: 'Full (Pill / 9999px)', value: '9999px' },
|
|
97
|
+
{ title: 'Doks (0.625rem)', value: '0.625rem' }
|
|
95
98
|
],
|
|
96
99
|
initial: 0
|
|
97
100
|
},
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,8 @@ function main() {
|
|
|
18
18
|
const program = new commander_1.Command()
|
|
19
19
|
.name('ghostcn')
|
|
20
20
|
.description('The shadcn/ui for Ghost CMS themes')
|
|
21
|
-
.version(package_json_1.default.version || '1.0.0')
|
|
21
|
+
.version(package_json_1.default.version || '1.0.0')
|
|
22
|
+
.addHelpText('after', `\nDocumentation: ${package_json_1.default.homepage}`);
|
|
22
23
|
program
|
|
23
24
|
.command('create')
|
|
24
25
|
.description('Create a complete Ghost theme with ghostcn components')
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"name": "alert.css",
|
|
46
46
|
"type": "style",
|
|
47
47
|
"target": "assets/css/components/alert.css",
|
|
48
|
-
"content": ".ghcn-ui-alert { box-sizing: border-box; font-family: inherit; font-size: 16px; line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-alert, .ghcn-ui-alert * { box-sizing: border-box; }\n.ghcn-ui-alert:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-alert:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-alert:focus-visible, .ghcn-ui-alert :focus-visible { outline: 2px solid var(--ring); outline-offset:
|
|
48
|
+
"content": ".ghcn-ui-alert { box-sizing: border-box; font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-alert, .ghcn-ui-alert * { box-sizing: border-box; }\n.ghcn-ui-alert:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-alert:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-alert:focus-visible, :where(.ghcn-ui-alert) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n.ghcn-ui-alert { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b); padding: 16px; }\n.ghcn-ui-alert:where([data-size=\"sm\"]) { padding: 12px; }\n.ghcn-ui-alert:where([data-size=\"lg\"]) { padding: var(--ghcn-panel-padding, clamp(16px, 3vw, 24px)); }\n.ghcn-ui-alert:where([data-variant=\"secondary\"]) { background: var(--secondary); color: var(--secondary-foreground); }\n.ghcn-ui-alert:where([data-variant=\"outline\"]) { background: transparent; }\n.ghcn-ui-alert:where([data-variant=\"destructive\"]) { border-color: var(--destructive); color: var(--destructive); }\n.ghcn-ui-alert__title { font-size: 1em; margin: 0 0 .375em; font-weight: 600; }\n.ghcn-ui-alert__description { margin: 0; }\n"
|
|
49
49
|
}
|
|
50
50
|
],
|
|
51
51
|
"styleSlots": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"name": "archive-header.css",
|
|
35
35
|
"type": "style",
|
|
36
36
|
"target": "assets/css/components/archive-header.css",
|
|
37
|
-
"content": ".ghcn-archive-header { font-size: 16px; color: var(--foreground);
|
|
37
|
+
"content": ".ghcn-archive-header { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); width: min(100% - 32px, 1152px); margin-inline: auto; text-align: center; }\n.ghcn-archive-header__title { font-size: var(--ghcn-title-display, clamp(32px, 5vw, 56px)); font-weight: 700; line-height: 1.08; letter-spacing: -.045em; text-wrap: balance; overflow-wrap: anywhere; max-width: 24ch; margin: 12px auto; }\n.ghcn-archive-header__description { max-width: 60ch; margin: 12px auto; color: var(--muted-foreground); }\n.ghcn-archive-header__image { display: block; width: 100%; max-height: 440px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); margin-top: var(--ghcn-section-gap, 20px); }\n"
|
|
38
38
|
}
|
|
39
39
|
],
|
|
40
40
|
"styleSlots": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"name": "author-card.css",
|
|
16
16
|
"type": "style",
|
|
17
17
|
"target": "assets/css/components/author-card.css",
|
|
18
|
-
"content": "/* ghostcn: Author Card Styles */\n.gh-author-card {\n box-sizing: border-box
|
|
18
|
+
"content": "/* ghostcn: Author Card Styles */\n.gh-author-card {\n box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b);\n font-family: inherit;\n font-size: var(--ghcn-text-body, 16px);\n line-height: 1.5;\n isolation: isolate;\n padding: var(--ghcn-panel-padding, clamp(16px, 3vw, 24px));\n margin: var(--ghcn-section-space, clamp(24px, 4vw, 48px)) auto;\n width: min(100% - 32px, 704px);\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--ghcn-grid-gap, 16px);\n}\n\n.gh-author-card *,\n.gh-author-card *::before,\n.gh-author-card *::after {\n box-sizing: border-box;\n}\n\n@media (min-width: 640px) {\n .gh-author-card {\n flex-direction: row;\n align-items: flex-start;\n }\n}\n\n.gh-author-avatar {\n width: 56px;\n height: 56px;\n flex: 0 0 56px;\n border-radius: 9999px;\n object-fit: cover;\n border: 2px solid var(--border, #e4e4e7);\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-author-avatar-fallback {\n width: 56px;\n height: 56px;\n flex: 0 0 56px;\n border-radius: 9999px;\n background-color: var(--muted, #f4f4f5);\n color: var(--foreground, #09090b);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.5em;\n font-weight: 700;\n border: 2px solid var(--border, #e4e4e7);\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-author-details {\n flex: 1;\n min-width: 0;\n text-align: center;\n}\n\n@media (min-width: 640px) {\n .gh-author-details {\n text-align: left;\n }\n}\n\n.gh-author-name {\n font-size: var(--ghcn-title-card, 20px); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; color: inherit;\n margin: 0;\n}\n\n.gh-author-name a {\n color: inherit;\n text-decoration: none;\n transition: color 0.15s ease;\n}\n\n.gh-author-name:hover {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n}\n\n.gh-author-bio {\n color: var(--muted-foreground, #71717a);\n font-size: 0.875em;\n line-height: 1.5;\n margin: 0.5em 0 1em;\n}\n\n.gh-author-meta {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n gap: 1em;\n font-size: 0.75em;\n color: var(--muted-foreground, #71717a);\n}\n\n.gh-author-meta a {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n text-decoration: none;\n}\n\n.gh-author-meta a:hover {\n text-decoration: underline;\n}\n\n.gh-author-heading { display: flex; flex-direction: column; justify-content: space-between; gap: 0.5em; margin-bottom: 0.5em; }\n.gh-author-post-count { border-radius: 9999px; padding: 0.25em 0.625em; background: var(--muted); color: var(--muted-foreground); font-size: 0.75em; font-weight: 500; }\n.gh-author-location { display: inline-flex; align-items: center; gap: 0.25em; }\n@media (min-width: 640px) { .gh-author-heading { flex-direction: row; flex-wrap: wrap; align-items: center; } .gh-author-meta { justify-content: flex-start; } }\n.gh-author-card:focus-visible, :where(.gh-author-card) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"gscan": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"name": "author-list.css",
|
|
26
26
|
"type": "style",
|
|
27
27
|
"target": "assets/css/components/author-list.css",
|
|
28
|
-
"content": ".ghcn-author-list { font-size: 16px; color: var(--foreground); margin-
|
|
28
|
+
"content": ".ghcn-author-list { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); width: min(100% - 32px, 1152px); margin-inline: auto; }\n.ghcn-author-list__title { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; margin: 0 0 var(--ghcn-section-gap, 20px); }\n.ghcn-author-list__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--ghcn-grid-gap, 16px); }\n.ghcn-author-list__grid > * { min-width: 0; }\n.ghcn-author-list__empty { color: var(--muted-foreground); }\n:where(.ghcn-author-list__grid) > .gh-author-card { width: 100%; margin: 0; }\n"
|
|
29
29
|
}
|
|
30
30
|
],
|
|
31
31
|
"styleSlots": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"name": "badge.css",
|
|
41
41
|
"type": "style",
|
|
42
42
|
"target": "assets/css/components/badge.css",
|
|
43
|
-
"content": ".ghcn-ui-badge { box-sizing: border-box; font-family: inherit; font-size: 16px; line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-badge, .ghcn-ui-badge * { box-sizing: border-box; }\n.ghcn-ui-badge:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-badge:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-badge:focus-visible, .ghcn-ui-badge :focus-visible { outline: 2px solid var(--ring); outline-offset:
|
|
43
|
+
"content": ".ghcn-ui-badge { box-sizing: border-box; font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-badge, .ghcn-ui-badge * { box-sizing: border-box; }\n.ghcn-ui-badge:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-badge:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-badge:focus-visible, :where(.ghcn-ui-badge) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n.ghcn-ui-badge { display: inline-flex; align-items: center; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--secondary); color: var(--secondary-foreground); font-size: 12px; font-weight: 600; line-height: 1.25; }\n.ghcn-ui-badge:where([data-size=\"sm\"]) { font-size: 11px; padding: 2px 7px; }\n.ghcn-ui-badge:where([data-size=\"lg\"]) { font-size: 14px; padding: 4px 10px; }\n.ghcn-ui-badge:where([data-variant=\"secondary\"]) { background: var(--muted); color: var(--muted-foreground); border-color: transparent; }\n.ghcn-ui-badge:where([data-variant=\"outline\"]) { background: transparent; color: var(--foreground); border-color: var(--border); }\n.ghcn-ui-badge:where([data-variant=\"destructive\"]) { background: var(--destructive); color: var(--destructive-foreground); }\n"
|
|
44
44
|
}
|
|
45
45
|
],
|
|
46
46
|
"styleSlots": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"name": "button.css",
|
|
64
64
|
"type": "style",
|
|
65
65
|
"target": "assets/css/components/button.css",
|
|
66
|
-
"content": ".ghcn-ui-button { box-sizing: border-box; font-family: inherit; font-size: 16px; line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-button, .ghcn-ui-button * { box-sizing: border-box; }\n.ghcn-ui-button:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-button:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-button:focus-visible, .ghcn-ui-button :focus-visible { outline: 2px solid var(--ring); outline-offset:
|
|
66
|
+
"content": ".ghcn-ui-button { box-sizing: border-box; font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-button, .ghcn-ui-button * { box-sizing: border-box; }\n.ghcn-ui-button:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-button:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-button:focus-visible, :where(.ghcn-ui-button) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n.ghcn-ui-button { min-height: var(--ghcn-control-height, 40px); padding: var(--ghcn-control-padding, 8px 14px); border-radius: var(--ghcn-control-radius, var(--radius, 8px)); font-size: var(--ghcn-text-small, 14px); line-height: 1.25; display: inline-flex; align-items: center; justify-content: center; gap: var(--ghcn-control-gap, 8px); border: 1px solid transparent; background: var(--primary); color: var(--primary-foreground); font-weight: 600; text-decoration: none; cursor: pointer; }\n.ghcn-ui-button:hover { opacity: .9; }\n.ghcn-ui-button:where([data-size=\"sm\"]) { min-height: 34px; padding: 5px 11px; font-size: 13px; }\n.ghcn-ui-button:where([data-size=\"lg\"]) { min-height: 46px; padding: 10px 17px; font-size: 16px; }\n.ghcn-ui-button:where([data-variant=\"secondary\"]) { background: var(--secondary); color: var(--secondary-foreground); }\n.ghcn-ui-button:where([data-variant=\"outline\"]) { background: transparent; color: var(--foreground); border-color: var(--border); }\n.ghcn-ui-button:where([data-variant=\"ghost\"]), .ghcn-ui-button:where([data-variant=\"link\"]) { background: transparent; color: var(--foreground); }\n.ghcn-ui-button:where([data-variant=\"link\"]) { color: var(--primary); text-decoration: underline; }\n.ghcn-ui-button:where([data-variant=\"destructive\"]) { background: var(--destructive); color: var(--destructive-foreground); }\n.ghcn-ui-button:disabled, .ghcn-ui-button[aria-disabled=\"true\"] { opacity: .5; cursor: not-allowed; }\n"
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
69
|
"styleSlots": {
|