algorithmic-color-pale…
Derive a full UI colour palette algorithmically from one or two brand colours. Darker and lighter variants for interactive states, desaturated greys from the…
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,
$ npx -y skills add dembrandt/dembrandt-skills --skill sticky-and-fixed-elements --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/sticky-and-fixed-elementsContext preview
The summary Claude sees to decide when to auto-load this skill.
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,
name: sticky-and-fixed-elements
description: "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."
metadata:
priority: 6
pathPatterns:
- "**/*.css"
- "**/*.scss"
- "components/**"
- "src/components/**"
- "**/*.tsx"
- "**/*.jsx"
- "design-system/**"
promptSignals:
phrases:
- "sticky"
- "fixed"
- "position: fixed"
- "position: sticky"
- "toolbar"
- "bottom bar"
- "floating"
- "persistent header"
retrieval:
aliases:
- sticky header
- fixed toolbar
- bottom navigation
- floating action button
- sticky table header
- persistent UI
intents:
- keep header visible on scroll
- design a bottom toolbar
- add a floating action button
- make table headers sticky
- decide between sticky and fixed
examples:
- should the header be sticky or fixed
- design a bottom toolbar for mobile
- keep this toolbar visible while scrolling| 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:
.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:
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.
UX and design-system skills for AI agents. Install once, and your agent knows how to design. --all installs every skill at once. They load only when a prompt needs them, so there is no runtime cost to having them all. Want to pick by hand?
Repo: dembrandt/dembrandt-skills
Derive a full UI colour palette algorithmically from one or two brand colours. Darker and lighter variants for interactive states, desaturated greys from the…
The persistent shell around an application — the top bar, the app launcher, the tenant and environment cue, and in heavy tools a status bar. In an estate of…
Product visuals — hero shots, demos, screenshots, landing-page panels — must reproduce the real product, not a stylised poster of it. Design with real content…
A brand's visual tone — playful or serious, rounded or angular — should be consistent across all UI elements. Shape language in typography, border-radius, and…
Every interactive element needs a complete set of visual states — rest, hover, active/pressed, focus, disabled, and loading. States should be derived…
Rebuild an existing web page 1:1 from measurement instead of by eye — into Figma, Penpot, or code. Captures the rendered page, the raw source and the computed…