Single theme-aware AI flow diagram SVG - #507
Merged
Merged
Conversation
Contributor
Author
|
Requested by: Devon White |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the AI flow diagram's light/dark SVG pair with a single theme-aware SVG file.
Requested by: Fern Support
What changed
ai-agent-flow-light.svg+ai-agent-flow-dark.svg→ oneai-agent-flow-themed.svg.ai/overview.mdxembeds it with a single plain<img>, no.light-only/.dark-onlypair.How one file covers both modes
CSS custom properties do not cross into the separate document of an
img-embedded SVG, so the file cannot read--accent. Butcolor-schemedoes propagate: Fern setsstyle="color-scheme: dark"on<html>with the theme toggle, that inherits to theimg, and the browser passes the embedding element'scolor-schemeinto the image's own document. So a media query inside the file tracks the site toggle rather than the visitor's OS:Four custom properties are the entire difference between the modes; the geometry exists once. Verified in Chrome: swaps on the toggle with no reload, in the page and in the zoom modal.
Staying an
<img>also keeps Fern's native image zoom, which isimg-only — an inline SVG loses it, and<Frame>does not add it back.Also explored (and why not)
var(--accent)/--grayscale-12/--sw-*frombrand-tokens.cssall resolve and nothing is duplicated per diagram. Rejected only because it forfeits image zoom.<img>and renders light colors on a dark page.@import,<?xml-stylesheet?>, data-URI) — all blocked; SVG-as-image loads no external resources.Authoring the next themed diagram
prefers-color-scheme: darkblock overriding them.var()is invalid in SVG presentation attributes.<or>inside<style>; a standalone.svgis parsed as XML.img[src*="diagram"]invert rules instyles.cssdon't restyle it..light-only/.dark-onlyremain instyles.cssas generic utilities — no page uses them now, so they can be removed separately if you want.