modus-angular-themes

A set of rules for switching and saving six Modus themes in an Angular application built with Vite. Angular is a web application framework, and Vite is a development and build tool.

In plain words
What is it for?
Use it when implementing theme selection, remembering the selected theme, or checking whether the active theme is dark or modern.
Why use it?
It provides a defined theme structure so light, dark, classic, modern, and Connect themes can be managed consistently.

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/julianoczkowski/create-trimble-app/modus-angular-themes
Clone the repo
git clone --depth 1 https://github.com/julianoczkowski/create-trimble-app

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,521 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.01521
Opus 5 $0.00000 $0.00760
Sonnet 5 $0.00000 $0.00304
Haiku 4.5 $0.00000 $0.00152

Measured 2d ago against content hash e47517fab946, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

modus-angular-themes 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 2d 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.

templates/angular/.cursor/rules/modus-angular-themes.mdc · 223 lines

How it starts

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

Modus Themes Implementation in Angular + Vite

Theme System Overview

This Angular + Vite application supports 6 Modus themes with proper theme switching, persistence, and service-based management.

Available Themes: 4 Modus themes + 2 Connect themes

  • modus-classic-light / modus-classic-dark
  • modus-modern-light / modus-modern-dark
  • connect-light / connect-dark

Theme Architecture

ThemeService Implementation

import { Injectable, signal, computed } from '@angular/core';

export type Theme =
  | 'modus-classic-light'
  | 'modus-classic-dark'
  | 'modus-modern-light'
  | 'modus-modern-dark'
  | 'connect-light'
  | 'connect-dark';

const VALID_THEMES: Theme[] = [
  'modus-classic-light',
  'modus-classic-dark',
  'modus-modern-light',
  'modus-modern-dark',
  'connect-light',
  'connect-dark',
];

@Injectable({ providedIn: 'root' })
export class ThemeService {
  private readonly themeSignal = signal<Theme>('modus-classic-light');

  readonly currentTheme = this.themeSignal.asReadonly();
  readonly isDark = computed(() => this.themeSignal().includes('dark'));
  readonly isModern = computed(() => this.themeSignal().includes('modern'));

  constructor() {
    this.loadThemeFromStorage();
  }

  private loadThemeFromStorage(): void {
    if (typeof window !== 'undefined') {
      try {
        const savedTheme = window.localStorage.getItem('preferred-theme') as Theme | null;
        if (savedTheme && VALID_THEMES.includes(savedTheme)) {
          this.setTheme(savedTheme);
        }
      } catch (error) {
        console.warn('Unable to read stored theme preference:', error);
      }
    }
  }

  setTheme(theme: Theme): void {
    this.themeSignal.set(theme);
    
    // Apply theme to document
    document.documentElement.setAttribute('data-theme', theme);
    
    // Persist to localStorage
    try {
      window.localStorage.setItem('preferred-theme', theme);
    } catch (error) {
      console.warn('Unable to persist theme preference:', error);
    }
  }
}

Read the full file on GitHub · 223 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. 2d ago First seen · 223 lines · 0 tokens per session scan A e47517fab946

Subscribe to this mod's changes

modus-angular-themes is a cursor rule published in the GitHub repository julianoczkowski/create-trimble-app (3 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,521 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.