/pf-design-audit:pf-css-token-checkfrom pf-design-audit
Detects hardcoded color, spacing, typography, border radius, and shadow values in CSS/SCSS/CSS-in-JS/inline styles and suggests PatternFly design token replacements. Use when auditing stylesheets for design token compliance or refactoring to use PF tokens.
Ships in pf-design-audit. 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.
Analyze the provided code to find any raw values (colors, spacing, typography, shadows, etc.) assigned to styling properties. Flag these values as technical debt and suggest their replacement with PatternFly design tokens, following the token hierarchy: Raw value → Palette token → Base Token → Semantic Token. Always recommend semantic tokens when they exist.
When suggesting token replacements, follow this priority order:
--pf-v6-c-button--BackgroundColor)--pf-t--global--color--brand--default)--pf-t--color--blue--40)Regex Pattern Match: Identify values matching:
Named Colors (X11 List):
Property Filter: Only flag these values if assigned to CSS color properties:
color, background-color, background, border-color, border, border-top-color, border-right-color, border-bottom-color, border-left-color, outline-color, box-shadow, text-shadow, fill, strokePattern Match: Identify values for spacing properties:
px, rem, em, pt, vw, dvw, vh, dvhProperty Filter: Only flag these values if assigned to spacing properties:
margin, margin-top, margin-right, margin-bottom, margin-left, margin-inline, margin-inline-start, margin-inline-end, margin-block, margin-block-start, margin-block-endpadding, padding-top, padding-right, padding-bottom, padding-left, padding-inline, padding-inline-start, padding-inline-end, padding-block, padding-block-start, padding-block-endgap, column-gap, row-gapinset, inset-inline, inset-inline-start, inset-inline-end, inset-block, inset-block-start, inset-block-endtop, right, bottom, leftFont Size Pattern Match:
px, rem, em, pt, vw, dvw, vh, dvh, ch in font-sizeFont Weight Pattern Match:
100, 200, 300, 400, 500, 600, 700, 800, 900 in font-weightnormal, bold, bolder, lighter in font-weightLine Height Pattern Match:
line-heightline-heightFont Family Pattern Match:
font-familyProperty Filter:
font-size, font-weight, line-height, font-family, letter-spacingBox Shadow Pattern Match:
Text Shadow Pattern Match:
Property Filter:
box-shadow, text-shadowPattern Match:
px, %, rem, emProperty Filter:
border-radius, border-top-left-radius, border-top-right-radius, border-bottom-left-radius, border-bottom-right-radius<div style="property: 'value'">property: value;$variable: value; (flag if not already a token reference)--custom-prop: value; (flag if not PF token){ property: 'value' }`property: value;`<div style={{ property: 'value' }}>const styles = { property: 'value' }Do NOT flag:
var(--pf-v6-...))patternfly/base/tokens/)Before searching PatternFly token files, check if the current file already has a matching token defined or imported.
Look in patternfly/base/tokens/ directory, in the node_modules/@patternfly/patternfly/base/tokens directory, or any additional tokens directory present in the users working directories:
tokens-default.scss - Default token definitionstokens-dark.scss - Dark theme tokenstokens-felt.scss - Felt token definitionstokens-felt-dark.scss - Felt Dark token definitionstokens-felt-glass-dark.scss - Felt Glass Dark theme tokenstokens-felt-glass.scss - Felt Glass theme tokenstokens-felt-highcontrast-dark.scss - Felt High Contrast Dark theme tokenstokens-felt-highcontrast.scss - Felt High Contrast tokenstokens-glass.scss - Glass theme tokenstokens-glass-dark.scss - Glass Dark theme tokenstokens-highcontrast-dark.scss - High Contrast Dark theme tokenstokens-highcontrast.scss - High Contrast theme tokensWhen searching for tokens, use the appropriate token category based on the CSS property. PatternFly uses specific token naming patterns for different property types.
--spacer tokenspadding, padding-*, margin, margin-*, gap, column-gap, row-gap, inset, inset-*, top, right, bottom, left, outline-offset--pf-t--global--spacer--{size} or --pf-v6-c-{component}--{property} referencing spacer tokens--pf-t--global--spacer--md, --pf-t--global--spacer--lg, --pf-v6-c-button--PaddingInline--text / --font tokensfont-size, font-weight, line-height, letter-spacing, font-family--pf-t--global--font--size--{scale}--pf-t--global--font--weight--{weight}--pf-t--global--font--line-height--{scale}--pf-t--global--font--family--{type}--pf-t--global--font--size--body--default, --pf-t--global--font--weight--bold--motion tokensanimation, animation-duration, animation-timing-function, transition, transition-duration, transition-timing-function, transform--pf-t--global--motion--{property}--pf-t--global--motion--duration--default, --pf-t--global--motion--timing-function--ease-in--icon tokenswidth, height (when applied to icon elements), font-size (for icon fonts)--pf-t--global--icon--size--{scale} or --pf-v6-c-{component}__icon--FontSize--pf-t--global--icon--size--md, --pf-v6-c-button__icon--FontSize--color tokenscolor, background-color, border-color, fill, stroke, outline-color--pf-t--color--{color}--{shade}--pf-t--global--color--{context}--{variant}--pf-v6-c-{component}--{property}--pf-t--global--color--brand--default, --pf-v6-c-button--BackgroundColor--border tokensborder-width, border-radius, border-style--pf-t--global--border--width--{scale}--pf-t--global--border--radius--{scale}--pf-t--global--border--width--default, --pf-t--global--border--radius--medium--shadow / --box-shadow tokensbox-shadow, text-shadow--pf-t--global--shadow--{scale} or --pf-v6-c-{component}--BoxShadow--pf-t--global--shadow--sm, --pf-v6-c-card--BoxShadow--z-index tokensz-index--pf-t--global--z-index--{layer}--pf-t--global--z-index--modal, --pf-t--global--z-index--tooltipWhen recommending tokens, always use the category-appropriate token type:
--spacer token for padding--motion token for animation timingWork through the hierarchy to find the semantic token:
#c9190b → --pf-t--color--red--40)--pf-t--global--color--status--danger--default)--pf-v6-c-button--m-danger--BackgroundColor)If a semantic token exists for the component and context, recommend it. If no semantic token exists but the property and value match a common pattern, suggest a semantic token name following PatternFly conventions:
Semantic Token Naming Pattern:
--pf-v6-c-{component}[--m-{modifier}]__{element}--{property}
Examples:
--pf-v6-c-nav--m-docked__link--PaddingInlineStart (nav component, docked modifier, link element, padding-inline-start property)--pf-v6-c-button--m-primary--BackgroundColor (button component, primary modifier, background-color property)--pf-v6-c-card--BoxShadow (card component, box-shadow property)For every violation found, provide:
Header:
## Design Token Violations Found: {count}
Per Violation:
### {n}. {File Name}
- **File Path:** `{path}`
- **Line Number:** `{number}`
- **Property:** `{css-property}`
- **Raw Value:** `{detected-value}`
- **Token Hierarchy:**
1. Raw value: `{value}`
2. Palette token: `{--pf-t--color--blue--40}` (if found)
3. Base token: `{--pf-t--global--color--brand--default}` (if found)
4. Semantic token: `{--pf-v6-c-component--Property}` (if found)
- **Recommendation:** Replace with `var({semantic-token})` {or} Create semantic token `{suggested-name}` that references `{base-token}`
- **Example:**
```css
/* Before */
{property}: {raw-value};
/* After */
{property}: var({semantic-token});
**Summary:**
### Example Violations
See `references/example-violations.md` for full resolution examples showing the violation → token hierarchy → recommendation flow for each category (color, spacing, typography, motion, icon, border radius, shadow, outline offset).
### Workflow
1. Scan the provided file(s) for raw values across all categories
2. For each violation, determine the token hierarchy
3. Search for existing semantic tokens in PatternFly
4. If semantic token exists, recommend it
5. If semantic token doesn't exist, suggest creating one with proper naming
6. Provide clear before/after examples
7. Summarize findings by category
README.md (opens in a new tab)eval/cases/already-tokenized-code/_tokenized-toolbar.scss (opens in a new tab)eval/cases/already-tokenized-code/annotations.yaml (opens in a new tab)eval/cases/already-tokenized-code/input.yaml (opens in a new tab)eval/cases/hardcoded-multi-category/_sidebar-styles.scss (opens in a new tab)eval/cases/hardcoded-multi-category/annotations.yaml (opens in a new tab)eval/cases/hardcoded-multi-category/input.yaml (opens in a new tab)eval/cases/wrong-token-tier/_alert-overrides.scss (opens in a new tab)eval/cases/wrong-token-tier/annotations.yaml (opens in a new tab)eval/cases/wrong-token-tier/input.yaml (opens in a new tab)eval/eval.yaml (opens in a new tab)references/comparison.md (opens in a new tab)references/example-violations.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
7 skills in this plugin
/pf-ai-auditAudit AI-powered features against Red Hat's AI design language — transparency notices, iconography, chatbot patterns, color and gradient rules. Use when reviewing chatbots, AI assistants, or generation UIs for brand compliance./pf-color-scanFind raw color values (hex, rgb, hsl) in code and suggest PatternFly design token replacements. Use when auditing stylesheets for hardcoded colors or enforcing token compliance./pf-figma-checkCheck Figma designs against PatternFly v6 standards for colors, typography, spacing, and component usage. Use when validating a design before handoff, auditing existing mockups for compliance, or reviewing design token usage. Requires Figma MCP.npx claudepluginhub rh-uxd/ai-helpers --plugin pf-design-auditOther plugins' skills for the same job