@tenphi/cookbook 0.18.0 → 0.18.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.
@@ -36,6 +36,9 @@ its complete base styles using Tasty's `mergeStyles`. Do not copy the entire
36
36
  default style tree or rebuild it in user configuration. Built-in names belong
37
37
  in `theme.styles`; custom names belong in `theme.customStyles`.
38
38
 
39
+ This merge happens before CSS extraction, so built-in appearance changes do not
40
+ need a second stylesheet or `!important` rules to override default declarations.
41
+
39
42
  ```ts
40
43
  import { defineDocsConfig } from "@tenphi/cookbook/config";
41
44
 
package/docs/index.md CHANGED
@@ -40,6 +40,18 @@ Broken links, missing assets, duplicate routes, invalid navigation, and unsafe
40
40
  paths fail with source locations. The result is prerendered HTML and CSS ready
41
41
  for GitHub Pages or any static host.
42
42
 
43
+ ### Styling that fits your product
44
+
45
+ Glaze turns a brand and semantic palette into light, dark, and high-contrast
46
+ colors with contrast targets. Tasty applies those color roles alongside shared
47
+ tokens and typography presets, so the docs can follow your design system.
48
+ State maps keep hover, focus, and responsive values beside the styles they
49
+ change. Partial `theme.styles` overrides merge before CSS extraction, letting
50
+ you adjust supported components without selector chains or `!important`.
51
+ The browser receives static CSS, with no Tasty or Glaze styling runtime.
52
+ See the [theme reference](./theme-and-components.md) for the palette, presets,
53
+ states, and named component styles.
54
+
43
55
  ## Choose a path
44
56
 
45
57
  | I want to… | Start here | Then read |
@@ -357,6 +357,53 @@ bridge. Customize either kind by name under `theme.styles`; the configuration
357
357
  is resolved before CSS generation, so this is not a selector-based CSS
358
358
  override.
359
359
 
360
+ > **Direct styles, without a specificity battle.** Cookbook merges your partial
361
+ > style object with the component's base styles before Tasty extracts CSS. The
362
+ > generated stylesheet reflects that result; changing a supported property
363
+ > does not add a competing rule just to beat the original. You can customize
364
+ > existing elements without long selectors or `!important`.
365
+
366
+ Start with the area you want to change, then use the complete sub-element table
367
+ below to find its exact anatomy:
368
+
369
+ | Page area | Style names to inspect |
370
+ | ----------------------------- | ------------------------------------------------------------------------------------ |
371
+ | Header, title, and navigation | `HeaderFrame`, `StarlightHeader`, `SiteLogo`, `HeaderLinks`, `TopNavigation` |
372
+ | Sidebar and mobile menu | `Sidebar`, `MobileMenuToggle`, `MobileNavigationTabs`, `MobileMenuFooter` |
373
+ | Article text and headings | `Markdown`, `MarkdownHeading`, `Heading`, `MainContent` |
374
+ | Code and diagrams | `MarkdownCodeBlock`, `MarkdownInlineCode`, `SyntaxHighlight`, `CodeGroup`, `Mermaid` |
375
+ | Search | `SearchButton`, `Search`, `SearchResults` |
376
+ | Table of contents | `TableOfContents`, `MobileTableOfContents`, `TableOfContentsLayout` |
377
+ | Cards, notes, and tabs | `Card`, `StarlightCard`, `StarlightAside`, `Tabs` |
378
+ | Footer and page controls | `Footer`, `Pagination`, `PageActions`, `ThemeSelect` |
379
+
380
+ For example, this changes a typography role and one named element without
381
+ copying a component's full style tree:
382
+
383
+ ```ts
384
+ theme: {
385
+ presets: { h2: { fontSize: "1.75rem" } },
386
+ styles: {
387
+ Sidebar: {
388
+ LinkLabel: {
389
+ preset: "body",
390
+ whiteSpace: { "": "nowrap", "@mobile": "normal" }
391
+ }
392
+ }
393
+ }
394
+ }
395
+ ```
396
+
397
+ The `@mobile` value sits with the default value in one Tasty state map. Shared
398
+ tokens and presets keep the component aligned with the rest of the site, while
399
+ Glaze resolves semantic colors across the configured schemes and contrast
400
+ modes.
401
+
402
+ In a generated site, run `npm run validate` (or the matching package manager's
403
+ command) after editing `docs.config.ts`. It checks TypeScript theme properties,
404
+ then runs Cookbook's preflight and production output checks. A misspelled
405
+ preset or built-in sub-element property fails type checking.
406
+
360
407
  Provide only the root and named
361
408
  [sub-element](./upstream/tasty/docs/dsl.md#sub-element) properties you want to
362
409
  override. Cookbook deep-merges that partial style object into the complete
@@ -491,6 +538,10 @@ same.
491
538
  Register custom names and their partial Tasty objects in `theme.customStyles`.
492
539
  Built-in names belong in `theme.styles` and reject misspelled sub-elements.
493
540
  Custom names can also target a matching user-authored `data-tasty-anatomy` attribute.
541
+ The name must match the string passed to `defineComponent()` or
542
+ `resolveComponentStyles()`, or the `data-tasty-anatomy` value. A production
543
+ build warns when a configured custom name has no matching component style
544
+ resolver or rendered anatomy attribute.
494
545
 
495
546
  The default renderer runs Tasty in Astro extract mode. Direct components and
496
547
  the remaining document/vendor bridge styles are collected into shared static
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenphi/cookbook",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "Repository-native static documentation for Astro",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -68,8 +68,8 @@
68
68
  "author": "Andrey Yamanov",
69
69
  "license": "MIT",
70
70
  "dependencies": {
71
- "@tenphi/docs": "0.18.0",
72
- "@tenphi/starlight": "0.18.0"
71
+ "@tenphi/docs": "0.18.1",
72
+ "@tenphi/starlight": "0.18.1"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "astro": "^7.3.2"