Token导航 LogoToken导航TokenDH.com
待分类权限需确认github未标认证来源可访问许可证需确认审计通过

sticky-and-fixed-elements粘性和固定元素

Agent Skill

sticky-and-fixed-elements 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

612

周安装

26

GitHub Stars

6

下载量

214
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sticky-and-fixed-elements(粘性和固定元素)
来源仓库:https://github.com/dembrandt/dembrandt-skills
仓库路径:skills/sticky-and-fixed-elements
安装命令:
npx skills add https://github.com/dembrandt/dembrandt-skills --skill sticky-and-fixed-elements
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dembrandt/dembrandt-skills --skill sticky-and-fixed-elements

简介

sticky-and-fixed-elements 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理时使用。

  • 适用于待分类的粘性和固定元素相关协作信息管理。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前建议确认权限范围和维护状态,注意可能触发联网或命令执行操作。
  • 可结合原始 README 继续核验具体用法和功能细节。

SKILL.md

Sticky and Fixed Elements

position: fixed vs position: sticky

PropertyBehaviourUse for
position: fixedRemoved from document flow. Always stays at the same viewport position regardless of scroll or parent.Global navigation header, bottom toolbar, floating action button
position: stickyStays 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.

Top — Navigation Header

The global navigation header is the most common fixed element. It should:

  • Remain visible at all times so the user can always navigate away
  • Be as thin as possible to maximise content area — 48–64px is a common range
  • Have a background and shadow so content scrolling beneath it does not bleed through
  • On scroll, a subtle shadow (--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); }

Bottom — Toolbar on Mobile

On mobile, the bottom of the screen is the most reachable area with one thumb. A persistent bottom toolbar is the natural home for:

  • Primary navigation (bottom tab bar — iOS and Android convention)
  • Contextual actions for the current view (edit, share, delete)
  • A floating action button (FAB) for the single most important action

Bottom toolbars should:

  • Respect the safe area inset on devices with a home indicator: padding-bottom: env(safe-area-inset-bottom)
  • Be visually separated from content (background fill, top border, or shadow)
  • Contain 3–5 items maximum — more than 5 should move to a menu or a different pattern
  • Use icons with labels for navigation tabs, or icons alone for contextual toolbars (with tooltips)

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.

Sticky Table Headers

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.

Stacking and Z-index

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.

How Many Fixed Layers Is Too Many

Each fixed layer removes space from the content area and adds visual complexity. A page should rarely need more than:

  • 1 fixed header (top)
  • 1 fixed toolbar or bottom nav (bottom, mobile)
  • 1 floating action button or contextual overlay

A fixed header + fixed bottom toolbar + floating button + sticky sidebar + sticky table header all simultaneously is too many layers. Consolidate where possible.

Review Checklist

  • Is sticky used for section-scoped elements and fixed only for truly global UI?
  • Does the fixed header compensate for its height with body padding?
  • Does the bottom toolbar respect env(safe-area-inset-bottom) on mobile?
  • Are all z-index values defined as named tokens, not arbitrary numbers?
  • Is the total number of simultaneous fixed layers minimal — header + one bottom element maximum in most cases?
  • Does content scrolling behind a fixed element not visually bleed through (background + shadow on the fixed element)?

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.09%
按下载量换算77

Claude

30.76%
按下载量换算66

Cursor

20.59%
按下载量换算44

Gemini CLI

9.1%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills