Derive a full UI palette from one or two brand colours — state variants, brand-tinted greys, semantic colours. Use when building or expanding a colour system.
中文简介正在准备中。当前显示原文说明。
Sticky headers, bottom toolbars, floating action buttons and pinned table headers. Use when deciding what stays on screen while the user scrolls.
中文简介正在准备中。当前显示原文说明。
实测评分 未实测
查看安装方法安装前可以查看交给 AI 代理的指令内容。
| Property | Behaviour | Use for |
|---|---|---|
position: fixed | Removed from document flow. Always stays at the same viewport position regardless of scroll or parent. | Global navigation header, bottom toolbar, floating action button |
position: sticky | Stays in document flow until it hits its scroll threshold, then locks in place. Returns to flow when parent scrolls past. | Table column headers, section headings in a long list, in-page toolbars within a scroll container |
Prefer sticky over fixed when the element belongs to a specific section or scroll context. Fixed elements sit above everything and affect the entire viewport — use them only for truly global UI.
The global navigation header is the most common fixed element. It should:
--shadow-sm) signals that content is behind it.site-header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: var(--header-height);
background: var(--color-surface);
box-shadow: var(--shadow-sm);
z-index: var(--z-header);
}
Compensate for the fixed header with matching top padding on the page body:
body { padding-top: var(--header-height); }
On mobile, the bottom of the screen is the most reachable area with one thumb. A persistent bottom toolbar is the natural home for:
Bottom toolbars should:
padding-bottom: env(safe-area-inset-bottom)On desktop, bottom toolbars are uncommon. Status bars, editor toolbars, and command palettes are the desktop equivalent — these are typically position: fixed at the bottom or position: sticky within their scroll container.
For data tables inside a scroll container, sticky column headers prevent the user from losing track of what each column means.
thead th {
position: sticky;
top: 0;
background: var(--color-surface);
z-index: 1;
}
If the table also has a sticky first column (for row identifiers), the top-left cell needs both top: 0 and left: 0, and a higher z-index to sit above both the header row and the sticky column.
Sticky and fixed elements create stacking context. Define z-index as named tokens, not arbitrary numbers:
--z-base: 0;
--z-dropdown: 100;
--z-sticky: 200;
--z-header: 300;
--z-modal: 400;
--z-toast: 500;
Every fixed or sticky element must declare its z-index explicitly using a token. Avoid ad-hoc values like z-index: 9999 — they signal an unmanaged stacking context and will eventually conflict.
Each fixed layer removes space from the content area and adds visual complexity. A page should rarely need more than:
A fixed header + fixed bottom toolbar + floating button + sticky sidebar + sticky table header all simultaneously is too many layers. Consolidate where possible.
sticky used for section-scoped elements and fixed only for truly global UI?env(safe-area-inset-bottom) on mobile?还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Derive a full UI palette from one or two brand colours — state variants, brand-tinted greys, semantic colours. Use when building or expanding a colour system.
中文简介正在准备中。当前显示原文说明。
Top bar, sidebar rail, app launcher, tenant and environment cue, status bar. Use when designing the persistent shell, a collapsible sidebar, or navigation between apps behind one login.
中文简介正在准备中。当前显示原文说明。
Product visuals must show the real product with real data. Use when building landing pages, hero sections, screenshots or demo panels.
中文简介正在准备中。当前显示原文说明。
Shape language across type, radius and icons carries brand personality. Use when starting a design system, picking icons or radius tokens, or reviewing visual consistency.
中文简介正在准备中。当前显示原文说明。
Rest, hover, active, focus, disabled and loading states, derived from the base colour. Use when designing buttons, links, inputs or any clickable component.
中文简介正在准备中。当前显示原文说明。
Rebuild a live web page 1:1 from measurement into Figma, Penpot or code, then verify it. Use when reproducing a page or checking a rebuild against the original.
中文简介正在准备中。当前显示原文说明。