Date: 2025-12-18 Status: CRITICAL - Multiple violations found Priority: HIGH - Must be fixed before production
Found 15+ instances of hard-coded CSS values across 2 files that violate the projectβs CSS Variables Philosophy. The primary violator is animated-grid.tsx with canvas rendering using hard-coded RGBA colors instead of CSS variables.
| File | Line | Current Value | Should Use |
|---|---|---|---|
animated-grid.tsx |
34 | rgba(0, 217, 255, 0.05) |
--color-primary with alpha |
animated-grid.tsx |
55 | rgba(0, 217, 255, ${...}) |
--color-primary with alpha |
animated-grid.tsx |
70 | rgba(0, 217, 255, 0.2) |
--color-primary with alpha |
animated-grid.tsx |
71 | rgba(255, 0, 110, 0.2) |
--color-accent with alpha |
animated-grid.tsx |
72 | rgba(204, 255, 0, 0.2) |
--color-secondary with alpha |
Impact: 5 color violations directly contradict the design systemβs single source of truth principle.
| File | Line | Current Value | Description | Should Use |
|---|---|---|---|---|
animated-grid.tsx |
25 | 40 |
Grid size | --grid-size (already exists!) |
animated-grid.tsx |
35 | 1 |
Line width | New CSS variable |
animated-grid.tsx |
54 | 2, 1 |
Pulse size/amplitude | Named constants |
animated-grid.tsx |
60 | 80 |
Grid modulo | Calculate from gridSize |
animated-grid.tsx |
76 | 0.05, 100 |
Animation speed/spacing | Named constants |
animated-grid.tsx |
77 | 200, 1000 |
Animation amplitude/offset | Named constants |
animated-grid.tsx |
81 | 3 |
Arc radius | Named constant |
Impact: 10+ magic numbers scattered throughout animation logic.
| File | Line | Issue | Recommendation |
|---|---|---|---|
animated-grid.tsx |
107 | style= |
Use className="pointer-events-none" |
skill-tree.tsx |
67-69 | Inline clipPath calculation |
Acceptable (dynamic calculation) |
skill-tree.tsx |
98 | Inline width style |
Acceptable (dynamic calculation) |
File: contact-section.tsx
Line: 230
Issue: className="text-smtext-success" - missing space!
Fix: Should be className="text-sm text-success"
src/components/sections/animated-grid.tsxTotal Violations: 15
// β WRONG - Current implementation
ctx.strokeStyle = 'rgba(0, 217, 255, 0.05)';
const streamColors = [
'rgba(0, 217, 255, 0.2)', // Primary cyan
'rgba(255, 0, 110, 0.2)', // Accent magenta
'rgba(204, 255, 0, 0.2)', // Secondary lime
];
// β
CORRECT - Should use CSS variables
const primaryColor = getCSSVariable('--color-primary'); // Returns "0 217 255"
ctx.strokeStyle = `rgba(${primaryColor}, 0.05)`;
const streamColors = [
`rgba(${getCSSVariable('--color-primary')}, 0.2)`,
`rgba(${getCSSVariable('--color-accent')}, 0.2)`,
`rgba(${getCSSVariable('--color-secondary')}, 0.2)`,
];
// β WRONG
const gridSize = 40;
// β
CORRECT - Variable already exists in globals.css!
const gridSize = parseInt(getCSSVariable('--grid-size')) || 40;
// β WRONG - Lines 54, 60, 76, 77, 81
const pulseSize = 2 + Math.sin(time * 0.001) * 1;
if ((x + y) % 80 === 0)
const x = ((time * 0.05 + i * 100) % canvas.width);
// β
CORRECT - Extract to constants
const ANIMATION_CONFIG = {
pulse: { base: 2, amplitude: 1 },
grid: { modulo: 80 }, // Or calculate: gridSize * 2
stream: { speed: 0.05, spacing: 100 },
arc: { radius: 3 },
animation: { amplitude: 200, offset: 1000 }
};
src/components/sections/skill-tree.tsxTotal Violations: 0 (dynamic styles are acceptable)
The inline styles found are dynamically calculated based on props/state:
clipPath polygon calculated from levelProgresswidth calculated from levelProgressVerdict: β ACCEPTABLE - These are runtime calculations, not hard-coded values.
src/components/sections/contact-section.tsxTotal Violations: 1 (typo)
Line 230:
// β WRONG
className="text-smtext-success flex items-center gap-2"
// β
CORRECT
className="text-sm text-success flex items-center gap-2"
Create src/lib/css-variables.ts:
/**
* Gets a CSS variable value from the root element
* @param variable - CSS variable name (with or without --)
* @returns The variable value as a string
*/
export function getCSSVariable(variable: string): string {
const varName = variable.startsWith('--') ? variable : `--${variable}`;
return getComputedStyle(document.documentElement)
.getPropertyValue(varName)
.trim();
}
/**
* Gets a CSS variable as RGB values for canvas rendering
* @param variable - CSS variable name (e.g., 'color-primary')
* @returns RGB string like "0 217 255"
*/
export function getCSSColor(variable: string): string {
return getCSSVariable(`--color-${variable}`);
}
getCSSColor()ANIMATION_CONFIG constant--grid-size CSS variablestyle with classNameSimple typo fix - add space between text-sm and text-success.
Either:
src/lib/constants.tssrc/lib/animation-config.tsglobals.cssRecommendation: Option A for JavaScript-only values, Option C for values that might be used in both CSS and JS.
From src/app/globals.css, these variables are already defined and should be used:
--color-primary: 0 217 255; /* Electric Cyan #00D9FF */
--color-accent: 255 0 110; /* Neon Magenta #FF006E */
--color-secondary: 204 255 0; /* Electric Lime #CCFF00 */
--color-success: 0 255 159; /* #00FF9F */
--color-warning: 255 184 0; /* #FFB800 */
--color-error: 255 71 87; /* #FF4757 */
--grid-size: 40px; /* ALREADY EXISTS! */
--spacing-xs: 0.25rem;
--spacing-sm: 0.5rem;
--spacing-md: 1rem;
--spacing-lg: 1.5rem;
--spacing-xl: 2rem;
--spacing-2xl: 3rem;
--spacing-3xl: 4rem;
src/lib/css-variables.ts utilityanimated-grid.tsx to use CSS variables for colorscontact-section.tsx line 230After fixes:
Report Generated: 2025-12-18 Audited By: Claude Code Styling Assistant Next Review: After fixes are implemented