Skip to content

docs(theme): document the slot-class replacer (function form) + "Theme component" section #184

Description

@IgorShevchik

Context

Follow-up to PR #183 (port of upstream nuxt/ui ea576e2ffeat(theme): allow replacing slot classes with a function, nuxt/ui#6562).

The runtime feature is fully ported and shipped in #183: a slot class can be a function (defaults) => classes that replaces the slot's default classes (instead of merging) via :b24ui, the class prop, or app.config.b24ui. Types (SlotClass / SlotClassReplacer), the tv wrapper rewrite, and tests are all in place and green.

During that port, two documentation-only pieces from upstream were intentionally skipped because b24ui's docs/skills are structured differently from nuxt/ui and a 1:1 insertion would not have mapped cleanly:

  1. docs/content/docs/1.getting-started/5.theme/3.components.md — upstream added, in its global-config section:

    • a "By default these classes are merged… set a slot to a function to replace them entirely" explanation with framework-only (Nuxt app.config / Vue vite.config) code blocks;
    • a "Theme component" subsection describing scoped overrides via <B24Theme> (which does exist in b24ui as src/runtime/components/Theme.vue) and referencing the theme-ui-example (b24ui has docs/app/components/content/examples/theme/ThemeUiExample.vue), noting that slots accept the same function form to replace classes.

    In feat(theme): allow replacing slot classes with a function #183 only a focused note + :b24ui example + theme.unstyled tip was added to the existing ### b24ui prop section.

  2. Skill guidance — upstream updated skills/nuxt-ui/references/guidelines/design-system.md with a "Replace instead of merge" section. b24ui's skill lives at skills/b24-ui-nuxt/ with different structure and was not updated.

Scope of this issue

  • Expand 5.theme/3.components.md to document the replace-instead-of-merge function form at the global-config level (Nuxt app.config.b24ui + Vue vite.config bitrix24UIPluginVite), mirroring upstream but in b24ui's doc structure.
  • Add/align a "Theme component" (<B24Theme>) section noting that slot overrides accept the (defaults) => classes replacer form (the theme-ui-example already exists).
  • Update the b24ui skill under skills/b24-ui-nuxt/ with the equivalent "Replace instead of merge" guidance.

References

Target

Target start: 2026-06-25.

No runtime/behaviour change involved — documentation & skill alignment only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions