frontend-styling

frontend-styling is a cursor rule for Cursor from BetterTyped/hype-stack. It costs 0 tokens per session (616 once invoked), scanned A, original, MIT.

A set of conventions for styling client-facing applications and their user-interface components across web, admin, mobile, and browser-extension projects.

In plain words
What is it for?
Use it when building or reviewing frontend, administrator, mobile, or extension interfaces and their components.
Why use it?
It gives developers shared rules for keeping interface styling consistent across different parts of the product.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when building or reviewing frontend, administrator, mobile, or extension interfaces and their components.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/bettertyped/hype-stack/frontend-styling
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/BetterTyped/hype-stack

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for frontend-styling

README.md
[![agentmods](https://agentmods.dev/badge/rules/bettertyped/hype-stack/frontend-styling/github.svg)](https://agentmods.dev/rules/bettertyped/hype-stack/frontend-styling)
Your own site
<a href="https://agentmods.dev/rules/bettertyped/hype-stack/frontend-styling"><img src="https://agentmods.dev/badge/rules/bettertyped/hype-stack/frontend-styling/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for frontend-styling

Your own site · 80×15
<a href="https://agentmods.dev/rules/bettertyped/hype-stack/frontend-styling"><img src="https://agentmods.dev/badge/rules/bettertyped/hype-stack/frontend-styling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 616 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00616
Opus 5.5 $0.00000 $0.00246
Sonnet 5.5 $0.00000 $0.00123
Haiku 4.5 $0.00000 $0.00062

Measured 1mo ago against content hash 5b4f902b08f1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

frontend-styling scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/frontend-styling.mdc · 40 lines

How it starts

The opening of the file, as written. The whole thing — 40 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Frontend Styling

Applies to all client apps: apps/frontend, apps/admin, apps/mobile, and apps/extension.

Style all client UI with Tailwind CSS utility classes and shadcn/ui components. On mobile, Tailwind classes are applied through NativeWind on React Native primitives — the same utility-class conventions apply, but use React Native components instead of shadcn/ui, and skip the web-specific page layout section below.

  • Use Tailwind utility classes for layout, spacing, typography, and colors. Do not write custom CSS unless Tailwind cannot express the style.
  • Use existing shadcn/ui primitives from components/ui/ (Button, Input, Label, Card, Alert, Dialog, etc.) before creating custom components.
  • Compose variants with class-variance-authority (cva) when a component needs multiple visual states.
  • Use cn() from @/lib/utils to merge conditional class names.
  • Use CSS variables defined in assets/styles.css for theme tokens (colors, radius, etc.) rather than hard-coded hex values in application code.
  • Keep email templates (React Email in the backend) styled with the <Tailwind> wrapper from @react-email/components so the same utility-class approach applies to emails.

Page Layout Consistency (web apps only)

All pages rendered inside the app layout (<Outlet />) must follow the same structural pattern:

  • Full width. Pages use w-full - never constrain with max-w-* or mx-auto at the page level. The layout wrapper already handles padding (p-4).
  • Page header: icon + h1 title + description paragraph, matching the settings page pattern:
    <div className="w-full space-y-8">
      <div className="space-y-1">
        <div className="flex items-center gap-2.5">
          <Icon className="h-5 w-5 text-muted-foreground" />
          <h1 className="text-xl font-semibold tracking-tight">Page Title</h1>
        </div>
        <p className="text-sm text-muted-foreground">Description text.</p>
      </div>
      {/* page content */}
    </div>
    
  • No extra Card wrappers for top-level page content. Card is for distinct sections within a page (e.g., profile card, organization card inside settings). Don't wrap an entire feature's content in a Card just because it's a page - use the page header pattern above instead.
  • Do NOT add page-level padding (p-6, p-8, etc.) in route components - the layout already provides it.

Read the full file on GitHub · 40 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 40 lines · 0 tokens per session scan A 5b4f902b08f1

Subscribe to this mod's changes

frontend-styling is a cursor rule published in the GitHub repository BetterTyped/hype-stack (12 stars, last pushed 15d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 616 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.