Fossil SCM
The window.fossil bootstrapping code now adds the CSS class 'fossil-dark-style' to the body element if the skin has a true white-foreground setting. The initial use case for this is CSS-based color changing for pikchr SVGs, so that the same pikchrs work in light and dark themes.
Commit
e8f603f03a210aed5625e928316b99cdee27454d46763e2a41e894b173ee238d
Parent
bb56d3d5a2e39f5…
1 file changed
+2
+2
| --- src/builtin.c | ||
| +++ src/builtin.c | ||
| @@ -635,10 +635,12 @@ | ||
| 635 | 635 | CX("isDark: %s" |
| 636 | 636 | "/*true if the current skin has the 'white-foreground' detail*/", |
| 637 | 637 | skin_detail_boolean("white-foreground") ? "true" : "false"); |
| 638 | 638 | CX("}\n"/*fossil.config.skin*/); |
| 639 | 639 | CX("};\n"/* fossil.config */); |
| 640 | + CX("if(fossil.config.skin.isDark) " | |
| 641 | + "document.body.classList.add('fossil-dark-style');\n"); | |
| 640 | 642 | #if 0 |
| 641 | 643 | /* Is it safe to emit the CSRF token here? Some pages add it |
| 642 | 644 | ** as a hidden form field. */ |
| 643 | 645 | if(g.zCsrfToken[0]!=0){ |
| 644 | 646 | CX("window.fossil.csrfToken = %!j;\n", |
| 645 | 647 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -635,10 +635,12 @@ | |
| 635 | CX("isDark: %s" |
| 636 | "/*true if the current skin has the 'white-foreground' detail*/", |
| 637 | skin_detail_boolean("white-foreground") ? "true" : "false"); |
| 638 | CX("}\n"/*fossil.config.skin*/); |
| 639 | CX("};\n"/* fossil.config */); |
| 640 | #if 0 |
| 641 | /* Is it safe to emit the CSRF token here? Some pages add it |
| 642 | ** as a hidden form field. */ |
| 643 | if(g.zCsrfToken[0]!=0){ |
| 644 | CX("window.fossil.csrfToken = %!j;\n", |
| 645 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -635,10 +635,12 @@ | |
| 635 | CX("isDark: %s" |
| 636 | "/*true if the current skin has the 'white-foreground' detail*/", |
| 637 | skin_detail_boolean("white-foreground") ? "true" : "false"); |
| 638 | CX("}\n"/*fossil.config.skin*/); |
| 639 | CX("};\n"/* fossil.config */); |
| 640 | CX("if(fossil.config.skin.isDark) " |
| 641 | "document.body.classList.add('fossil-dark-style');\n"); |
| 642 | #if 0 |
| 643 | /* Is it safe to emit the CSRF token here? Some pages add it |
| 644 | ** as a hidden form field. */ |
| 645 | if(g.zCsrfToken[0]!=0){ |
| 646 | CX("window.fossil.csrfToken = %!j;\n", |
| 647 |