/saschb2b-skills:theme-colorsfrom saschb2b-skills
Audits and refactors UI code to replace hardcoded color literals (hex, rgba, hsl, etc.) with theme palette tokens (primary, secondary, error, etc.) and the alpha() helper. Useful for enforcing consistent theming in MUI or custom design systems.
Ships in saschb2b-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Every color comes from the theme. No hex literals, no rgba() strings, no scattered values.
A theme defines colors by role (primary, secondary, error, surface, text) once, in one place. Components reference the role, not the value. Brand changes update one file. Dark mode is the same theme with different values. Components derive their own hover, focus, and pressed transparencies from the role color via the alpha() helper.
The most common failure mode in LLM-generated UI is hex codes sprinkled through component files (color: "#3B82F6", bgcolor: "#1E293B", background: "rgba(255,255,255,0.5)"). Training corpora are dominated by tutorial code that hardcodes colors. The defaults skew wrong.
| Role | Meaning | Used for |
|---|---|---|
primary | Main brand color | Main buttons, active tabs, key highlights |
secondary | Complementary accent | Switches, FABs, selection controls |
error | Something wrong or destructive | Error messages, delete buttons |
warning | Caution, not yet an error | Warning banners, risky-action confirmations |
info | Neutral information, no urgency | Tooltips, info badges, help text |
success | Positive outcome | Success notifications, completion |
background.default | Page background ("the desk") | The app's base background |
background.paper | Elevated surface ("paper on the desk") | Cards, dialogs, dropdowns, menus, drawers |
text.primary | Main text, high emphasis | Headings, body text |
text.secondary | De-emphasized text | Captions, timestamps, helper text |
Each role auto-derives .light, .dark, and .contrastText. Use the defaults; override only with a specific contrast or design reason.
Do this:
<Box sx={{ color: "text.primary", bgcolor: "background.paper" }}>
<Button color="primary">Save</Button>
</Box>
Not this:
<Box sx={{ color: "#1E293B", bgcolor: "#FFFFFF" }}>
<Button sx={{ bgcolor: "#3B82F6" }}>Save</Button>
</Box>
For transparency, use alpha() against a theme color, never a literal rgba():
import { alpha } from "@mui/material";
sx={(theme) => ({
bgcolor: alpha(theme.palette.secondary.main, 0.08),
})}
For gradients and any other string-typed CSS that needs theme values, use the sx callback form so the theme is available:
sx={(theme) => ({
background: `linear-gradient(135deg, ${theme.palette.primary.main} 0%, ${theme.palette.accent.alt} 100%)`,
})}
createTheme({ palette: { primary: { main: "#6366F1" } } })). The theme file is where hex values live, on purpose.Anything else gets a theme token.
grep -rEn '(#[0-9a-fA-F]{3,8}|rgba?\(|hsla?\(|oklch\()' src/ app/ components/
rgba(R, G, B, A), identify the role the RGB approximates and replace with alpha(theme.palette.<role>.<variant>, A). Use the sx callback when needed.sx={(theme) => ...} callback and interpolate theme.palette.<role>.<variant>.color: "blue", bg: "white"), replace with the closest theme role.alpha(), not in the palette definition. A pre-diluted theme color stacks with hover/focus/pressed overlays and looks wrong..light / .dark / .contrastText until you have a concrete contrast or design issue. The defaults are derived with perceptual contrast.Based on Why Developers Keep Asking for Primary Instead of Blue.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
theme-colors, color-tokens, design-system, ui-refactoring, mui-theming
26 skills in this plugin
/android-composeModern Android development with Jetpack Compose as the default UI toolkit and Material 3 Expressive as the default design direction, a dated snapshot. Covers Compose fundamentals (composables, modifiers, state hoisting, side effects, lazy lists, strong skipping, recomposition), Material 3 and Expressive theming and components (MaterialExpressiveTheme, MotionScheme, button groups, split buttons, FAB menu, floating toolbars, wavy progress indicators, shape morphing, dynamic color), architecture (ViewModel, StateFlow, collectAsStateWithLifecycle, Hilt), type-safe Navigation Compose and Navigation 3, data (Room, DataStore, Retrofit, Ktor, Coil), the Gradle Kotlin DSL build with version catalogs and KSP, testing, performance, and View interop. Use when building Android UI in Compose, theming with Material 3 or Expressive, wiring architecture or navigation, configuring the build, or debugging Compose issues. Check the project's versions first; re-verify version facts against the official Android and AndroidX docs./ask-uxForce UX questioning before any UI work, refactor, or redesign. Use when the user asks to design, redesign, restyle, polish, "fix", or "make nicer" a screen, component, page, or flow. Also use when the user describes a problem in UI terms ("the button is hard to find", "this form is confusing", "this page is ugly") and is about to reach for a visual fix, since most UI-shaped complaints have UX-shaped causes.Generated from the plugin's indexed repository (saschb2b/skills) — no native marketplace selected
npx claudepluginhub p/saschb2b-saschb2b-skillsOther plugins' skills for the same job