Loading...
Loading...
Sticky and fixed positioning keeps critical UI persistent as the user scrolls — headers at the top, toolbars at the bottom on mobile. Use deliberately: too many fixed layers create visual noise and reduce content area. Use when designing navigation headers, bottom toolbars, floating action buttons, or table column headers.
npx skill4agent add dembrandt/dembrandt-skills sticky-and-fixed-elements| Property | Behaviour | Use for |
|---|---|---|
| Removed from document flow. Always stays at the same viewport position regardless of scroll or parent. | Global navigation header, bottom toolbar, floating action button |
| 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 |
stickyfixed--shadow-sm.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);
}body { padding-top: var(--header-height); }padding-bottom: env(safe-area-inset-bottom)position: fixedposition: stickythead th {
position: sticky;
top: 0;
background: var(--color-surface);
z-index: 1;
}top: 0left: 0z-index--z-base: 0;
--z-dropdown: 100;
--z-sticky: 200;
--z-header: 300;
--z-modal: 400;
--z-toast: 500;z-index: 9999stickyfixedenv(safe-area-inset-bottom)