Skip to content

Add StyleSeed Design Engine cursorrules (React, Tailwind v4, shadcn/ui)#245

Open
bitjaru wants to merge 2 commits intoPatrickJS:mainfrom
bitjaru:add-styleseed
Open

Add StyleSeed Design Engine cursorrules (React, Tailwind v4, shadcn/ui)#245
bitjaru wants to merge 2 commits intoPatrickJS:mainfrom
bitjaru:add-styleseed

Conversation

@bitjaru
Copy link
Copy Markdown

@bitjaru bitjaru commented Apr 13, 2026

Adds the StyleSeed Design Engine cursorrules under CSS and Styling.

Upstream: https://github.com/bitjaru/styleseed (184 ⭐, MIT)

What this adds

  • rules/styleseed-design-engine-cursorrules-prompt-file/.cursorrules — the actual ruleset
  • rules/styleseed-design-engine-cursorrules-prompt-file/README.md — description / synopsis
  • One line in the main README under CSS and Styling

Why this is different from existing Tailwind rules

The existing Tailwind / shadcn rules teach Cursor how to use Tailwind and shadcn/ui. StyleSeed teaches Cursor design judgment:

  • 10 Golden Rules that prevent AI design anti-patterns (pure black text, generic shadows, random spacing, repeated section types)
  • Font Size by Context table — explicit px values for hero cards, KPI cards, list items, chart stats, so Cursor stops guessing sizes
  • Tailwind v4 anti-pattern guards — blocks the --text-* namespace conflict and text-[var(--x)] color-vs-size bug that silently break projects
  • Semantic token disciplinetext-brand, bg-card, never hardcoded hex
  • Component conventionsdata-slot, cn(), CVA, asChild, size-4, ms-* — shadcn/ui compatible

The rules are extracted from the open-source StyleSeed design engine, which distills 69 documented design rules from Toss, Stripe, Linear, Vercel, and Notion.

Checklist

  • Folder follows {topic}-cursorrules-prompt-file convention
  • Contains both .cursorrules and README.md
  • README has Author / What you can build / Benefits / Synopsis / Overview sections
  • Added to main README under the appropriate category (CSS and Styling)
  • Single resource per PR
  • MIT licensed upstream

Summary by CodeRabbit

  • Documentation
    • Added a StyleSeed Design Engine style guide: comprehensive UI/UX rules and "10 Golden Rules" for React + Tailwind v4 interfaces, typography and semantic color token standards, accessibility and interaction guidelines, component conventions aligned with shadcn/ui/Radix patterns, and Tailwind best-practice restrictions to ensure consistent, production-grade UI output across dashboards, admin tools, and component libraries.

Adds .cursorrules and README.md for the StyleSeed design engine under
CSS and Styling. Extracted from https://github.com/bitjaru/styleseed —
an open-source design engine with 69 design rules, 48 shadcn-style
components, and brand skins (Toss, Stripe, Linear, Vercel, Notion).

The ruleset encodes 10 Golden Rules, a font-size-by-context table,
semantic color tokens, and Tailwind v4 anti-pattern guards so Cursor
produces professionally-judged UI instead of generic AI output.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 184a8694-0b65-4c05-92d1-356a3fc78c22

📥 Commits

Reviewing files that changed from the base of the PR and between 76b99b8 and 19b7b4d.

📒 Files selected for processing (1)
  • README.md
✅ Files skipped from review due to trivial changes (1)
  • README.md

📝 Walkthrough

Walkthrough

Added a new StyleSeed Design Engine CursorRules prompt file and its README under rules/styleseed-design-engine-cursorrules-prompt-file/, and updated the repository README.md with a reference to that ruleset describing production-grade React + Tailwind v4 UI constraints.

Changes

Cohort / File(s) Summary
Repository README
README.md
Inserted a new bullet under "CSS and Styling" linking to the StyleSeed Design Engine .cursorrules and briefly describing its purpose.
StyleSeed Design Engine ruleset
rules/styleseed-design-engine-cursorrules-prompt-file/.cursorrules, rules/styleseed-design-engine-cursorrules-prompt-file/README.md
Added a comprehensive CursorRules file and README defining strict UI/UX and frontend-generation rules for React/TypeScript/Tailwind v4 (typography, spacing, color tokens, shadows, accessibility, component conventions, forbidden patterns, and audit workflow).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

  • Add Toss-Style Design System Rules #238 — Highly related: both introduce a StyleSeed-derived .cursorrules with single-accent token, typography hierarchy, forbidden Tailwind patterns, and accessibility/shadow limits.

Suggested reviewers

  • PatrickJS

Poem

🐇✨ I nibble on pixels bright,
I tuck each card snug, left and right.
One brand hue, tidy type in tune,
Tailwind hops under the moon.
Fresh UI blooms — a designer's boon.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding StyleSeed Design Engine cursorrules with specific tech stack context (React, Tailwind v4, shadcn/ui).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Line 178: Move the "StyleSeed Design Engine (React, Tailwind v4, shadcn/ui)"
entry into the CSS and Styling section so entries remain alphabetically ordered:
place it after the "React (Chakra UI)" entry and before the Tailwind entries
(e.g., before "Tailwind (React, Firebase)" / "Tailwind (shadcn/ui
Integration)"), ensuring the list reads: React (Chakra UI) → React (Styled
Components) → StyleSeed Design Engine → Tailwind entries; update any surrounding
punctuation or list markers to keep formatting consistent.

In `@rules/styleseed-design-engine-cursorrules-prompt-file/.cursorrules`:
- Around line 35-41: Update the anti-patterns text to correct the variable name
and clarify the Tailwind behavior: replace the claim "NEVER change `--font-size`
in `theme.css`. Every `rem`-based class (`h-14`, `px-6`, `gap-3`) depends on
it." to reference `--spacing` (e.g., "NEVER change `--spacing` in `theme.css`.
Spacing/sizing utilities (`px-6`, `gap-3`, `h-14`) depend on `--spacing`"), and
revise the `text-[var(--anything)]` line to explain the ambiguity and show the
correct syntaxes (`text-[length:var(--custom)]` or shorthand `text-[--custom]`)
for using CSS variables as font sizes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de81ea34-770b-4a24-9f7a-1068dbe9c303

📥 Commits

Reviewing files that changed from the base of the PR and between fc2ce04 and 76b99b8.

📒 Files selected for processing (3)
  • README.md
  • rules/styleseed-design-engine-cursorrules-prompt-file/.cursorrules
  • rules/styleseed-design-engine-cursorrules-prompt-file/README.md

Comment thread README.md Outdated
Comment on lines +35 to +41
## Typography anti-patterns (NEVER do these)

- ❌ NEVER create CSS variables for font sizes (`--text-sm`, `--fs-body`). They conflict with Tailwind v4's `--text-*` namespace and silently break line-height and spacing.
- ❌ NEVER use `text-[var(--anything)]` — Tailwind v4 interprets this as a color, not a font size.
- ❌ NEVER change `--font-size` in `theme.css`. Every `rem`-based class (`h-14`, `px-6`, `gap-3`) depends on it.
- ✅ ALWAYS use explicit px values: `text-[36px]`, `text-[18px]`, `text-[13px]`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Tailwind CSS v4 CSS variable namespaces and arbitrary value syntax for text-[var(--custom)]

💡 Result:

In Tailwind CSS v4, theme variables are organized into specific namespaces defined using the @theme directive. Each namespace corresponds to utility classes or variants. Key namespaces include: --color-: Colors for utilities like bg-red-500, text-sky-300 --font-: Font families like font-sans --text-: Font sizes like text-xl --spacing-: Spacing/sizing like px-4, max-h-16 --radius-: Border radius like rounded-sm --shadow-: Box shadows like shadow-md --breakpoint-: Responsive variants like sm: And others like --font-weight-, --leading-, etc. These are defined in official docs at tailwindcss.com/docs/theme#theme-variable-namespaces. For arbitrary values using CSS variables, like text-[var(--custom)], use the shorthand syntax text-[--custom] which generates font-size: var(--custom);. Tailwind automatically wraps --custom in var. The text- prefix is ambiguous (font-size vs color), so specify the type hint: text-[length:--custom] for font-size: var(--custom); or text-[color:--custom] for color: var(--custom);. This works in v4 as the arbitrary value syntax remains consistent with v3 enhancements.

Citations:


🌐 Web query:

Tailwind CSS v4 font-size configuration and rem-based spacing behavior

💡 Result:

In Tailwind CSS v4, font-size configuration uses CSS theme variables with the @theme directive. Default utilities like text-xs to text-9xl map to --text-* variables defined as rem values (e.g., --text-xs: 0.75rem; --text-base: 1rem;), paired with sub-variables for line-height like --text-xs--line-height: calc(1 / 0.75);. Custom font sizes are added via @theme { --text-custom: 1.125rem; --text-custom--line-height: 1.75rem; --text-custom--font-weight: 700; }, generating text-custom utility. Spacing (margin, padding, gap, etc.) uses a dynamic rem-based multiplier system driven by a single --spacing theme variable, defaulting to 0.25rem (4px at 16px root font). Utilities compute as calc(var(--spacing) * N), e.g., m-4 is margin: calc(var(--spacing) * 4); or 1rem. This enables arbitrary values like m-42 without predefined scales. Customize with @theme { --spacing: 1px; } for pixel-based or other units. Values support integers and .25/.5/.75 decimals for legacy compatibility (e.g., m-1.5). Logical properties (ms-, pe-) and space-* utilities also leverage this system.

Citations:


Correct the CSS variable that controls spacing classes in the anti-patterns section.

The warning about --text-* namespace conflicts is accurate, but line 39 contains a critical error:

  • The claim states: "Every rem-based class (h-14, px-6, gap-3) depends on it [--font-size]"
  • Actual behavior: Spacing classes (px-6, gap-3, h-14, etc.) depend on the --spacing variable in Tailwind v4, not --font-size. The --spacing variable defaults to 0.25rem and controls all spacing/sizing utilities via calc(var(--spacing) * N).
  • --font-size is reserved solely for font configuration and does not affect spacing utilities.

Additionally, the statement about text-[var(--anything)] being "interpreted as a color" is misleading. The actual issue is that the text- prefix is ambiguous without a type hint. Use text-[length:--custom] or the shorthand text-[--custom] for proper font-size application with CSS variables.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rules/styleseed-design-engine-cursorrules-prompt-file/.cursorrules` around
lines 35 - 41, Update the anti-patterns text to correct the variable name and
clarify the Tailwind behavior: replace the claim "NEVER change `--font-size` in
`theme.css`. Every `rem`-based class (`h-14`, `px-6`, `gap-3`) depends on it."
to reference `--spacing` (e.g., "NEVER change `--spacing` in `theme.css`.
Spacing/sizing utilities (`px-6`, `gap-3`, `h-14`) depend on `--spacing`"), and
revise the `text-[var(--anything)]` line to explain the ambiguity and show the
correct syntaxes (`text-[length:var(--custom)]` or shorthand `text-[--custom]`)
for using CSS variables as font sizes.

@bitjaru
Copy link
Copy Markdown
Author

bitjaru commented Apr 13, 2026

Quick update for reviewers — just shipped a live interactive demo so you can see the engine without cloning anything:

🎬 https://styleseed-demo.vercel.app

Click the Toss / Raycast / Arc switcher to watch the same chat UI morph across three brand DNAs — colors, radius, motion, shadows, gradients all driven by StyleSeed tokens via a single data-skin attribute. Hopefully this helps with evaluation. Thanks for taking a look 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant