Skip to content

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

Open
bitjaru wants to merge 1 commit intoPatrickJS:mainfrom
bitjaru:add-styleseed
Open

Add StyleSeed Design Engine cursorrules (React, Tailwind v4, shadcn/ui)#245
bitjaru wants to merge 1 commit 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 StyleSeed Design Engine style guide with comprehensive UI/UX rules, golden principles, typography standards, semantic color tokens, and Tailwind v4 best practices for consistent production-grade interface generation.

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

📝 Walkthrough

Walkthrough

A new StyleSeed Design Engine cursorrules file was added to enforce consistent React/Tailwind v4 UI output with strict typography, color, spacing, and component conventions. The root README was updated with an entry referencing this new design system rules guide.

Changes

Cohort / File(s) Summary
Documentation Entry
README.md
Added reference to the new StyleSeed Design Engine cursorrules file with description of its contents and benefits.
StyleSeed Design Engine Rules
rules/styleseed-design-engine-cursorrules-prompt-file/.cursorrules, rules/styleseed-design-engine-cursorrules-prompt-file/README.md
New cursorrules file establishing production-grade UI/UX constraints (layout, typography, colors, shadows, accessibility) and component conventions for React/Tailwind v4. Accompanying README documents supported builds, stated benefits, and design system alignment.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

  • Add Toss-Style Design System Rules #238: The new StyleSeed cursorrules rules and documentation align with design-system-driven cursor rules that enforce consistent UI patterns, single-accent colors, typography hierarchies, and Tailwind v4 best practices across multiple project skins.

Suggested reviewers

  • PatrickJS

Poem

🐰✨ A rabbit hops with glee,
New rules for design harmony—
Tailwind and shadcn aligned,
Typography refined,
No ugly AI, just pristine! 🎨

🚥 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 and concisely describes the main change: adding a new StyleSeed Design Engine cursorrules resource covering React, Tailwind v4, and shadcn/ui, which aligns with the three files added (the main .cursorrules file, its README, and the README.md entry).
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

- [JavaScript (Astro, Tailwind CSS)](./rules/javascript-astro-tailwind-css-cursorrules-prompt-f/.cursorrules) - Cursor rules for JavaScript development with Astro and Tailwind CSS integration.
- [React (Styled Components)](./rules/react-styled-components-cursorrules-prompt-file/.cursorrules) - Cursor rules for React development with Styled Components integration.
- [React (Chakra UI)](./rules/react-chakra-ui-cursorrules-prompt-file/.cursorrules) - Cursor rules for React development with Chakra UI integration.
- [StyleSeed Design Engine (React, Tailwind v4, shadcn/ui)](./rules/styleseed-design-engine-cursorrules-prompt-file/.cursorrules) - Cursor rules extracted from the StyleSeed design engine. 10 Golden Rules, a font-size-by-context table, semantic color tokens, and Tailwind v4 anti-pattern guards that stop Cursor from generating ugly, generic UI and make it produce Toss / Stripe / Linear quality output.
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 | 🟡 Minor

Entry should be placed in alphabetical order.

The "CSS and Styling" section entries should be alphabetically ordered. Currently, the StyleSeed entry is placed at the end, but it should be positioned between "React (Chakra UI)" and the Tailwind entries for alphabetical consistency.

As per coding guidelines: "Maintain alphabetical order within each category in the README.md file".

📝 Suggested reordering of CSS and Styling section

The correct alphabetical order should be:

  1. HTML (Tailwind CSS, JavaScript)
  2. JavaScript (Astro, Tailwind CSS)
  3. React (Chakra UI)
  4. React (Styled Components)
  5. StyleSeed Design Engine (React, Tailwind v4, shadcn/ui) ← should be here
  6. Tailwind (React, Firebase)
  7. Tailwind (shadcn/ui Integration)
  8. Tailwind CSS (Next.js Guide)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at 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.

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