算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
factor-of-safety-content-stress【设计与创意】Use this skill when designing UI to survive content extremes — long names, big numbers, multi-line addresses, missing images, internationalized strings, dense data. Trigger when reviewing a design against worst-case content, when bug reports show layouts breaking on real data, or when picking content limits and validation rules. Sub-aspect of `factor…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
factor-of-safety; read that first.'Most designs are tested against ideal sample data: typical-length names, round numbers, well-cropped images, English. Real data is messier. Names span 1 to 100+ characters; numbers span tiny to enormous; images are missing, oversize, or wrong aspect; translations stretch UI strings 30%+. A design that handles only the typical breaks routinely on real users.
Design for the worst plausible case; truncate gracefully with tooltips for very long values.
A column sized for "$5,000.00" breaks for "$1,234,567.89." Size for the worst case or use abbreviated formats.
chunking-numeric-and-otp).Design with stretch room; test in worst-case languages (German for length, Arabic for direction).
Empty states are often forgotten until QA. Design them deliberately.
<article class="user-card">
<div class="avatar">
<img src={avatarUrl} alt="" onerror="this.style.display='none'" />
<span class="avatar-fallback">{initials}</span>
</div>
<div class="user-info">
<h3 class="name">{name}</h3>
<p class="role">{role}</p>
<p class="email">{email}</p>
</div>
</article>
<style>
.user-card {
display: grid;
grid-template-columns: 48px 1fr;
gap: 12px;
padding: 16px;
min-height: 80px; /* margin for multi-line names */
}
.avatar { position: relative; width: 48px; height: 48px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback { /* shown when image fails */ }
.user-info { min-width: 0; } /* allows truncation */
.name {
overflow-wrap: break-word;
hyphens: auto;
}
.email {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: hsl(0 0% 45%);
}
</style>
The card handles:
<td class="amount">{currency(amount)}</td>
<style>
.amount {
text-align: right;
font-variant-numeric: tabular-nums;
width: 12ch; /* fits "$9,999,999.99" */
}
</style>
The column width accommodates the maximum-realistic value. Smaller values right-align within it.
<button class="cta">{t('signup.cta')}</button>
<style>
.cta {
min-width: 120px;
padding: 12px 24px;
white-space: nowrap; /* don't wrap; let it grow horizontally */
}
/* On narrow screens, allow wrap */
@media (max-width: 600px) {
.cta { white-space: normal; }
}
</style>
The button accommodates German "Kostenlos anmelden" (longer than "Sign up free") without breaking the layout.
{items.length > 0
? <ItemList items={items} />
: <Empty
icon={<InboxIcon />}
title="Your inbox is empty"
description="When messages arrive, they'll appear here."
action={<Button>Compose new message</Button>}
/>
}
Designed deliberately, not just "the list happens to be empty."
factor-of-safety (parent).factor-of-safety-failure-margin — capacity and dependency margins.chunking-numeric-and-otp — numeric formatting decisions.accessibility-perceivable — content stress is also accessibility (long content for low-vision; missing images for blind users).