Repository navigation
@var-ui/docs@0.14.0
Minor Changes
-
#238
e97729dThanks @dbanksdesign! -prosegains an opt-out, and the docs-only prose recipe moves out of core.data-not-prose(NOT_PROSE_ATTRIBUTE): prose element styles skip the marked element and everything inside it (a live demo, an embedded widget), while the element still takes part in the vertical flow.proseRules()scopes your own element rules the same way when you extend prose.proseContentis removed from@var-ui/core(classdocs-prose). It was the docs site's reading style, and it sat in theutilitieslayer, so it overrode component styles and neededdata-prose-isolateto keep out of demos.@var-ui/docsnow hasdocsProse(in@var-ui/docs/styles), which setsprose's vars to the docs ramp and adds the docs extras. It lives in thebaselayer, so components inside win.data-prose-isolateis replaced bydata-not-prose.proseno longer gives inline children of list items and blockquotes (code, badges) a bottom margin; only block children are spaced.Tablesetsdisplay: tableon its<table>, so it keeps its layout insideProse(which makes bare tables scrollable blocks).
-
#233
8af0092Thanks @dbanksdesign! -CodeBlockandCopyButtonshare one set of copy props and events.CodeBlock(React and Astro):copyErrorLabelis nowerrorLabel, matchingCopyButton.copyTextanderrorTextare removed: the copy button is icon-only, socopyLabel/copiedLabel/errorLabel(its accessible name in each state) are the only labels. A copy failure shows the error icon, asCopyButtondoes.- React
CodeBlockgainsonCopied(value)andonCopyError(error, value)and is built onuseCopy. It resets after 2 seconds likeCopyButton(it was 1.2s). The status region now announces success as well as failure; success is screen-reader-only. - Astro:
CodeBlockfires the same events asCopyButton, renamed tovar-ui:copied/var-ui:copy-error(COPIED_EVENT/COPY_ERROR_EVENT; previouslyCOPY_BUTTON_COPIED_EVENT/COPY_BUTTON_ERROR_EVENT), and honoursdata-var-ui-timeout. The hand-written markup contract usesdata-var-ui-error-label(wasdata-copy-error-label) and drops the[data-codeblock-copy-text]span. CopyButton's defaulterrorLabelis nowCopy failed(wasError), anduseCopyclearserrorafter the timeout, as it already did forcopied.
Patch Changes
-
#291
df5fd15Thanks @dbanksdesign! - Fonts. Add thealloGroteskpairing: Allo (Latin subset, variable weight) for body and UI, Space Grotesk for display, JetBrains Mono for code, each webfont backed by a metric-matched Arial fallback so text doesn't rewrap when the webfont swaps in.defineFontsslots accept several faces (upright + italic of one family), register a face shared by two slots once, and take an optionalmetricFallbackface;FontFaceDefinitiongainssizeAdjust,ascentOverride,descentOverrideandlineGapOverride.Letter-spacing tokens resolve at the text that uses them.
letterSpacing.*tokens were registered as<length-percentage>, soemvalues computed once against the root font size:caps(0.06em) rendered as 0.08em on 12px labels anddisplaytracking didn't scale with headline size. They are now unregistered (*syntax), soemresolves at the use site.Tabular figures on
badgeand theslideroutput.Docs prose: H3–H6 use the body face (H3 at weight 650); the lead paragraph and page-header lead track at −0.005em.
-
#273
70443fbThanks @dbanksdesign! - NewcodeBlockMarkup({ code, language, filename, copyable, … })in core: the structure of a code block (header, language label, copy button, body,pre,code) as plain attribute maps. The React and AstroCodeBlocks and the docs Shiki transformer all render from it, so they can't drift. They had: markdown fences put the language in the filename slot, showed a visible "Copy" label, and useddata-copy-error-label, which the copy script never read. The root also carriesdata-language.Fix (react): a
CodeBlockwithout highlighted HTML double-escaped its code, so<div>showed as<div>. -
#272
0ef2a05Thanks @dbanksdesign! - New reading type tokens:fontSize.prose.{body, lead, h1, h2, h3}(16 / 19 / 44 / 28 / 20px) and the paired fixed line heightslineHeight.prose.*(26 / 28 / 48 / 34 / 28px), so themes can tune long-form type apart from the 14px control scale. The docs kit (docsProse, the page header lead) uses them instead of hard-coded rems.Proseitself stays relative to its inherited font size. -
#261
c3313b6Thanks @dbanksdesign! - CollapsibleSideNavsections can be controlled and remembered.- react
SideNav.Sectiontakesopen/onOpenChange(controlled). A parent that ignores the change keeps the section as it is. - react, astro
SideNav persistKeyremembers which collapsible sections the reader opened or closed, inlocalStorage. Sections are keyed byid, or else their title. The section holding the current page always starts open. AstroSideNavalso initializes navs swapped in by the client router (astro:page-load). - core
persistDisclosures(root, key)(@var-ui/core/shared/disclosureState) is the framework-agnostic helper behind both. - docs The sidebar uses
persistKey. The customdocsSidebarStatescript is removed.
- react
-
#254
f066000Thanks @dbanksdesign! - Every published package now ships itsCHANGELOG.md. A new Upgrading guide (/docs/upgrading) covers the 0.6 → 0.13 breaks: platform prop names,filled→solid, native overlays, space tokens and removed exports. The core README liststypestylesas the one TypeStyles export (no rootrecipe/style), and the React README no longer describes the package as React Aria wrappers.IconButtonwarns once in development when it renders without anicon(any cause, including the pre-0.7name="close").