Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计异常

preline-theme-generator预行主题生成器

Agent Skill

preline-theme-generator 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

11,524

周安装

485

GitHub Stars

6,292

下载量

4,035
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:preline-theme-generator(预行主题生成器)
来源仓库:https://github.com/htmlstreamofficial/preline
仓库路径:skills/preline-theme-generator
安装命令:
npx skills add https://github.com/htmlstreamofficial/preline --skill preline-theme-generator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/htmlstreamofficial/preline --skill preline-theme-generator

简介

从自然语言描述生成完整的 Preline 主题 CSS 文件。

  • 解释用户请求以确定主题配置(色调、风格、调色板情绪)并自动创建 JSON 配置文件
  • 以静默方式运行主题生成器脚本,并输出具有连贯明暗模式的即用型 CSS 文件
  • 生成全面的标记覆盖范围,包括表面、边框、主要/次要/破坏性色带和特定于组件的标记(导航栏、侧边栏、卡片、下拉菜单等)
  • 主题激活仅需要 CSS 导入和数据主题
  • HTML 元素上的属性;无需更改 HTML 实用程序类
  • 支持自定义调色板、版式标记和可选行为覆盖,所有这些都旨在防止影响非主题页面

SKILL.md

Preline Theme Generator

This file is for the AGENT (LLM) only — not end users.

Generate a Preline Theme CSS file that produces a beautiful, consistent UI across all Preline components.


Docs

  • docs/step-1.md to docs/step-7.md (detailed workflow guidance)
  • docs/palette-guidance.md (mood, hue, neutral mapping, OKLCH rules)
  • docs/validation-checklist.md
  • docs/token-reference.md
  • docs/examples.md

Agent workflow (FOLLOW THIS)

When user requests a theme, the agent MUST:

Step 1: Interpret user request

Parse the natural language description and determine the config inputs. See docs/step-1.md and docs/palette-guidance.md.

Step 2: Detect themes folder

Find where existing themes are stored in the user's project:

# Look for existing theme.css to find the themes folder
find . -name "theme.css" -path "*/themes/*" -not -path "*/node_modules/*" 2>/dev/null | head -1

If no themes folder found: ask user where they want the theme file saved. See docs/step-2.md.

Step 3: Create temp config file (AUTO-RUN, NO PROMPT)

Write a JSON config. This must run silently without user approval.

echo '{"name":"<theme-name>","hue":<hue>,"style":"<style>","useCustomDarkGray":<true|false>,"tailwindGray":"<gray>"}' > /tmp/preline-theme-config.json

Step 4: Run the generator + cleanup (AUTO-RUN, NO PROMPT)

Run generator and immediately delete temp file in a single command chain. This must run silently without user approval.

Option A (preferred) - use npx if preline is installed:

npx preline-theme-generator /tmp/preline-theme-config.json <themes-folder>/<theme-name>.css && rm /tmp/preline-theme-config.json

Option B - find and run the script directly:

node $(find . -path "*/preline/skills/theme-generator/scripts/generate-theme.js" 2>/dev/null | head -1) /tmp/preline-theme-config.json <themes-folder>/<theme-name>.css && rm /tmp/preline-theme-config.json

Option C - if script location is known (e.g., in node_modules):

node node_modules/preline/skills/theme-generator/scripts/generate-theme.js /tmp/preline-theme-config.json <themes-folder>/<theme-name>.css && rm /tmp/preline-theme-config.json

Step 5: Confirm to user

Tell user the theme was created and show enable snippet:

/* In your main CSS file */
@import "./themes/<theme-name>.css";
<!-- On HTML element -->
<html data-theme="theme-<theme-name>">

See docs/step-5.md and docs/examples.md for response examples.


Generated themes include

  • Coherent light + dark modes
  • Safe to ship (valid CSS, correct selectors)
  • No HTML class changes required (only data-theme + optional .dark)
  • Custom color palettes in @theme theme-<name> inline {} block

Example prompts

Simple:

"Create a sunset theme"

Descriptive:

"Create a theme that feels like a cozy coffee shop — warm browns, cream backgrounds, inviting and calm"

Specific:

"Generate a cyberpunk theme with neon cyan accents on dark surfaces"

Brand-focused:

"Create a theme matching this brand color #2F6BFF — professional, high-clarity SaaS feel"

RULES (ALL MUST BE FOLLOWED)

Rule 1 — Do not modify the shipped base theme

  • Never change theme.css. Always generate a separate theme file.

Rule 2 — Theme file MUST include imports in this exact order

Every generated theme file MUST begin with:

@import "./theme.css";

Rule 3 — Theme scoping block placement

Every theme file MUST include a scoping block after imports:

@theme theme-<name> inline {
  /* Theme scoping - custom palettes only */
}

What goes INSIDE this block:

  • Custom color palettes (soft grays, brand colors) — these create Tailwind utilities
  • Example: --color-<name>-50: oklch(98% 0.003 <hue>); through --color-<name>-950

What goes OUTSIDE (in selector blocks):

  • All semantic token overrides (--background, --primary, --navbar-*, etc.)
  • Tailwind core mappings are owned by the shipped base theme only

See docs/palette-guidance.md for palette construction details and examples.

Rule 4 — No HTML utility class edits required

  • Theme must NOT require users to change Tailwind utility classes in HTML.
  • Theme activation must work using ONLY:

- CSS imports - data-theme="theme-<name>"

  • Dark mode may use .dark if the project uses it; do not introduce new conventions.

Rule 5 — Use exact, required theme selectors

Light mode token overrides MUST be under:

:root[data-theme="theme-<name>"],
[data-theme="theme-<name>"] { ... }

Dark mode overrides MUST be theme-scoped and use:

[data-theme="theme-<name>"].dark { ... }

Rule 6 — Full-theme mode: comprehensive token coverage is REQUIRED

Because this generator is full-theme mode, output MUST define a comprehensive set of token values so the theme looks complete and intentional.

At minimum, the theme MUST define:

6.1 Global surfaces + text

  • --background
  • --background-1
  • --background-2
  • --background-plain
  • --foreground
  • --foreground-inverse
  • --inverse

6.2 Borders (full scale)

  • --border
  • --border-line-inverse
  • --border-line-1 through --border-line-8 (coherent scale)

6.3 Primary ramp (full) + primary states

  • --primary-50 through --primary-950
  • --primary
  • --primary-hover
  • --primary-focus
  • --primary-active
  • --primary-checked
  • --primary-foreground (must be readable)

6.4 Secondary / muted / destructive (at least)

  • --secondary
  • --muted
  • --destructive
  • Include related state/variant tokens if they exist in the base naming system.

6.5 Core component groups for a complete theme feel (prefer explicit values)

Provide explicit values for major component groups so the theme feels cohesive:

  • --navbar-*
  • --sidebar-*
  • --card-*
  • --dropdown-*
  • --select-*
  • --overlay-*
  • --popover-*
  • --tooltip-*
  • Optionally: --scrollbar-*
  • Charts/maps tokens ONLY if included safely (see Rule 10)

Full-theme output MUST NOT:

  • put token definitions inside the @theme block
  • invent new mappings that force HTML class edits

Rule 7 — Token naming must match Preline's token system

  • Do not invent random token names for Preline components.
  • Only introduce new custom tokens if explicitly requested, and keep them isolated and documented in comments.

Rule 8 — Theme-scoped behavior overrides ONLY

If the theme changes behavior (e.g. retro-sharp radii), it MUST be scoped to the theme only.

Allowed:

  • Override radius tokens under the theme selector
  • Add @layer utilities rules scoped to the theme selector

Not allowed:

  • Global .rounded {...} overrides without theme scoping
  • Any behavior overrides that affect non-theme pages

Rule 9 — Typography tokens are allowed, but font loading is separate by default

If fonts are requested, you MAY set:

  • --font-sans and/or --font-serif and/or --font-mono

inside the theme selector.

Do NOT add Google Fonts @import url(...) into the theme file unless the user explicitly requests it. (Font loading typically belongs in the main CSS entry file.)

Rule 10 — Charts/maps compatibility rules

If adjusting chart/map tokens:

  • Prefer safe formats where required by libraries.
  • Keep any *-hex tokens as valid hex values if the ecosystem expects hex.
  • Do not force oklch(...) where it may break gradients or third-party rendering.

Rule 11 — Valid CSS is mandatory

  • No missing braces
  • No invalid selectors
  • No broken comments
  • No duplicate conflicting selectors

Rule 12 — Output discipline

  • First code block must contain ONLY the generated theme CSS.
  • Optional second code block may contain ONLY the enable snippet.
  • No additional commentary unless explicitly requested.

Required file structure (MUST follow order)

  1. Imports (@import "./theme.css")
  2. Theme scoping block (@theme theme-<name> inline {}) — contains custom color palettes only
  3. Light mode theme selector block (full semantic token set using var() references)
  4. Dark mode theme selector block (override only what differs, use var() for consistency)
  5. Optional theme-scoped @layer utilities overrides (only if requested)

Additional guidance

  • Theme construction details: docs/step-6.md and docs/step-7.md
  • Palette guidance: docs/palette-guidance.md
  • Validation checklist: docs/validation-checklist.md
  • Token reference: docs/token-reference.md

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

37.44%
按下载量换算1,511

Claude

28.97%
按下载量换算1,169

Cursor

19.57%
按下载量换算790

Gemini CLI

9.44%
按下载量换算381

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

来源信息

继续浏览同类 Skills