css-ui-enforcement

css-ui-enforcement is a cursor rule for Cursor from Kevin-Liu-01/Sigil-UI. It costs 772 tokens per session, scanned A, original, MIT.

A set of CSS rules for React interfaces, favoring Tailwind utility classes and a class-merging helper called cn(). It also defines conventions for scrollbars, clickable areas, gradients, and global styles.

In plain words
What is it for?
Enforcing React styling conventions, responsive and dark-mode classes, scrollbar behavior, larger hit areas, animatable gradients, and limited global CSS.
Why use it?
It prevents styling from becoming scattered across one-off stylesheets, inline styles, and conflicting class names. The rules clarify which styles belong on components and which belong globally.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Claude Code.

Good fit Enforcing React styling conventions, responsive and dark-mode classes, scrollbar behavior, larger hit areas, animatable gradients, and limited global CSS.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/kevin-liu-01/sigil-ui/css-ui-enforcement
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/Kevin-Liu-01/Sigil-UI

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 css-ui-enforcement

README.md
[![agentmods](https://agentmods.dev/badge/rules/kevin-liu-01/sigil-ui/css-ui-enforcement.svg)](https://agentmods.dev/rules/kevin-liu-01/sigil-ui/css-ui-enforcement)
Your own site
<a href="https://agentmods.dev/rules/kevin-liu-01/sigil-ui/css-ui-enforcement"><img src="https://agentmods.dev/badge/rules/kevin-liu-01/sigil-ui/css-ui-enforcement.svg" alt="Measured on agentmods" height="20"></a>
Per session 772 This file is loaded in full into every session.
When invoked 772 The same file — it is already loaded in full.
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.00772 $0.00772
Opus 5 $0.00386 $0.00386
Sonnet 5 $0.00154 $0.00154
Haiku 4.5 $0.00077 $0.00077

Measured 8d ago against content hash 447b8ea1c76e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

css-ui-enforcement 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 8d 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/css-ui-enforcement.mdc · 92 lines

How it starts

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

CSS UI Enforcement

Hard UI conventions imported from Kevin's wiki (wiki/style/css-ui-enforcement.md). Default surface: Tailwind utilities + cn() only. Raw CSS is a last resort. Cross-reference: sigil-design-system.mdc (token consumption), taste-enforcement.mdc (anti-slop).

ENFORCE: Tailwind + cn() first; globals.css only for "nowhere else" rules

Ship UI as:

  • className={cn(...)} everywhere: layout, spacing, color, typography, states, responsive, dark mode.
  • cn() = clsx + tailwind-merge (from ~/lib/utils).

Avoid:

  • Co-located .css / .module.css for ordinary component styling — if it can be a utility, it must be.
  • <style> tags, ad-hoc .scss, and one-off stylesheets per feature.

globals.css (or equivalent) — allowed only for what Tailwind cannot own cleanly:

  • @layer base resets
  • @font-face
  • Document-wide scrollbar defaults
  • @property registrations
  • Global @keyframes
  • :root / html / body theme plumbing
  • Third-party overrides that must target foreign selectors

If a rule could be a utility on the element, do not put it in globals.

ENFORCE: No style + className soup (React)

Do not mix Tailwind on className with ad-hoc style={{ ... }} on the same node.

Do instead:

  • Static visuals → Tailwind on className via cn().
  • Dynamic but design-shaped → CSS variables on :root / theme layer or inline --token plus Tailwind arbitrary values.

Exceptions:

  • Runtime-only values (drag position, live chart layout, embed constraints).
  • No "couldn't find the class" exception.

ENFORCE: Scrollbars (thin + neutral)

Prefer Tailwind scrollbar plugin if the project has one. Otherwise define once in globals.css:

* {
  scrollbar-width: thin;
  scrollbar-color: gray transparent;
}

Add ::-webkit-scrollbar rules in the same global block. Never per-component.

ENFORCE: Hit area expansion (Tailwind-first)

Prefer Tailwind pseudo utilities on the interactive node:

Read the full file on GitHub · 92 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. 8d ago First seen · 92 lines · 772 tokens per session scan A 447b8ea1c76e

Subscribe to this mod's changes

css-ui-enforcement is a cursor rule published in the GitHub repository Kevin-Liu-01/Sigil-UI (9 stars, last pushed 1mo ago), licensed MIT. It adds 772 tokens to every session, about $0.0039 per session on Opus 5. 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.