styling-conventions

styling-conventions is a cursor rule for Cursor from thematters/matters-web. It costs 457 tokens per session, scanned A, original, Apache-2.0.

A project’s rules for writing component and page styles with CSS Modules and PostCSS. CSS Modules keep class names local to each component, while PostCSS processes the styles.

In plain words
What is it for?
Use it when adding or changing React component styles, shared styles, themes, responsive layouts, or conditional class names.
Why use it?
It helps developers find styles in predictable places and reduces conflicts between components.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when adding or changing React component styles, shared styles, themes, responsive layouts, or conditional class names.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/thematters/matters-web/styling-conventions
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/thematters/matters-web

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 styling-conventions

README.md
[![agentmods](https://agentmods.dev/badge/rules/thematters/matters-web/styling-conventions/github.svg)](https://agentmods.dev/rules/thematters/matters-web/styling-conventions)
Your own site
<a href="https://agentmods.dev/rules/thematters/matters-web/styling-conventions"><img src="https://agentmods.dev/badge/rules/thematters/matters-web/styling-conventions/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 styling-conventions

Your own site · 80×15
<a href="https://agentmods.dev/rules/thematters/matters-web/styling-conventions"><img src="https://agentmods.dev/badge/rules/thematters/matters-web/styling-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 457 This file is loaded in full into every session.
When invoked 457 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.00457 $0.00457
Opus 5.5 $0.00183 $0.00183
Sonnet 5.5 $0.00091 $0.00091
Haiku 4.5 $0.00046 $0.00046

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

Security

Grade A, and why

styling-conventions 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/styling-conventions.mdc · 62 lines

What it actually says

Styling Conventions

Matters Web uses CSS Modules and PostCSS for component and page styling.

CSS Structure

  • Component styles are defined in a styles.module.css file within each component directory
  • Global styles are defined in the src/common/styles directory and imported in src/pages/_app.tsx
  • The project uses PostCSS for CSS processing with various plugins, notably including postcss-mixins (for @mixin) and postcss-preset-env (for future CSS features and vendor prefixing).

CSS Modules

  • CSS files are imported as modules
  • This provides local scoping of CSS classes
  • Class names are composed to avoid duplication
  • CSS variables are used for theming
  • Classes can be conditionally applied using the classNames utility

Example:

import classNames from 'classnames'
import styles from './styles.module.css'

const Component = () => {
  const containerClasses = classNames({
    [styles.container]: true,
    [styles.hasCover]: !!cover,
  })

  return <div className={containerClasses}>Content</div>
}

Theme & Variables

  • Color variables and theme definitions are in global CSS files
  • Media queries are used for responsive design
  • The application supports light and dark modes

Key Style Files

  • src/common/styles/variables: CSS variables for colors, spacing, typography, etc.
  • src/common/styles/mixin.css: Reuseable mixins for layouts, borders, etc.
  • src/common/styles/bases: Global base styles and resets
  • src/common/styles/components: Shared component styles
  • src/common/styles/vendors: Thrid-party component styles

Naming Conventions

  • Use camelCase ({property}{Value}) for component classes, e.g. textGreen, borderRed, spacingTop, fontMedium
  • Use hyphens for variables and mixins, e.g. --sp4, @mixin flex-center-start

PostCSS Configuration

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 · 62 lines · 457 tokens per session scan A 3eee5bbd4da7

Subscribe to this mod's changes

styling-conventions is a cursor rule published in the GitHub repository thematters/matters-web (86 stars, last pushed 5d ago), licensed Apache-2.0. It adds 457 tokens to every session, about $0.0018 per session on Opus 5.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-30.