fix: improve dark theme link colors for better readability

- Enhanced dark theme with brighter link colors (#79c0ff, #a5d6ff)
- Added corresponding light theme link colors (#0969da, #0550ae)
- Fixed template parsing bug where 'light' theme was falling back to 'basic'
- All theme system tests continue to pass

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-27 21:56:38 +01:00
parent 5df78c3359
commit bbceea5c7b

View File

@@ -134,8 +134,8 @@ class CleanDocumentManager:
else:
# Legacy single theme or fallback
if not template or template not in TEMPLATE_STYLES:
# Use default layered themes
theme_list = parse_theme_string('basic')
# Use default layered themes or the specified theme
theme_list = parse_theme_string(template or 'basic')
combined_props = combine_theme_properties(theme_list)
return self._generate_layered_css(combined_props)
else:
@@ -267,9 +267,28 @@ class CleanDocumentManager:
font-weight: 600;
}}"""
# Branding accents (if specified)
# Link styling
link_css = ""
if props.get('link_color'):
link_css = f"""
a {{
color: {props['link_color']};
text-decoration: underline;
}}"""
if props.get('link_hover_color'):
link_css += f"""
a:hover {{
color: {props['link_hover_color']};
}}"""
else:
link_css += """
a:hover {
opacity: 0.8;
}"""
# Branding accents (if specified and no link_color already set)
accent_css = ""
if props.get('accent_color'):
if props.get('accent_color') and not props.get('link_color'):
accent_css = f"""
a {{
color: {props['accent_color']};
@@ -278,7 +297,7 @@ class CleanDocumentManager:
opacity: 0.8;
}}"""
return f"<style>{base_css}{heading_css}{text_css}{element_css}{accent_css}</style>"
return f"<style>{base_css}{heading_css}{text_css}{element_css}{link_css}{accent_css}</style>"
def _get_legacy_template_css(self, template: str) -> str:
"""Legacy CSS generation - kept for backward compatibility."""