@publier/shell 4.5.2 → 4.6.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.
@@ -10,7 +10,13 @@ interface ThemeYaml {
10
10
  name?: string;
11
11
  preset?: string;
12
12
  colors?: Record<string, string>;
13
- typography?: Record<string, string>;
13
+ typography?: {
14
+ heading?: string;
15
+ body?: string;
16
+ mono?: string;
17
+ 'body-weight'?: string | number;
18
+ 'heading-weight'?: string | number;
19
+ };
14
20
  layout?: Record<string, string>;
15
21
  prose?: Record<string, string>;
16
22
  code?: Record<string, string>;
@@ -1,2 +1,2 @@
1
- import{n as e,r as t,t as n}from"../presets-CYFX0GLA.mjs";import{tailwindComposeThemeCss as r,tailwindReadPresetCss as i,tailwindResolveTheme as a}from"@publier/native";import{fileURLToPath as o}from"node:url";const s=[`colors`,`typography`,`layout`,`prose`,`code`],c={colors:[`primary`,`primary-content`,`secondary`,`secondary-content`,`accent`,`accent-content`,`neutral`,`neutral-content`,`base-100`,`base-200`,`base-300`,`base-content`,`info`,`info-content`,`success`,`success-content`,`warning`,`warning-content`,`error`,`error-content`],typography:[`heading`,`body`,`mono`],layout:[`nav-height`,`sidebar-width`,`toc-width`,`page-max-width`],prose:[`content-gap-y`,`line-height`,`heading-line-height`],code:[`block-radius`,`inline-radius`,`inline-padding-y`,`inline-padding-x`]};function l(e){if(!e||typeof e!=`object`||Array.isArray(e))return{preset:void 0,overrides:{},overrideCss:``,errors:[]};let t=a(JSON.stringify(e));return{preset:t.preset??void 0,overrides:t.overrides,overrideCss:t.overrideCss,errors:t.errors.map(e=>({code:e.code,message:e.message,path:e.path}))}}function u(e){let t=Object.keys(e).sort();return t.length===0?``:`:root[data-theme="light"], :root[data-theme="dark"] {\n${t.map(t=>`\t${t}: ${e[t]};`).join(`
1
+ import{n as e,r as t,t as n}from"../presets-CYFX0GLA.mjs";import{tailwindComposeThemeCss as r,tailwindReadPresetCss as i,tailwindResolveTheme as a}from"@publier/native";import{fileURLToPath as o}from"node:url";const s=[`colors`,`typography`,`layout`,`prose`,`code`],c={colors:[`primary`,`primary-content`,`secondary`,`secondary-content`,`accent`,`accent-content`,`neutral`,`neutral-content`,`base-100`,`base-200`,`base-300`,`base-content`,`info`,`info-content`,`success`,`success-content`,`warning`,`warning-content`,`error`,`error-content`],typography:[`heading`,`body`,`mono`,`body-weight`,`heading-weight`],layout:[`nav-height`,`sidebar-width`,`toc-width`,`page-max-width`],prose:[`content-gap-y`,`line-height`,`heading-line-height`],code:[`block-radius`,`inline-radius`,`inline-padding-y`,`inline-padding-x`]};function l(e){if(!e||typeof e!=`object`||Array.isArray(e))return{preset:void 0,overrides:{},overrideCss:``,errors:[]};let t=a(JSON.stringify(e));return{preset:t.preset??void 0,overrides:t.overrides,overrideCss:t.overrideCss,errors:t.errors.map(e=>({code:e.code,message:e.message,path:e.path}))}}function u(e){let t=Object.keys(e).sort();return t.length===0?``:`:root[data-theme="light"], :root[data-theme="dark"] {\n${t.map(t=>`\t${t}: ${e[t]};`).join(`
2
2
  `)}\n}\n`}function d(e,t){let n=l(e),r=t.defaultPreset;return n.preset!==void 0&&(t.isValidPreset(n.preset)?r=n.preset:n.errors.push({code:`unknown-preset`,message:`Unknown preset "${n.preset}". Theme will fall back to "${t.defaultPreset}".`,path:`preset`})),{...n,preset:r}}function f(e,t){return r(e,t)}const p=o(new URL(`./themes/`,import.meta.url));function m(e){return`${p}${e}.css`}async function h(e){return i(p,e)}export{n as AVAILABLE_THEMES,c as THEME_KEYS,s as THEME_SECTIONS,f as composeThemeCss,e as isValidPreset,t as listPresets,h as loadPresetCss,m as presetPath,u as renderOverrideCss,l as resolveTheme,d as resolveThemeWithPreset};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@publier/shell",
3
- "version": "4.5.2",
3
+ "version": "4.6.1",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Qwik + Astro docs layout for Publier sites.",
6
6
  "type": "module",
@@ -119,7 +119,7 @@
119
119
  "@github/details-menu-element": "^1.0.13",
120
120
  "@github/relative-time-element": "^5.3.1",
121
121
  "@github/tab-container-element": "^4.9.0",
122
- "@publier/native": "8.0.0",
122
+ "@publier/native": "8.0.2",
123
123
  "@tailwindcss/typography": "^0.5.20",
124
124
  "astro-pagefind": "^2.0.1",
125
125
  "daisyui": "^5.7.22",
@@ -25,7 +25,7 @@ const visualOrder = reverse ? 'md:order-first' : '';
25
25
  ---
26
26
 
27
27
  <section class={`py-14 md:py-20 ${cls ?? ''}`}>
28
- <div class="max-w-6xl mx-auto px-6 grid gap-10 md:grid-cols-2 md:items-center">
28
+ <div class="max-w-6xl mx-auto px-6 grid grid-cols-1 gap-10 md:grid-cols-2 md:items-center">
29
29
  <div>
30
30
  {eyebrow && (
31
31
  <span class="badge badge-outline badge-primary">{eyebrow}</span>
@@ -83,6 +83,7 @@ h3,
83
83
  h4,
84
84
  h5,
85
85
  h6 {
86
+ font-family: var(--publier-font-heading, var(--font-body));
86
87
  font-weight: var(--publier-font-weight-heading, 700);
87
88
  }
88
89
 
@@ -129,15 +130,43 @@ h6 {
129
130
  * H2s without needing a separate display font. */
130
131
  .prose {
131
132
  font-size: 1.125rem;
132
- line-height: 1.7;
133
+ line-height: var(--publier-prose-line-height, 1.7);
133
134
  }
134
- .prose > :where(h1):not(:where([class~="not-prose"] *)) {
135
+ .prose > :where(h1):not(:where(.not-prose, [class~="not-prose"] *)) {
135
136
  font-size: 2.25rem;
136
137
  font-weight: var(--publier-font-weight-heading, 800);
137
- line-height: 1.15;
138
+ line-height: var(--publier-prose-heading-line-height, 1.15);
138
139
  }
139
- .prose > :where(p):not(:where([class~="not-prose"] *)) {
140
- line-height: 1.7;
140
+ .prose > :where(p):not(:where(.not-prose, [class~="not-prose"] *)) {
141
+ line-height: var(--publier-prose-line-height, 1.7);
142
+ }
143
+
144
+ /* Keep typography's per-element rhythm when no override is supplied. The
145
+ * separate layer lets revert-layer recover those defaults without copying them. */
146
+ @layer publier-theme {
147
+ .prose :where(h1, h2, h3, h4, h5, h6):not(:where(.not-prose, [class~="not-prose"] *)) {
148
+ line-height: var(--publier-prose-heading-line-height, revert-layer);
149
+ }
150
+ .prose > :where(:not(:first-child)):not(:where(.not-prose, [class~="not-prose"] *)) {
151
+ margin-block-start: var(--publier-prose-content-gap-y, revert-layer);
152
+ }
153
+ .prose > :where(:not(:last-child)):not(:where(.not-prose, [class~="not-prose"] *)) {
154
+ margin-block-end: var(--publier-prose-content-gap-y, revert-layer);
155
+ }
156
+ .prose :where(code):not(:where(pre code, .not-prose, [class~="not-prose"] *)) {
157
+ border-radius: var(--publier-code-inline-radius, revert-layer);
158
+ padding-block: var(--publier-code-inline-padding-y, revert-layer);
159
+ padding-inline: var(--publier-code-inline-padding-x, revert-layer);
160
+ }
161
+ .prose :where(pre):not(:where(.not-prose, [class~="not-prose"] *)) {
162
+ border-radius: var(--publier-code-block-radius, revert-layer);
163
+ }
164
+ }
165
+
166
+ /* Typography sets heading weights inside .prose; keep the shared font contract. */
167
+ .prose :where(h1, h2, h3, h4, h5, h6):not(:where(.not-prose, [class~="not-prose"] *)) {
168
+ font-family: var(--publier-font-heading, var(--font-body));
169
+ font-weight: var(--publier-font-weight-heading, 700);
141
170
  }
142
171
 
143
172
  /* ─── Top-nav active link — brand-tinted highlight ─────────
@@ -738,6 +767,14 @@ header.alert[data-publier-banner] [data-publier-banner-dismiss] {
738
767
  }
739
768
 
740
769
  /* Documentation uses one primary header row; selectors and sections sit beside the brand. */
770
+ [data-publier-top-nav] > .navbar {
771
+ min-height: var(--publier-nav-height, 4rem);
772
+ }
773
+ @media (width >= 80rem) {
774
+ aside[aria-label="Table of contents"] {
775
+ width: var(--publier-toc-width, 14rem);
776
+ }
777
+ }
741
778
  [data-publier-docs-header] .navbar-start {
742
779
  flex: 0 0 auto;
743
780
  width: auto;
@@ -771,11 +808,11 @@ header.alert[data-publier-banner] [data-publier-banner-dismiss] {
771
808
  }
772
809
  [data-publier-docs-sidebar],
773
810
  aside[aria-label="Table of contents"] {
774
- top: var(--publier-header-height, 4rem);
775
- max-height: calc(100vh - var(--publier-header-height, 4rem));
811
+ top: var(--publier-header-height, var(--publier-nav-height, 4rem));
812
+ max-height: calc(100vh - var(--publier-header-height, var(--publier-nav-height, 4rem)));
776
813
  }
777
- body:has([data-publier-docs-header]) :is(h2, h3, h4)[id] {
778
- scroll-margin-top: calc(var(--publier-header-height, 4rem) + 1rem);
814
+ body:has([data-publier-docs-header]) :is(h1, h2, h3, h4, h5, h6)[id] {
815
+ scroll-margin-top: calc(var(--publier-header-height, var(--publier-nav-height, 4rem)) + 1rem);
779
816
  }
780
817
 
781
818
  /* Header controls remain stationary while the disclosure indicator changes. */
@@ -12,12 +12,14 @@
12
12
  */
13
13
 
14
14
  .expressive-code {
15
+ --ec-brdRad: var(--publier-code-block-radius, 0.3rem);
16
+
15
17
  /* Frame border — daisyUI base-300 plays the border role */
16
- --ec-borderColor: var(--color-base-300);
18
+ --ec-brdCol: var(--color-base-300);
17
19
 
18
20
  /* Tab bar background — subdued surface */
19
- --ec-frm-tabBarBg: var(--color-base-300);
20
- --ec-frm-tabBarBorderBottomColor: var(--color-base-300);
21
+ --ec-frm-edTabBarBg: var(--color-base-300);
22
+ --ec-frm-edTabBarBrdCol: var(--color-base-300);
21
23
 
22
24
  /* Code area background — left to EC's own per-theme value.
23
25
  *
@@ -36,6 +38,6 @@
36
38
  * and binds it to `--font-sans` via the Fonts API). Customers can
37
39
  * still override at the theme level via `--publier-font-body` /
38
40
  * `--publier-font-mono`. */
39
- --ec-codeFontFamily: var(--publier-font-mono, var(--font-mono));
40
- --ec-uiFontFamily: var(--publier-font-body, var(--font-sans));
41
+ --ec-codeFontFml: var(--publier-font-mono, var(--font-mono));
42
+ --ec-uiFontFml: var(--publier-font-body, var(--font-sans));
41
43
  }
@@ -16,6 +16,8 @@
16
16
  * to Tailwind utilities via the `@theme` block.
17
17
  */
18
18
 
19
+ @layer theme, base, components, utilities, publier-theme;
20
+
19
21
  @plugin "daisyui" {
20
22
  themes: false;
21
23
  }