@riebeckite/honox 0.0.33 → 0.0.35

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.
@@ -70,12 +70,6 @@ type ThemeRootProps = {
70
70
  lang?: string;
71
71
  children?: PrimitiveChildren;
72
72
  };
73
- /**
74
- * Derives the `<html>` attributes from a resolved theme.
75
- *
76
- * Combines the theme's custom `data-*` attributes with the reserved
77
- * color-mode, name, typography, and article-layout attributes.
78
- */
79
73
  export declare function themeRootAttributes(theme: ResolvedRiebeckiteConfig["theme"]): Record<string, string | undefined>;
80
74
  /**
81
75
  * Root `<html>` element carrying the resolved theme's attributes.
@@ -126,6 +120,6 @@ type SeoHeadProps = {
126
120
  }[];
127
121
  };
128
122
  export declare function SeoHead(props: SeoHeadProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
129
- export declare function getThemeStyle(tokens: ResolvedRiebeckiteConfig["theme"]["tokens"]): string;
130
- export declare function getThemeStylesheets(userCss: readonly string[]): string[];
123
+ export declare function getThemeStyle(theme: ResolvedRiebeckiteConfig["theme"]): string;
124
+ export declare function getThemeStylesheets(stylesheets: readonly string[]): string[];
131
125
  export {};
@@ -109,11 +109,10 @@ function Sidebar(props) {
109
109
  }
110
110
  function themeRootAttributes(theme) {
111
111
  return {
112
- ...theme.attributes,
113
- "data-theme": theme.colorMode === "system" ? void 0 : theme.colorMode,
114
- "data-theme-name": theme.name,
115
- "data-typography": theme.typography,
116
- "data-article-layout": theme.articleLayout
112
+ ...theme.settings.attributes,
113
+ "data-rb-theme": theme.name,
114
+ "data-rb-mode": theme.colorMode === "system" ? void 0 : theme.colorMode,
115
+ "data-rb-layout": theme.layout
117
116
  };
118
117
  }
119
118
  function ThemeRoot(props) {
@@ -351,38 +350,11 @@ function SeoHead(props) {
351
350
  ) : null
352
351
  ] });
353
352
  }
354
- function getThemeStyle(tokens) {
355
- const variables = [
356
- ["--rb-color-paper", tokens.color?.paper],
357
- ["--rb-color-ink", tokens.color?.ink],
358
- ["--rb-color-muted", tokens.color?.muted],
359
- ["--rb-color-accent", tokens.color?.accent],
360
- ["--rb-color-link", tokens.color?.link],
361
- ["--rb-color-focus", tokens.color?.focus],
362
- ["--rb-color-selected", tokens.color?.selected],
363
- ["--rb-color-border", tokens.color?.border],
364
- ["--rb-color-border-strong", tokens.color?.borderStrong],
365
- ["--rb-color-surface", tokens.color?.surface],
366
- ["--rb-color-surface-hover", tokens.color?.surfaceHover],
367
- ["--rb-color-overlay", tokens.color?.overlay],
368
- ["--rb-color-danger", tokens.color?.danger],
369
- ["--rb-color-success", tokens.color?.success],
370
- ["--rb-color-code-background", tokens.color?.codeBackground],
371
- ["--rb-color-code-ink", tokens.color?.codeInk],
372
- ["--rb-color-code-inline", tokens.color?.codeInline],
373
- ["--rb-font-body", tokens.typography?.bodyFont],
374
- ["--rb-font-heading", tokens.typography?.headingFont],
375
- ["--rb-font-mono", tokens.typography?.monoFont],
376
- ["--rb-layout-page-max", tokens.layout?.pageMaxWidth],
377
- ["--rb-layout-article-max", tokens.layout?.articleMaxWidth],
378
- ["--rb-layout-sidebar", tokens.layout?.sidebarWidth],
379
- ["--rb-layout-gap", tokens.layout?.contentGap]
380
- ];
381
- const declarations = variables.filter((variable) => Boolean(variable[1])).map(([name, value]) => `${name}: ${value};`);
382
- return declarations.length === 0 ? "" : `:root { ${declarations.join(" ")} }`;
353
+ function getThemeStyle(theme) {
354
+ return theme.settings.style;
383
355
  }
384
- function getThemeStylesheets(userCss) {
385
- return uniqueStrings([...userCss]);
356
+ function getThemeStylesheets(stylesheets) {
357
+ return uniqueStrings([...stylesheets]);
386
358
  }
387
359
  function joinClassNames(...classNames) {
388
360
  return classNames.filter(Boolean).join(" ");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/honox",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -40,19 +40,19 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@babel/parser": "^7.29.3",
43
- "@riebeckite/core": "0.0.33",
44
- "@riebeckite/diagnostics": "0.0.33",
45
- "@riebeckite/node": "0.0.33",
46
- "@riebeckite/plugin-color-mode": "0.0.33",
47
- "@riebeckite/spa": "0.0.33",
48
- "@riebeckite/ui": "0.0.33",
43
+ "@riebeckite/core": "0.0.35",
44
+ "@riebeckite/diagnostics": "0.0.35",
45
+ "@riebeckite/node": "0.0.35",
46
+ "@riebeckite/plugin-color-mode": "0.0.35",
47
+ "@riebeckite/spa": "0.0.35",
48
+ "@riebeckite/ui": "0.0.35",
49
49
  "esbuild": "^0.28.2",
50
50
  "hono": "^4.12.25",
51
51
  "honox": "0.1.56",
52
52
  "vite": "^8.3.5"
53
53
  },
54
54
  "devDependencies": {
55
- "@riebeckite/test": "0.0.33",
55
+ "@riebeckite/test": "0.0.35",
56
56
  "tsx": "^4.22.4"
57
57
  },
58
58
  "publishConfig": {
package/style.css CHANGED
@@ -30,12 +30,11 @@
30
30
  max-width: none;
31
31
  }
32
32
 
33
- :is(:root, .rb-theme-root)[data-article-layout="full-width"] .rb-article {
33
+ :is(:root, .rb-theme-root)[data-rb-layout="full-width"] .rb-article {
34
34
  width: 100%;
35
35
  }
36
36
 
37
- :is(:root, .rb-theme-root)[data-article-layout="full-width"]
38
- .rb-article-body {
37
+ :is(:root, .rb-theme-root)[data-rb-layout="full-width"] .rb-article-body {
39
38
  max-width: none;
40
39
  }
41
40
 
@@ -52,26 +51,23 @@
52
51
  block-size: auto;
53
52
  }
54
53
 
55
- :is(:root, .rb-theme-root)[data-article-layout="full-width"]
56
- .rb-article-layout {
54
+ :is(:root, .rb-theme-root)[data-rb-layout="full-width"] .rb-article-layout {
57
55
  grid-template-columns: minmax(0, 1fr);
58
56
  }
59
57
 
60
58
  @media (min-width: 88rem) {
61
- :is(:root, .rb-theme-root)[data-article-layout="sidebar"]
62
- .rb-article-layout {
59
+ :is(:root, .rb-theme-root)[data-rb-layout="sidebar"] .rb-article-layout {
63
60
  grid-template-columns:
64
61
  minmax(0, var(--rb-layout-article-max, 48rem))
65
62
  var(--rb-layout-sidebar, 14rem);
66
63
  }
67
64
 
68
- :is(:root, .rb-theme-root)[data-article-layout="article"]
69
- .rb-article-layout {
65
+ :is(:root, .rb-theme-root)[data-rb-layout="article"] .rb-article-layout {
70
66
  position: relative;
71
67
  }
72
68
 
73
- :is(:root, .rb-theme-root)[data-article-layout="article"] .rb-article-body,
74
- :is(:root, .rb-theme-root)[data-article-layout="sidebar"] .rb-article-body {
69
+ :is(:root, .rb-theme-root)[data-rb-layout="article"] .rb-article-body,
70
+ :is(:root, .rb-theme-root)[data-rb-layout="sidebar"] .rb-article-body {
75
71
  grid-column: 1;
76
72
  grid-row: 1;
77
73
  }
@@ -209,7 +205,7 @@
209
205
  padding: 0.75rem 1rem;
210
206
  border-radius: 6px;
211
207
  background: var(--rb-color-code-background);
212
- color: var(--rb-color-ink);
208
+ color: var(--rb-color-code-ink, var(--rb-color-ink));
213
209
  font-family: var(--rb-font-mono);
214
210
  font-size: 0.875em;
215
211
  line-height: 1.7;
@@ -275,7 +271,7 @@
275
271
  border: 1px solid var(--rb-color-border);
276
272
  border-radius: 6px;
277
273
  background: var(--rb-color-code-background);
278
- color: var(--rb-color-ink);
274
+ color: var(--rb-color-code-ink, var(--rb-color-ink));
279
275
  font-size: 0.8125rem;
280
276
  }
281
277