Extract CSS styles to separate files for better maintainability

- Create templates/brutalism.css, glassmorphism.css, neumorphism.css
- Update styles.py to read CSS from files instead of inline strings
- Support --template with .css files (auto-detects modern style)
- CSS files can now be edited with proper syntax highlighting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Miguel Astor
2026-03-03 03:29:25 -04:00
parent 15a8072804
commit b56b7176a8
5 changed files with 1837 additions and 1824 deletions

View File

@@ -230,9 +230,23 @@ def main():
print(f"Error: Assets directory not found: {args.assets}")
return 1
# Validate template only if not using modern style
if args.style and args.style in MODERN_STYLES:
# Determine style from --style or --template
style = args.style
# If no --style provided, check if --template points to a modern CSS file
if not style and args.template.endswith('.css'):
template_path = Path(args.template)
style_name = template_path.stem # e.g., "brutalism" from "brutalism.css"
if style_name in MODERN_STYLES:
style = style_name
# Validate template/style
if style and style in MODERN_STYLES:
template_path = SCRIPT_DIR / "templates" / "modern.html"
css_path = SCRIPT_DIR / "templates" / f"{style}.css"
if not css_path.exists():
print(f"Error: CSS file not found: {css_path}")
return 1
else:
template_path = SCRIPT_DIR / args.template
@@ -240,7 +254,7 @@ def main():
print(f"Error: Template file not found: {template_path}")
return 1
generate_report(args.db, args.output, args.top, args.assets, args.template, args.background, args.style)
generate_report(args.db, args.output, args.top, args.assets, args.template, args.background, style)
return 0