Readable content measure
Measure constrains line length while allowing the surrounding composition to determine placement and available space.
<forma-measure>
Constrains readable line measure without changing semantic structure.
<forma-measure>patterns/measure.htmlMeasure caps an element's inline size at a readable line length, 65 characters by default, while letting it shrink to the available width. It sets width only: it does not center, pad or style the content, so the surrounding composition still decides placement. Use it on text-heavy regions inside wide layouts, such as help text in a full-width settings page or an explanation above a dashboard, where long lines would otherwise slow reading.
min(100%, var(--forma-measure)), so the element never overflows its parent.ch unit scales with font size, so the measure stays proportional under text zoom.The smallest correct markup: the canonical pattern from patterns/measure.html inside its public tag. Copy this first, then adapt labels, names and state.
Rendered from the canonical pattern file.
Measure constrains line length while allowing the surrounding composition to determine placement and available space.
<forma-measure class="forma-component-tag">
<article class="forma-measure">
<h2>Readable content measure</h2>
<p>Measure constrains line length while allowing the surrounding composition to determine placement and available space.</p>
</article>
</forma-measure>
Click or tap the code once to select all of it, then copy.
A description paragraph and a field constrained to a readable measure inside a full-width page section. The heading and the field share the same line length, so the eye does not travel across the whole screen.
Choose how long we keep deleted projects before they are permanently removed. During this period an administrator can restore a project with all of its history, members and integrations.
<forma-measure class="forma-component-tag">
<section class="forma-measure forma-stack" aria-labelledby="measure-settings-help-title">
<h2 id="measure-settings-help-title">Data retention</h2>
<p>Choose how long we keep deleted projects before they are permanently removed. During this period an administrator can restore a project with all of its history, members and integrations.</p>
<div class="forma-field">
<label class="forma-field__label" for="measure-settings-help-days">Days before permanent deletion</label>
<input id="measure-settings-help-days" name="retention-days" type="number" min="1" max="365" value="30">
</div>
</section>
</forma-measure>
Click or tap the code once to select all of it, then copy.
A tighter measure (--forma-measure: 45ch) for a short confirmation note in a card. Short lines make a brief message easier to take in at a glance.
Your export is being prepared. We will email a download link to the address on your account when it is ready, usually within ten minutes.
<forma-measure class="forma-component-tag">
<div class="forma-surface">
<p class="forma-measure" style="--forma-measure: 45ch">Your export is being prepared. We will email a download link to the address on your account when it is ready, usually within ten minutes.</p>
</div>
</forma-measure>
Click or tap the code once to select all of it, then copy.
Each mobile example renders in its own document inside a real narrow viewport, so Forma's media and container queries run exactly as they would on a phone. Choose a width to compare.
The same constrained text on a phone. The screen is narrower than 65ch, so the measure resolves to 100% and has no visible effect.
min(100%, 65ch) resolves to the full width.<forma-measure class="forma-component-tag">
<article class="forma-measure forma-stack" aria-labelledby="measure-mobile-measure-title">
<h2 id="measure-mobile-measure-title">Why we ask for your phone number</h2>
<p>We only use it to send sign-in codes when you turn on two-step verification. It is never shown to other members of your workspace.</p>
</article>
</forma-measure>
Click or tap the code once to select all of it, then copy.
The canonical pattern in a true 320px viewport, the minimum width every Forma component must support without page-level horizontal scrolling.
Forma components have no JavaScript API. Their public contract is the markup: native elements and attributes you write, and the CSS hooks below. The CSS hook table is generated from the built stylesheet, so it always matches the shipped implementation.
| Attribute | On | Values | Default | Description |
|---|---|---|---|---|
style | .forma-measure | --forma-measure: <length> | — | Per-instance line length, for example 45ch for short notes. |
aria-labelledby | section / article | id of the heading | — | Names the constrained region by its heading. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-measure | Block class | — | Sets inline-size: min(100%, var(--forma-measure)). No other styling. |
--forma-measure | Custom property | — | Maximum line length. Default 65ch. |
Not a form control. A form or field group can be the measured element.
No keyboard interaction beyond the browser defaults for the elements in the markup.
| State | How it is expressed | Presentation |
|---|---|---|
| Constrained | parent wider than --forma-measure | The element stops at the measure; remaining space stays empty at the inline end. |
| Fluid | parent narrower than --forma-measure | The element takes 100% of the parent. |
--forma-measure; they do not follow text zoom.Generated fault-injection specimens expose content, spacing, color-cue, and reduced-effective-contrast risks. They screen presentation robustness as engineering screens without claiming human-subject validation.