Skip to content

Simplify Tasty anatomy and responsive states - #147

Merged
tenphi merged 6 commits into
mainfrom
codex/remove-css-classes
Oct 12, 2026
Merged

tenphi merged 6 commits into
mainfrom
codex/remove-css-classes

Conversation

@tenphi

@tenphi tenphi commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Cookbook used authored classes for owned anatomy and variants, and hero actions and pagination links changed geometry on hover. Use Tasty sub-elements and data modifiers for those hooks, keep controls stationary, and give minimal actions outline geometry with border: "#clear". Pagination reserves a transparent border before hover and recolors it without replacing configured widths or styles.

Keep existing component and generated-content root classes, including .project-note in customization examples and Logo’s root class prop. data-element now identifies anatomy only; variant classification uses modifiers such as data-primary, data-block, and data-heading. Update AGENTS.md and migration guidance to distinguish root hooks from anatomy and state.

Simplify Markdown and related style maps:

  • Move diff and copy state to the owning code-block wrapper, so descendant rules use plain diff and copy-state=copied states.
  • Remove duplicated structural paths from selected-element conditions, such as panel link @own(:first-child) and button @own(:hover).
  • Share prose conditions instead of repeating complex predicates across Markdown declarations. The shared prose states check each selected element’s ancestry, preserving nested data-not-content isolation without affecting surrounding prose in the same Markdown root.
  • Preserve linked-card spacing, conditional omissions, heading control colors, and customization. Normalize patch highlighting and empty diff token spans so fences and CodeGroup have the same behavior.

Reduce shared aliases from 17 to 11 and unify responsive naming as @sm (>40rem), @md (≥50rem), and @lg (≥72rem). Negation selects narrower layouts. Remove unused shell/medium-layout aliases, the redundant desktop alias, PackageVersion's single-component compact alias, and the popover alias. Popovers use native :is(:popover-open) conditions; the wrapper accommodates the pinned linter's simple pseudo-class list. Existing layout thresholds, including the exclusive 40rem boundary, are preserved. Migration guidance covers renamed style conditions and inverted custom breakpoint definitions.

Upgrade the shared Tasty pin and reviewed release-age exceptions to 3.9.10, including the packed Yarn consumer fixture. The patch preserves environment checks in production consumers.

Remaining classes are permitted root hooks, Tasty-generated style hashes, and Pagefind’s unavoidable sub-element hooks. Pagefind creates and updates its own controls/results and exposes class hooks rather than configurable element identities. That exception is documented beside the integration and in the component guide.

Normalize both Shiki class and HAST className: preserve custom root hooks alongside tasty-code, and reject token classes with a modifier/customization hint. Plugin and recipe consumer checks assert alert identities and modifiers.

Validation:

  • All 12 CI checks passed on 65daa57, including the full verification job and npm/pnpm/Yarn consumers across Linux, macOS, and Windows.
  • pnpm lint: zero errors and warnings; full build and typecheck passed.
  • 399 unit tests and 73 browser tests passed, including stationary button/pagination geometry with custom borders, transparent minimal borders, root class ownership, canonical HAST class handling, nested prose isolation, diff/copy behavior in fences and CodeGroup, responsive boundary checks, and native popover animations. The latest run passed on Tasty 3.9.10 using the repository’s standard browser configuration.
  • Theming and authoring consumer checks passed, including partial style overrides, custom components/themes, and server-only styling boundaries.
  • Clean packed-package npm and Yarn installations, generated-site validation, Astro 7.3.2 consumer build/output checks, packed ESLint/oxlint exports, development checks, and reference output/budget checks passed.
  • Plugin and all documented recipe checks, publishing-site checks, corpus benchmark, unused-code checks, package validation, and publishing/type-resolution checks passed.

Four additional review/fix passes covered the full PR, renderer behavior, public customization contracts, generated content, and final validation. Pagination hover and both canonical HAST class cases have regressions verified to fail before their fixes; two follow-up source reviews checked the Tasty upgrade, lockfile, packaged upstream docs, release notes, and prose-scope explanation. No outstanding findings remain.

Entropy change: Moderately Decreased for Markdown/style maintenance—owner states and shared prose conditions replace repeated structural predicates while preserving root contracts. Moderately Decreased for responsive configuration—one width scale replaces mixed device/layout names and redundant aliases; one-time consumer renames and breakpoint inversion are documented and exercised in a packed consumer. Slightly Increased for conditional variant/category override authoring—property maps must retain explicit modifier conditions to satisfy the styling architecture; the component guide and migration examples document them. Neutral for root integration, reader interaction contracts, and the shared Tasty upgrade; the pin, lockfile, packaged upstream documentation, and consumer fixture stay aligned. No unaccepted Entropy exceptions or deferred fixes remain.

@tenphi tenphi changed the title Replace authored CSS classes with Tasty identities and modifiers Use Tasty anatomy and modifiers while preserving root hooks Oct 12, 2026
@tenphi tenphi changed the title Use Tasty anatomy and modifiers while preserving root hooks Simplify Tasty anatomy and responsive states Oct 12, 2026
@tenphi
tenphi merged commit 66fd40a into main Oct 12, 2026
12 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 12, 2026
tenphi added a commit that referenced this pull request Oct 15, 2026
#147 moved Sidebar.TopLevelSpacing and Sidebar.GroupSpacing from
class and :is() selectors to the `top-level` and `section` states. Tasty
compiles states to zero-specificity :where(), so both rules now tie on
`ul > li + li`. Tasty emitted the zero-margin TopLevelSpacing rule last,
so it won and sections lost their gap.

Limit TopLevelSpacing to `top-level & !section` so the two rules can't
match the same item and rule order no longer matters. This matches the
spacing from before #147, and both sub-element names stay the same.

Co-authored-by: Claude Opus 5.5 <[email protected]>
tenphi added a commit that referenced this pull request Oct 15, 2026
…rders (#160)

- Sidebar: the next item's fill covered the lower edge of a focused
  link's ring. `Sidebar.InteractiveControl` now positions focus-visible
  controls with `z-index: 1`, so the ring draws above its neighbors.
- Main content: `#main-content` (tabindex -1) receives focus when its
  text is clicked, and a key press then made it match :focus-visible, so
  keyboard scrolling drew the browser's ring around the whole article.
  It is a skip-link and page-swap target, not a control; drop its
  outline.
- Pagination: #135 reduced the link's `$border-width solid #border` to a
  bare `borderColor` when the top-bar icon borders were removed, and #147
  made it `#clear`, so links lost their resting border. Restore
  `border: true`. Hover only recolors, so geometry is unchanged and
  `theme.styles.Pagination.Link` border overrides still apply.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant