Repository navigation
v2.5.0
Install or upgrade with npx framesmith, or npm i -g framesmith.
framesmith now knows when a screen is an application: a tool you work in, not a page you read. You declare it, build it from app pieces and overlays, give elements states, and it is judged as an app. The screen above is composed from those pieces. It scores 100 in fast and detailed mode in both themes, and its error, empty-list and loading states are designed too. (#244–#253)
This release also clears every follow-up the app work left open, and fixes how contrast is measured on translucent fills. (#243, #254–#260)
Declare an app
canvas_create({ type: "desktop-app" })makes an application screen on thewindow-1440profile (1440×900).canvas_set_typedeclares an existing canvasweb,mobileordesktop-app.- The
surfacereport on every evaluation names the type, the window and the rules it turned on and off. On a desktop-app canvas the web type-scale ratio is off, replaced by a dense type ladder. generate_design_systemnow writes the state opacities (state),focus-ringandborder-strong, on every type.
Built from app pieces
- New node types:
link,text-input,nav-item(withcountand an identitydotColorthat never counts as an accent),tabs,tree-row,menu-row,property-rowanddivider. buttongains a 24pxxssize andariaLabelfor icon-only buttons. Atextnode can carry inlinelinksranges.- Six desktop-app structures, picked by
apply_structureon an app canvas:split-workbench-app,list-detail-app,editor-inspector-app,browser-app,dashboard-appandsettings-app. Two components join them:data-table-appandskeleton-table-app. - A frame with
overflow: "auto"is a scrolling pane.canvas_stressreads it as scrolling and triples app rows and card grids.
Overlays
tooltip,popover,menu,modal,toastanddrawer. Wherever you put one in the tree, it renders in one layer above all content, stacked by kind: popover and menu, then the modal's scrim, then modal and drawer, then toast, then tooltip. They are placed withx/yin root coordinates.- A modal and a drawer are panes of their own for the navigation and primary-button rules.
- Overlay screens are state variants (
menu-open,confirm-delete), listed by coverage but never demanded.
States as a property
state: "hover" | "focus" | "pressed" | "disabled"onbutton,link,text-input,nav-item,tree-row,menu-row,list-rowand the four controls. Tabs, tab-bar and nav-bar items, modal actions and a toast's action take it too.- States draw from state tokens. Focus is a 2px ring at a 2px gap. A disabled element draws in the on-surface colour at the disabled opacities, and is skipped by the 24px rule and the primary count.
Judged as an app
On a desktop-app canvas, each finding names its rule:
desktop-app-target: a click target below 24px. Fast mode warns; detailed mode runs WCAG 2.5.8's spacing exception and errors if a neighbour sits inside the 24px circle.desktop-app-handbuilt-targetanddesktop-app-icon-label: a frame shaped like a button, and an icon-only action with no name.desktop-app-current: each navigation region (a pane, a modal, a drawer) has exactly one current item.desktop-app-type-ladder,desktop-app-row-rhythm,desktop-app-truncationanddesktop-app-primary-count.desktop-app-overlay: one modal at a time, text-only tooltips, no large tables or sideways scrolling in a modal, overlays inside the window, nothing under a scrim.desktop-app-focus-visible,desktop-app-state-contrast,desktop-app-disabledanddesktop-app-boundary: focus rings, active bars and underlines, disabled looks, and control borders, checked for contrast in each theme the canvas ships, without being drawn.desktop-app-artboard: a canvas that holds app pieces but never declared itself an app.
Also on web and mobile
- Contrast composites translucent colours. A translucent fill or text colour is blended over what is behind it before the ratio is measured. A common selected-row tint used to be judged as solid paint, so light text on it was a false error. (#243)
- Every click target is measured on web too, with the same 24px floor and spacing exception. Inline text links are exempt.
- Repeated findings fold. Three or more warnings or infos with the same rule and message come back as one entry with
nodeIds,countand every member'sfix. Errors never fold, andcanvas_autofixstill sees one finding per node. - Rules see inside component instances. Contrast, spacing and cliché checks now read the expanded tree, as the renderer does. A finding inside an instance names the instance and carries
innerNodeId. A disabled control inside a component now renders dimmed. (#256) unknown-token. A$refthe merged tokens don't define, or one of the wrong kind (a colour ingap), is a warning. When exactly one defined name is close,canvas_autofixrenames it. Copy props such aslabelandcontentare never resolved, so a price like "$49" stays copy. (#257)- Tints follow the palette.
accent-tint,success-tint,warning-tint,danger-tint,neutral-tintanddangerderive from the applied palette and the surface they sit on, so a light preset no longer keeps dark tints. (#257) - Navigation lists never read as data tables, on any type.
selectdraws$border-strongwhen the design system defines it, and its border is checked like a text field's. An activetree-rowdraws a bar the indicator check measures.canvas_stresswidens sidebar and tab counts to999+. (#258)cornerRadius: "$md"reads the radius scale first. Under a preset that definesmdin both spacing and radius, it used to render the spacing value. (#259)- On a phone, links, text fields and dialog buttons are held to 44px.
text-inputgainssize: "lg"(44px), andmodalandtoastgaincontrolSize(the button sizes;"md"is 44). A centred modal withcontrolSize: "md"is now a valid phone dialog, andsheetstays the choice for a panel that rises from the bottom. A link with a numericheightis never narrower than it is tall. (#260) - Detailed
canvas_evaluatelays out in the design system's own fonts, as screenshots do.
Upgrading
Verdicts on existing canvases can move. Each change below is deliberate:
- New findings on web canvases. Every click target is now measured on web, including icon-only links at their glyph size. Controls inside component instances are checked for the first time.
- A misspelt or wrong-kind
$tokenis now a warning, so a canvas that carries one stops being READY until it is fixed.canvas_autofixfixes the unambiguous ones. - Tints change on canvases that still hold the old seeded values. Those values are treated as unset and derived from your palette. Because of this, the
sha256r:version hash of such a canvas moves once. - Some renders change.
cornerRadiusshort names ($sm,$md,$lg) under the dark, light and material presets render the radius value now, which is smaller than the spacing value they rendered before.- An unset
selectborder draws$border-strongwhere it is defined. - A link with a numeric
heightgets amin-widthequal to its height.
- On a phone canvas, a default
link,text-input, modal or toast action is now amobile-touch-targeterror. The fixes areheight: 44,size: "lg"andcontrolSize: "md". canvas_evaluateoutput folds repeated findings. ReadnodeIdsandfixeson a folded entry, not onlynodeId.
