Files
devplacepy/devplacepy/static/css/markdown.css
T
retoorandClaude Sonnet 5 82d6628af1 Fix low-contrast links, inline code, and warning badges on dark surfaces
Two independent contrast bugs, both from a token being used somewhere
it was never validated as a text color:

- Links/inline code used --accent as their text color against dark
  card surfaces, measuring 2.8-3.6:1 (below the 4.5:1 AA threshold for
  normal text) depending on the surface. Worst case: the sender's own
  DM chat bubble uses --accent as its *background*, so a link inside
  your own message was the exact same color as the bubble - 1.0:1,
  functionally invisible. Added --link/--link-hover (same hue/
  saturation as --accent, lightened until they clear 4.5:1 against the
  darkest realistic surface) and repointed the sitewide `a`/`a:hover`
  default, `.rendered-content a`/`code`, `.docs-chat-bubble a`, and
  `.ds-chat-citations a`. The DM chat bubble additionally needed
  bubble-scoped overrides (link, AI-adjusted note, attachment-pending
  placeholder, failed-send outline/retry-hint) since its background
  *is* --accent, which --link alone doesn't fix.
- `background: var(--warning); color: var(--white)` (chat's connection
  banner, a container badge, a service-status badge, and docs' PUT/4xx
  badges) measured ~1.7:1 - yellow needs dark text. Added --on-warning
  mirroring the existing --on-accent pattern and repointed just the
  warning-backed variants, leaving sibling info/success/danger badges
  untouched (they have the same underlying issue but are out of scope
  for this pass).

--accent itself is untouched, so every button/badge/nav element using
it as a solid fill is unchanged. Verified with computed WCAG contrast
ratios and Playwright screenshots against a live render of the real
CSS, plus the production homepage to confirm no regression to brand
colors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vnp7vzE4hvsytMo5YjszJm
2026-09-08 20:48:30 +02:00

238 lines
4.8 KiB
CSS

/* retoor <retoor@molodetz.nl> */
.rendered-content {
line-height: 1.65;
word-break: break-word;
}
.rendered-content p {
margin-bottom: 0.5rem;
}
.rendered-content p:last-child {
margin-bottom: 0;
}
.rendered-content ul,
.rendered-content ol {
margin: 0.5rem 0;
padding-left: 1.5rem;
}
.rendered-content li {
margin-bottom: 0.25rem;
}
.rendered-content blockquote {
border-left: 3px solid var(--accent);
padding: 0.25rem 0.75rem;
margin: 0.5rem 0;
color: var(--text-secondary);
background: var(--accent-light);
border-radius: 0 var(--radius) var(--radius) 0;
}
.rendered-content h1,
.rendered-content h2,
.rendered-content h3,
.rendered-content h4 {
margin: 1rem 0 0.5rem;
font-weight: 700;
color: var(--text-primary);
}
.rendered-content h1 { font-size: 1.25rem; }
.rendered-content h2 { font-size: 1.125rem; }
.rendered-content h3 { font-size: 1rem; }
.rendered-content h4 { font-size: 0.9375rem; }
.rendered-content a {
color: var(--link);
text-decoration: underline;
}
.rendered-content a:hover {
color: var(--link-hover);
}
.rendered-content hr {
border: none;
border-top: 1px solid var(--border);
margin: 1rem 0;
}
.rendered-content table {
display: block;
max-width: 100%;
overflow-x: auto;
border-collapse: collapse;
margin: 0.75rem 0;
font-size: 0.8125rem;
-webkit-overflow-scrolling: touch;
}
.rendered-content th,
.rendered-content td {
border: 1px solid var(--border);
padding: 0.5rem 0.75rem;
text-align: left;
}
.rendered-content th {
background: var(--bg-card-hover);
font-weight: 700;
color: var(--text-primary);
}
.rendered-content td {
color: var(--text-secondary);
}
.rendered-content tr:nth-child(even) td {
background: rgba(255, 255, 255, 0.02);
}
.rendered-content code {
font-family: "SF Mono", Monaco, "Cascadia Code", "Fira Code", monospace;
font-size: 0.8125em;
padding: 0.125rem 0.375rem;
border-radius: 4px;
background: var(--bg-card-hover);
color: var(--link);
}
.rendered-content pre {
margin: 0.75rem 0;
border-radius: var(--radius);
overflow-x: auto;
position: relative;
}
.rendered-content pre code {
display: block;
padding: 1rem;
background: var(--bg-secondary);
color: var(--text-primary);
font-size: 0.8125rem;
line-height: 1.5;
border-radius: var(--radius);
border: 1px solid var(--border);
overflow-x: auto;
}
dp-content.rendered-content {
position: relative;
}
.content-copy-btn {
position: absolute;
top: 0.25rem;
right: 0.25rem;
z-index: 2;
padding: 0.2rem 0.6rem;
font-size: 0.75rem;
color: var(--text-secondary);
background: var(--bg-card);
border: 1px solid var(--border-light);
border-radius: var(--radius);
cursor: pointer;
opacity: 0;
transition: opacity 0.15s ease;
}
dp-content:hover .content-copy-btn,
.content-copy-btn:focus {
opacity: 1;
}
.content-copy-btn:hover {
color: var(--white);
border-color: var(--accent);
}
pre.code-has-copy {
position: relative;
}
pre.code-has-copy > .code-copy-btn {
position: absolute;
top: 0.4rem;
right: 0.4rem;
z-index: 1;
padding: 0.2rem 0.6rem;
font-size: 0.7rem;
color: var(--text-secondary);
background: rgba(40, 44, 52, 0.9);
border: 1px solid rgba(255, 255, 255, 0.14);
border-radius: var(--radius);
cursor: pointer;
opacity: 1;
}
pre.code-has-copy > .code-copy-btn:hover {
color: var(--white);
border-color: var(--accent);
}
.embed-youtube {
position: relative;
width: 100%;
padding-bottom: 56.25%;
margin: 0.75rem 0;
border-radius: var(--radius);
overflow: hidden;
}
.embed-youtube iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: none;
}
.rendered-content img:not(.avatar-img) {
max-width: 100%;
border-radius: var(--radius);
margin: 0.5rem 0;
border: 1px solid var(--border);
}
.rendered-content video {
max-width: 100%;
border-radius: var(--radius);
margin: 0.5rem 0;
border: 1px solid var(--border);
background: var(--bg-primary);
}
.rendered-content a[href^="http"]::after {
content: "\u2197";
display: inline-block;
margin-left: 0.125rem;
font-size: 0.75em;
}
@media (max-width: 480px) {
.rendered-content ul,
.rendered-content ol {
padding-left: 1.125rem;
}
.rendered-content h1 { font-size: 1.125rem; }
.rendered-content h2 { font-size: 1.0625rem; }
.rendered-content h3 { font-size: 0.9375rem; }
.rendered-content h4 { font-size: 0.875rem; }
.rendered-content blockquote {
padding: 0.25rem 0.5rem;
}
.rendered-content pre code {
padding: 0.75rem;
font-size: 0.75rem;
}
}