styling-conventions

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

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.

agentmods
npx agentmods add rules/thematters/matters-web/styling-conventions
Clone the repo
git clone --depth 1 https://github.com/thematters/matters-web

Made for: Cursor.

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. Scan, not verified.
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 $0.00457 $0.00457
Opus 5 $0.00229 $0.00229
Sonnet 5 $0.00091 $0.00091
Haiku 4.5 $0.00046 $0.00046

Measured 3d ago against content hash 3eee5bbd4da7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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. 3d 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 1mo ago), licensed Apache-2.0. It adds 457 tokens to every session, about $0.0023 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-30.