@writedocs/generator 0.10.19 → 0.11.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.
Files changed (59) hide show
  1. package/astro.config.mjs +32 -8
  2. package/package.json +96 -93
  3. package/src/cli/base-path-layout.js +44 -0
  4. package/src/cli/build.js +177 -168
  5. package/src/cli/check-built-styles.js +41 -33
  6. package/src/cli/dev.js +261 -244
  7. package/src/cli/generate-api-pages.js +9 -5
  8. package/src/cli/page-list-watch.js +69 -66
  9. package/src/cli/run-pagefind.js +154 -148
  10. package/src/cli/write-mcp-files.js +103 -96
  11. package/src/cli/write-redirects-file.js +25 -8
  12. package/src/components/AppIcon.astro +51 -50
  13. package/src/components/Card.astro +193 -192
  14. package/src/components/CopyPageMenu.astro +374 -370
  15. package/src/components/Hint.astro +188 -187
  16. package/src/components/Icon.astro +72 -71
  17. package/src/components/Image.astro +165 -164
  18. package/src/components/Tile.astro +67 -66
  19. package/src/components/Video.astro +137 -136
  20. package/src/layout/BaseLayout.astro +21 -12
  21. package/src/layout/components/AnalyticsScripts.astro +6 -2
  22. package/src/layout/components/Breadcrumbs.astro +98 -97
  23. package/src/layout/components/ConsentBanner.astro +119 -118
  24. package/src/layout/components/MobileMenu.astro +229 -228
  25. package/src/layout/components/NavTree.astro +393 -392
  26. package/src/layout/components/Sidebar.astro +232 -231
  27. package/src/layout/components/SiteFooter.astro +87 -86
  28. package/src/layout/components/TopBar.astro +386 -385
  29. package/src/lib/agent-markdown.js +164 -162
  30. package/src/lib/asset-dimensions.js +89 -0
  31. package/src/lib/base-path.js +90 -0
  32. package/src/lib/config-schema.js +10 -0
  33. package/src/lib/config-schema.ts +17 -0
  34. package/src/lib/config.ts +1314 -1289
  35. package/src/lib/consent.js +108 -102
  36. package/src/lib/image-size.js +152 -140
  37. package/src/lib/json-schema-descriptions.js +1 -0
  38. package/src/lib/link-check.js +42 -4
  39. package/src/lib/llms-index.ts +90 -88
  40. package/src/lib/mcp-dev-integration.js +65 -60
  41. package/src/lib/mcp-index.ts +102 -101
  42. package/src/lib/pages.js +312 -304
  43. package/src/lib/project-files-integration.js +116 -61
  44. package/src/lib/project-files.js +137 -126
  45. package/src/lib/project-ignore.js +46 -0
  46. package/src/lib/rehype-base-path.js +62 -0
  47. package/src/lib/rehype-image-loading.js +71 -71
  48. package/src/lib/robots-txt.js +21 -16
  49. package/src/lib/seo-tags.js +155 -140
  50. package/src/lib/site-base.ts +27 -0
  51. package/src/lib/styles-asset-integration.js +58 -12
  52. package/src/lib/wdignore-cases.json +195 -0
  53. package/src/lib/wdignore.js +177 -0
  54. package/src/pages/404.astro +63 -62
  55. package/src/pages/[...slug].astro +1604 -1597
  56. package/src/pages/[...slug].md.ts +93 -93
  57. package/src/pages/llms-full.txt.ts +88 -86
  58. package/src/scripts/search.ts +241 -237
  59. package/writedocs.schema.json +6 -0
@@ -1,164 +1,165 @@
1
- ---
2
- import { extraClasses } from './class-names';
3
- import { imageFileFor, imageSize } from '../lib/image-size.js';
4
- // Block-level (own line, centered) - unlike Hint (inline/text-level),
5
- // this is meant to be dropped in on its own the way Callout/Card are.
6
- //
7
- // src/srcDark render as two separate <img> tags, both always in the
8
- // markup, CSS shows only the one matching the active [data-theme] - the
9
- // exact same dual light/dark-asset pattern base.css's own .wd-logo-light/
10
- // .wd-logo-dark rules already establish for TopBar/MobileMenu/SiteFooter's
11
- // logo (see that comment there) - base.css's own comment on those rules
12
- // spells out exactly why they get to write [data-theme='dark'] .wd-logo-x
13
- // completely unscoped: base.css is a *plain imported* .css file, never run
14
- // through Astro's scoped-CSS compiler at all, unlike this component's own
15
- // <style> block below. [data-theme] lives on <html>, set by BaseLayout's
16
- // anti-FOUC script - nowhere near this component's own template - so
17
- // inside a *scoped* <style> (this one) that ancestor selector has to be
18
- // wrapped in :global() or Astro's compiler appends this component's own
19
- // scope attribute onto it too, requiring <html> to carry that attribute,
20
- // which it never will. .wd-image-light/.wd-image-dark themselves don't
21
- // need :global() - unlike AppIcon-rendered markup (Card/Accordion's own
22
- // icon rules), both <img> tags here are rendered directly by *this*
23
- // component's own template, so they already carry its scope attribute
24
- // normally.
25
- interface Props {
26
- src: string;
27
- srcDark?: string;
28
- // Width at full (unconstrained) viewport width - a raw CSS length or
29
- // percentage string ("80%", "480px", "40rem", ...), passed straight
30
- // through as a custom property with no parsing/validation, the same
31
- // "trust the site author, this is their writedocs.json/content" latitude
32
- // every other pass-through string prop here already gets (Card's
33
- // icon, Callout's title, ...). Applied to the *figure* (see below),
34
- // not the <img> tags directly - an earlier version set it on the img
35
- // instead, which left the figure itself (and, when caption is set,
36
- // its whole bordered card) always full-width regardless of `size`,
37
- // so a size="70%" image ended up sitting inside a card twice as wide
38
- // as it needed to be, with a large empty gap on both sides - caught
39
- // via a real screenshot showing exactly that gap. max-width: 100%
40
- // below is what actually makes this shrink on a narrower viewport
41
- // instead of overflowing it, regardless of which form `size` takes -
42
- // a percentage already scales with its container on its own, but a
43
- // fixed px/rem value doesn't, and needs that separate cap to behave
44
- // the same way.
45
- size?: string;
46
- alt?: string;
47
- // Optional caption shown below the image. Set it and the whole thing
48
- // gains the same bordered/rounded "card" background Frame's own
49
- // caption case uses (border + background + padding, image inset
50
- // inside it) - deliberately conditional on caption being set rather
51
- // than always-on: without a caption this needs to render exactly as
52
- // it always has (a plain image, no chrome), so an existing
53
- // <Image src="..." /> with no caption keeps its current look with
54
- // zero visual change - only opting a page into the card look actually
55
- // opts it in.
56
- caption?: string;
57
- // Opts this image out of the site-wide click-to-zoom lightbox (see
58
- // src/scripts/image-zoom.ts) - rendered as a bare `nozoom` attribute
59
- // on both <img> tags, the same attribute a raw
60
- // `<img nozoom src="..." />` written directly in MDX would carry, so
61
- // lib/image-zoom-rules.js handles both cases identically rather than
62
- // needing to special-case this component.
63
- noZoom?: boolean;
64
- // "lazy" (the default): the browser fetches the image when the reader
65
- // gets near it. "eager": with the page - for an image at the very top.
66
- // The page's first image gets "eager" by itself
67
- // (lib/rehype-image-loading.js).
68
- loading?: "lazy" | "eager";
69
- }
70
- const { src, srcDark, size, alt = "", caption, noZoom, loading = "lazy" } = Astro.props as Props;
71
- // Each file's own pixel size, as width/height: the browser keeps the
72
- // image's place before it arrives, so the text below doesn't jump. The
73
- // CSS below already has height: auto, so the image still scales.
74
- const contentDir = process.env.WRITEDOCS_CONTENT_DIR || process.cwd();
75
- const sizeOf = (address?: string) => {
76
- const file = address ? imageFileFor(address, contentDir) : null;
77
- return (file && imageSize(file)) || { width: undefined, height: undefined };
78
- };
79
- const light = sizeOf(src);
80
- const dark = sizeOf(srcDark);
81
- const sizeStyle = size ? `--wd-image-size:${size}` : undefined;
82
- ---
83
-
84
- <figure
85
- class:list={["wd-image-figure", caption && "wd-image-figure-framed", srcDark && "wd-image-has-dark", extraClasses(Astro.props)]}
86
- style={sizeStyle}
87
- >
88
- <img src={src} alt={alt} class="wd-image wd-image-light" nozoom={noZoom || undefined} loading={loading} decoding="async" width={light.width} height={light.height} />
89
- {srcDark && <img src={srcDark} alt={alt} class="wd-image wd-image-dark" nozoom={noZoom || undefined} loading={loading} decoding="async" width={dark.width} height={dark.height} />}
90
- {caption && <figcaption class="wd-image-caption">{caption}</figcaption>}
91
- </figure>
92
- <style>
93
- /* width: var(--wd-image-size, 100%) here (not on the img - see the
94
- `size` prop's own comment above) is what makes the *whole figure*,
95
- card background and all, actually match the image's own size
96
- instead of always spanning the full content column. margin: ...
97
- auto only has anything to center once this has a definite width
98
- smaller than its container - at the 100% default it's a no-op,
99
- same as before this prop existed. */
100
- .wd-image-figure {
101
- width: var(--wd-image-size, 100%);
102
- max-width: 100%;
103
- margin: 1.25rem auto;
104
- }
105
- /* Same card language as Frame's own bordered case (border + rounded +
106
- surface background + padding) - deliberately duplicated here rather
107
- than shared, the same way Card/Callout/Accordion each carry their
108
- own near-identical CSS rather than a shared base class; Astro's
109
- scoped <style> blocks are per-component anyway, so there's no
110
- lighter-weight way to share this without introducing a global
111
- stylesheet dependency neither component otherwise needs. Padding
112
- is what creates the "image inset within the card" look - the img's
113
- own width: 100% below resolves against this padded content box,
114
- not the figure's own outer edge.
115
- box-shadow is a deliberate belt-and-suspenders addition on top of
116
- the border - var(--wd-border)/var(--wd-surface) are both very
117
- light, low-contrast tokens by default (see BaseLayout.astro's own
118
- --wd-border/--wd-surface light-mode values), so on a page whose own
119
- background is similarly pale (or, worse, uses the literal same
120
- image asset as its background - confirmed as the actual root cause
121
- of a real earlier "the card is invisible" report), the border alone
122
- can end up nearly imperceptible even though it's genuinely being
123
- applied. A soft shadow gives the card a second, independent visual
124
- cue that doesn't depend on border/surface contrast against
125
- whatever the page happens to look like. */
126
- .wd-image-figure-framed {
127
- border: 1px solid var(--wd-border);
128
- border-radius: 0.75rem;
129
- background: var(--wd-surface);
130
- padding: 0.5rem;
131
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
132
- }
133
- .wd-image {
134
- display: block;
135
- width: 100%;
136
- height: auto;
137
- border-radius: 0.75rem;
138
- }
139
- .wd-image-dark {
140
- display: none;
141
- }
142
- /* .wd-image-light only hides in dark mode when a dark variant is
143
- actually there to replace it - .wd-image-has-dark only gets added
144
- to the figure when srcDark is set (see the frontmatter above); with
145
- no srcDark, there's no second <img> in the markup at all, so
146
- unconditionally hiding the light one (an earlier version of this
147
- rule had no such scoping) left dark mode with literally nothing to
148
- show - a real user report caught exactly that: light-only Image
149
- usages went blank in dark mode instead of just keeping the one
150
- image they had, same as base.css's own dual-logo comment already
151
- notes for a site that only configures one logo. */
152
- :global([data-theme="dark"]) .wd-image-figure.wd-image-has-dark .wd-image-light {
153
- display: none;
154
- }
155
- :global([data-theme="dark"]) .wd-image-dark {
156
- display: block;
157
- }
158
- .wd-image-caption {
159
- margin-top: 0.6rem;
160
- text-align: center;
161
- color: var(--wd-text);
162
- font-size: 0.75rem;
163
- }
164
- </style>
1
+ ---
2
+ import { extraClasses } from './class-names';
3
+ import { imageFileFor, imageSize } from '../lib/image-size.js';
4
+ import { siteHref } from '../lib/site-base';
5
+ // Block-level (own line, centered) - unlike Hint (inline/text-level),
6
+ // this is meant to be dropped in on its own the way Callout/Card are.
7
+ //
8
+ // src/srcDark render as two separate <img> tags, both always in the
9
+ // markup, CSS shows only the one matching the active [data-theme] - the
10
+ // exact same dual light/dark-asset pattern base.css's own .wd-logo-light/
11
+ // .wd-logo-dark rules already establish for TopBar/MobileMenu/SiteFooter's
12
+ // logo (see that comment there) - base.css's own comment on those rules
13
+ // spells out exactly why they get to write [data-theme='dark'] .wd-logo-x
14
+ // completely unscoped: base.css is a *plain imported* .css file, never run
15
+ // through Astro's scoped-CSS compiler at all, unlike this component's own
16
+ // <style> block below. [data-theme] lives on <html>, set by BaseLayout's
17
+ // anti-FOUC script - nowhere near this component's own template - so
18
+ // inside a *scoped* <style> (this one) that ancestor selector has to be
19
+ // wrapped in :global() or Astro's compiler appends this component's own
20
+ // scope attribute onto it too, requiring <html> to carry that attribute,
21
+ // which it never will. .wd-image-light/.wd-image-dark themselves don't
22
+ // need :global() - unlike AppIcon-rendered markup (Card/Accordion's own
23
+ // icon rules), both <img> tags here are rendered directly by *this*
24
+ // component's own template, so they already carry its scope attribute
25
+ // normally.
26
+ interface Props {
27
+ src: string;
28
+ srcDark?: string;
29
+ // Width at full (unconstrained) viewport width - a raw CSS length or
30
+ // percentage string ("80%", "480px", "40rem", ...), passed straight
31
+ // through as a custom property with no parsing/validation, the same
32
+ // "trust the site author, this is their writedocs.json/content" latitude
33
+ // every other pass-through string prop here already gets (Card's
34
+ // icon, Callout's title, ...). Applied to the *figure* (see below),
35
+ // not the <img> tags directly - an earlier version set it on the img
36
+ // instead, which left the figure itself (and, when caption is set,
37
+ // its whole bordered card) always full-width regardless of `size`,
38
+ // so a size="70%" image ended up sitting inside a card twice as wide
39
+ // as it needed to be, with a large empty gap on both sides - caught
40
+ // via a real screenshot showing exactly that gap. max-width: 100%
41
+ // below is what actually makes this shrink on a narrower viewport
42
+ // instead of overflowing it, regardless of which form `size` takes -
43
+ // a percentage already scales with its container on its own, but a
44
+ // fixed px/rem value doesn't, and needs that separate cap to behave
45
+ // the same way.
46
+ size?: string;
47
+ alt?: string;
48
+ // Optional caption shown below the image. Set it and the whole thing
49
+ // gains the same bordered/rounded "card" background Frame's own
50
+ // caption case uses (border + background + padding, image inset
51
+ // inside it) - deliberately conditional on caption being set rather
52
+ // than always-on: without a caption this needs to render exactly as
53
+ // it always has (a plain image, no chrome), so an existing
54
+ // <Image src="..." /> with no caption keeps its current look with
55
+ // zero visual change - only opting a page into the card look actually
56
+ // opts it in.
57
+ caption?: string;
58
+ // Opts this image out of the site-wide click-to-zoom lightbox (see
59
+ // src/scripts/image-zoom.ts) - rendered as a bare `nozoom` attribute
60
+ // on both <img> tags, the same attribute a raw
61
+ // `<img nozoom src="..." />` written directly in MDX would carry, so
62
+ // lib/image-zoom-rules.js handles both cases identically rather than
63
+ // needing to special-case this component.
64
+ noZoom?: boolean;
65
+ // "lazy" (the default): the browser fetches the image when the reader
66
+ // gets near it. "eager": with the page - for an image at the very top.
67
+ // The page's first image gets "eager" by itself
68
+ // (lib/rehype-image-loading.js).
69
+ loading?: "lazy" | "eager";
70
+ }
71
+ const { src, srcDark, size, alt = "", caption, noZoom, loading = "lazy" } = Astro.props as Props;
72
+ // Each file's own pixel size, as width/height: the browser keeps the
73
+ // image's place before it arrives, so the text below doesn't jump. The
74
+ // CSS below already has height: auto, so the image still scales.
75
+ const contentDir = process.env.WRITEDOCS_CONTENT_DIR || process.cwd();
76
+ const sizeOf = (address?: string) => {
77
+ const file = address ? imageFileFor(address, contentDir) : null;
78
+ return (file && imageSize(file, contentDir)) || { width: undefined, height: undefined };
79
+ };
80
+ const light = sizeOf(src);
81
+ const dark = sizeOf(srcDark);
82
+ const sizeStyle = size ? `--wd-image-size:${size}` : undefined;
83
+ ---
84
+
85
+ <figure
86
+ class:list={["wd-image-figure", caption && "wd-image-figure-framed", srcDark && "wd-image-has-dark", extraClasses(Astro.props)]}
87
+ style={sizeStyle}
88
+ >
89
+ <img src={siteHref(src)} alt={alt} class="wd-image wd-image-light" nozoom={noZoom || undefined} loading={loading} decoding="async" width={light.width} height={light.height} />
90
+ {srcDark && <img src={siteHref(srcDark)} alt={alt} class="wd-image wd-image-dark" nozoom={noZoom || undefined} loading={loading} decoding="async" width={dark.width} height={dark.height} />}
91
+ {caption && <figcaption class="wd-image-caption">{caption}</figcaption>}
92
+ </figure>
93
+ <style>
94
+ /* width: var(--wd-image-size, 100%) here (not on the img - see the
95
+ `size` prop's own comment above) is what makes the *whole figure*,
96
+ card background and all, actually match the image's own size
97
+ instead of always spanning the full content column. margin: ...
98
+ auto only has anything to center once this has a definite width
99
+ smaller than its container - at the 100% default it's a no-op,
100
+ same as before this prop existed. */
101
+ .wd-image-figure {
102
+ width: var(--wd-image-size, 100%);
103
+ max-width: 100%;
104
+ margin: 1.25rem auto;
105
+ }
106
+ /* Same card language as Frame's own bordered case (border + rounded +
107
+ surface background + padding) - deliberately duplicated here rather
108
+ than shared, the same way Card/Callout/Accordion each carry their
109
+ own near-identical CSS rather than a shared base class; Astro's
110
+ scoped <style> blocks are per-component anyway, so there's no
111
+ lighter-weight way to share this without introducing a global
112
+ stylesheet dependency neither component otherwise needs. Padding
113
+ is what creates the "image inset within the card" look - the img's
114
+ own width: 100% below resolves against this padded content box,
115
+ not the figure's own outer edge.
116
+ box-shadow is a deliberate belt-and-suspenders addition on top of
117
+ the border - var(--wd-border)/var(--wd-surface) are both very
118
+ light, low-contrast tokens by default (see BaseLayout.astro's own
119
+ --wd-border/--wd-surface light-mode values), so on a page whose own
120
+ background is similarly pale (or, worse, uses the literal same
121
+ image asset as its background - confirmed as the actual root cause
122
+ of a real earlier "the card is invisible" report), the border alone
123
+ can end up nearly imperceptible even though it's genuinely being
124
+ applied. A soft shadow gives the card a second, independent visual
125
+ cue that doesn't depend on border/surface contrast against
126
+ whatever the page happens to look like. */
127
+ .wd-image-figure-framed {
128
+ border: 1px solid var(--wd-border);
129
+ border-radius: 0.75rem;
130
+ background: var(--wd-surface);
131
+ padding: 0.5rem;
132
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
133
+ }
134
+ .wd-image {
135
+ display: block;
136
+ width: 100%;
137
+ height: auto;
138
+ border-radius: 0.75rem;
139
+ }
140
+ .wd-image-dark {
141
+ display: none;
142
+ }
143
+ /* .wd-image-light only hides in dark mode when a dark variant is
144
+ actually there to replace it - .wd-image-has-dark only gets added
145
+ to the figure when srcDark is set (see the frontmatter above); with
146
+ no srcDark, there's no second <img> in the markup at all, so
147
+ unconditionally hiding the light one (an earlier version of this
148
+ rule had no such scoping) left dark mode with literally nothing to
149
+ show - a real user report caught exactly that: light-only Image
150
+ usages went blank in dark mode instead of just keeping the one
151
+ image they had, same as base.css's own dual-logo comment already
152
+ notes for a site that only configures one logo. */
153
+ :global([data-theme="dark"]) .wd-image-figure.wd-image-has-dark .wd-image-light {
154
+ display: none;
155
+ }
156
+ :global([data-theme="dark"]) .wd-image-dark {
157
+ display: block;
158
+ }
159
+ .wd-image-caption {
160
+ margin-top: 0.6rem;
161
+ text-align: center;
162
+ color: var(--wd-text);
163
+ font-size: 0.75rem;
164
+ }
165
+ </style>
@@ -1,66 +1,67 @@
1
- ---
2
- import { extraClasses } from './class-names';
3
- // Mintlify's <Tile> - a visual preview (the slot, usually an image or a
4
- // light/dark image pair) on a patterned background, with a title and
5
- // description under it. Usually laid out in a <Columns> grid. `title`
6
- // takes inline Markdown (`code`, **bold**, *italic*), like Mintlify's.
7
- import { inlineMarkdown } from '../lib/inline-markdown.js';
8
-
9
- interface Props {
10
- href?: string;
11
- title?: string;
12
- description?: string;
13
- }
14
- const { href, title, description } = Astro.props as Props;
15
- const Tag = href ? 'a' : 'div';
16
- ---
17
- <Tag class:list={["wd-tile", extraClasses(Astro.props)]} href={href}>
18
- <div class="wd-tile-preview"><slot /></div>
19
- {title && <div class="wd-tile-title" set:html={inlineMarkdown(title)} />}
20
- {description && <div class="wd-tile-description">{description}</div>}
21
- </Tag>
22
- <style>
23
- .wd-tile {
24
- display: block;
25
- text-decoration: none;
26
- color: inherit;
27
- }
28
- /* Dotted pattern behind the preview, drawn from the theme's own border
29
- color so it reads in both themes. */
30
- .wd-tile-preview {
31
- display: flex;
32
- align-items: center;
33
- justify-content: center;
34
- height: 10rem;
35
- overflow: hidden;
36
- border: 1px solid var(--wd-border);
37
- border-radius: 0.6rem;
38
- background-color: var(--wd-surface);
39
- background-image: radial-gradient(var(--wd-border) 1px, transparent 1px);
40
- background-size: 14px 14px;
41
- transition: border-color 0.15s ease;
42
- }
43
- a.wd-tile:hover .wd-tile-preview {
44
- border-color: var(--wd-primary);
45
- }
46
- .wd-tile-preview :global(img),
47
- .wd-tile-preview :global(svg) {
48
- max-width: 100%;
49
- max-height: 100%;
50
- object-fit: contain;
51
- margin: 0;
52
- }
53
- .wd-tile-preview :global(p) {
54
- display: contents;
55
- }
56
- .wd-tile-title {
57
- margin-top: 0.6rem;
58
- font-weight: 600;
59
- color: var(--wd-heading);
60
- }
61
- .wd-tile-description {
62
- margin-top: 0.15rem;
63
- font-size: 0.875rem;
64
- color: var(--wd-text);
65
- }
66
- </style>
1
+ ---
2
+ import { extraClasses } from './class-names';
3
+ // Mintlify's <Tile> - a visual preview (the slot, usually an image or a
4
+ // light/dark image pair) on a patterned background, with a title and
5
+ // description under it. Usually laid out in a <Columns> grid. `title`
6
+ // takes inline Markdown (`code`, **bold**, *italic*), like Mintlify's.
7
+ import { inlineMarkdown } from '../lib/inline-markdown.js';
8
+ import { siteHref } from '../lib/site-base';
9
+
10
+ interface Props {
11
+ href?: string;
12
+ title?: string;
13
+ description?: string;
14
+ }
15
+ const { href, title, description } = Astro.props as Props;
16
+ const Tag = href ? 'a' : 'div';
17
+ ---
18
+ <Tag class:list={["wd-tile", extraClasses(Astro.props)]} href={siteHref(href)}>
19
+ <div class="wd-tile-preview"><slot /></div>
20
+ {title && <div class="wd-tile-title" set:html={inlineMarkdown(title)} />}
21
+ {description && <div class="wd-tile-description">{description}</div>}
22
+ </Tag>
23
+ <style>
24
+ .wd-tile {
25
+ display: block;
26
+ text-decoration: none;
27
+ color: inherit;
28
+ }
29
+ /* Dotted pattern behind the preview, drawn from the theme's own border
30
+ color so it reads in both themes. */
31
+ .wd-tile-preview {
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ height: 10rem;
36
+ overflow: hidden;
37
+ border: 1px solid var(--wd-border);
38
+ border-radius: 0.6rem;
39
+ background-color: var(--wd-surface);
40
+ background-image: radial-gradient(var(--wd-border) 1px, transparent 1px);
41
+ background-size: 14px 14px;
42
+ transition: border-color 0.15s ease;
43
+ }
44
+ a.wd-tile:hover .wd-tile-preview {
45
+ border-color: var(--wd-primary);
46
+ }
47
+ .wd-tile-preview :global(img),
48
+ .wd-tile-preview :global(svg) {
49
+ max-width: 100%;
50
+ max-height: 100%;
51
+ object-fit: contain;
52
+ margin: 0;
53
+ }
54
+ .wd-tile-preview :global(p) {
55
+ display: contents;
56
+ }
57
+ .wd-tile-title {
58
+ margin-top: 0.6rem;
59
+ font-weight: 600;
60
+ color: var(--wd-heading);
61
+ }
62
+ .wd-tile-description {
63
+ margin-top: 0.15rem;
64
+ font-size: 0.875rem;
65
+ color: var(--wd-text);
66
+ }
67
+ </style>