Utilities
Text modifiers, visibility helpers, and semantic role patterns. Small attributes, precise effects.
ASW's utility layer is intentionally minimal: a handful of data-text values for inline text treatment, data-visible for responsive show/hide, and data-role patterns for semantic display structures. No utility classes. No modifier stacks. Each attribute does one thing.
data-text — text modifiers
Apply inline text treatments without wrapper elements or classes. Multiple values can be combined with a space.
| Value | Effect | CSS variable |
|---|---|---|
mono | Monospace font (JetBrains Mono) | --font-mono |
dim | Muted text colour | --text-3 |
accent | Accent colour (green) | --accent |
small | Reduced font size (0.85em) | — |
<span data-text="mono">monospace text</span>
<span data-text="dim">muted secondary text</span>
<span data-text="accent">accent colour</span>
<span data-text="small">reduced size</span>
<!-- Combine values -->
<span data-text="mono dim">muted monospace</span>
<span data-text="mono dim small">footer labels</span>
Live demo
mono — JetBrains Mono, full text colour
dim — muted, for secondary content
accent — highlights, emphasis, keywords
small — 0.85em, for labels and captions
mono dim — path names, metadata, footnotes
mono dim small — footer stamps, version labels
On block elements
data-text works on block elements too, not just inline spans. Apply it to a <p>, <footer>, or <small> to treat the whole element. This is how the page footers in this docs site are styled:
<footer>
<p data-text="dim small">Agentic Semantic Web — utilities</p>
</footer>
data-visible — responsive visibility
Show or hide elements based on viewport width. The breakpoint is 768px.
| Value | Below 768px | 768px and above |
|---|---|---|
desktop | Hidden | Visible |
mobile | Visible | Hidden |
<!-- Different content per breakpoint -->
<span data-visible="desktop">Full label text</span>
<span data-visible="mobile">Short</span>
<!-- Hide a column on mobile -->
<th data-visible="desktop">Description</th>
data-visible is for genuinely different content at different breakpoints — not for layout arrangement. If you're trying to rearrange columns on mobile, use data-layout="grid-2" (which collapses responsively) rather than duplicating content and toggling visibility.
data-role — semantic patterns
data-role marks an element's semantic function — not its visual style. The stylesheet reads this to apply appropriate presentation. The same attribute carries meaning for agents parsing the page: a [data-role="diff"] element signals code comparison; [data-role="status-card"] signals a status summary.
Status card
A bordered, padded summary card. Use for agent status summaries, deployment states, system health displays.
<div data-role="status-card">
<p><strong>Vigilio</strong> — <span data-status="awake">awake</span></p>
<p data-text="dim small">Session 2714 · autonomous · claude-sonnet-4-6</p>
</div>
Vigilio — awake
Session 2714 · autonomous · claude-sonnet-4-6
Diff display
A monospace diff block with semantic colour classes: .add (green), .remove (red), .context (dim). Use for showing code changes, configuration diffs, before/after comparisons.
<div data-role="diff">
<p class="context"> function greet(name) {</p>
<p class="remove">- return "hello " + name;</p>
<p class="add">+ return `Hello, ${name}.`;</p>
<p class="context"> }</p>
</div>
function greet(name) {
- return "hello " + name;
+ return `Hello, ${name}.`;
}
[data-role="diff"] applies its own monospace font and overflow handling. Each line is a <p> — easier for agents to generate, and colour classes can be applied per-element. For full syntax-highlighted code blocks, use <pre><code> instead.
Command box
A styled inline command display — for shell commands, CLI invocations, or copy-ready instructions. Has a visual .prefix for the shell prompt symbol.
<div data-role="command-box">
<span class="prefix">$</span>
<code>napkin search "timeline"</code>
</div>
napkin search "timeline"
git -C ~/.napkin log --oneline -5
The prefix is user-select: none — copying the command doesn't include the prompt character.
Log entry
A minimal styled row for log output. Adds a subtle bottom border between entries. Use inside a container when generating structured log output.
<div>
<div data-role="log-entry">
<span data-text="mono dim small">09:31:02</span>
Session 2714 started — autonomous mode
</div>
<div data-role="log-entry">
<span data-text="mono dim small">09:31:04</span>
Vault oriented. Picking up ASW #45.
</div>
</div>
Combining utilities
Utilities compose naturally. A log entry with a dim monospace timestamp; a diff with small context lines; a command box inside a status card. The attributes don't conflict because each targets a different aspect of presentation.
Last deployment
- version: 0.1.3
+ version: 0.1.4
git push forgejo main
Pushed 2026-04-02 · 24 files changed
Reference
| Attribute | Values | Purpose |
|---|---|---|
data-text | mono dim accent small | Inline text modifiers (combinable) |
data-visible | desktop mobile | Responsive show/hide at 768px |
data-role="status-card" | — | Bordered summary card |
data-role="diff" | — | Diff block (.add .remove .context) |
data-role="command-box" | — | Shell command display (.prefix) |
data-role="log-entry" | — | Log row with bottom border |