File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -304,6 +304,10 @@ function generateAutoThemeSVG(
304304
305305 <style>
306306 @import url('https://fonts.googleapis.com/css2?family=Fira+Code&family=JetBrains+Mono&family=Roboto&display=swap');
307+ /* Auto-theme strategy: expose the palette as CSS variables so the SVG can
308+ switch from light to dark through prefers-color-scheme. Shapes use classes
309+ instead of inline fills because inline fill attributes would override these
310+ variables and prevent the theme from updating automatically. */
307311 :root { --cp-bg: #${ light . bg } ; --cp-text: #${ light . text } ; --cp-accent: #${ light . accent } ; }
308312 @media (prefers-color-scheme: dark) { :root { --cp-bg: #${ dark . bg } ; --cp-text: #${ dark . text } ; --cp-accent: #${ dark . accent } ; } }
309313 .cp-bg-fill { fill: var(--cp-bg); } .cp-text-fill { fill: var(--cp-text); color: var(--cp-text); } .cp-accent-fill { fill: var(--cp-accent); color: var(--cp-accent); }
You can’t perform that action at this time.
0 commit comments