preline-theme-generator

htmlstreamofficial/preline · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/htmlstreamofficial/preline --skill preline-theme-generator
0 commentsdiscussion
summary

Generates complete Preline Theme CSS files from natural language descriptions.

  • Interprets user requests to determine theme configuration (hue, style, palette mood) and automatically creates a JSON config file
  • Runs the theme generator script silently and outputs a ready-to-use CSS file with coherent light and dark modes
  • Generates comprehensive token coverage including surfaces, borders, primary/secondary/destructive color ramps, and component-specific tokens (navbar, sidebar, card, dr
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
how to use preline-theme-generator

How to use preline-theme-generator on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add preline-theme-generator
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

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

The skills CLI fetches preline-theme-generator from GitHub repository htmlstreamofficial/preline and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/preline-theme-generator

Reload or restart Cursor to activate preline-theme-generator. Access the skill through slash commands (e.g., /preline-theme-generator) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.832 reviews
  • Ava Kim· Dec 24, 2024

    preline-theme-generator is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Hiroshi Robinson· Dec 20, 2024

    preline-theme-generator fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Ganesh Mohane· Dec 8, 2024

    Keeps context tight: preline-theme-generator is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Sakshi Patil· Nov 27, 2024

    preline-theme-generator has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Arjun Martinez· Nov 15, 2024

    Solid pick for teams standardizing on skills: preline-theme-generator is focused, and the summary matches what you get after install.

  • Hiroshi Choi· Nov 11, 2024

    Registry listing for preline-theme-generator matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Amelia Sethi· Nov 7, 2024

    Useful defaults in preline-theme-generator — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Arya Jain· Oct 26, 2024

    I recommend preline-theme-generator for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Chaitanya Patil· Oct 18, 2024

    Solid pick for teams standardizing on skills: preline-theme-generator is focused, and the summary matches what you get after install.

  • Liam Gill· Oct 6, 2024

    preline-theme-generator has been reliable in day-to-day use. Documentation quality is above average for community skills.

showing 1-10 of 32

1 / 4