Fossil SCM

pikchrshow: when running under a skin with the white-foreground property, apply a CSS filter to the SVG to approximate a dark-theme look.

stephan 2020-09-10 05:20 pikchrshow
Commit c7d88f275403fbaee779877380c861f52c65a0b803f301096ff311bfa478ff86
1 file changed +7 -1
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -48,13 +48,19 @@
4848
"#pikchrshow-output, #pikchrshow-form"
4949
"{display: flex; flex-direction: column;}"
5050
"#pikchrshow-form > * {margin: 0.25em 0;}"
5151
"#pikchrshow-output {margin-top: 1em;}"
5252
"</style>");
53
+ if( skin_detail_boolean("white-foreground") ){
54
+ /* Flip the colors to approximate a dark theme look */
55
+ CX("<style>#pikchrshow-output > svg {"
56
+ "filter: invert(1) hue-rotate(180deg);"
57
+ "}</style>");
58
+ }
5359
CX("<form method='POST' id='pikchrshow-form' action=''>");
5460
CX("<div>Input pikchr code and tap SUBMIT to render it:</div>");
55
- CX("<textarea name='content' rows='20' cols='80'>");
61
+ CX("<textarea name='content' rows='15' cols='80'>");
5662
CX("%s", zContent/*safe-for-%s*/);
5763
CX("</textarea>");
5864
CX("<input type='submit'></input>");
5965
CX("</form>");
6066
CX("<div id='pikchrshow-output'>");
6167
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -48,13 +48,19 @@
48 "#pikchrshow-output, #pikchrshow-form"
49 "{display: flex; flex-direction: column;}"
50 "#pikchrshow-form > * {margin: 0.25em 0;}"
51 "#pikchrshow-output {margin-top: 1em;}"
52 "</style>");
 
 
 
 
 
 
53 CX("<form method='POST' id='pikchrshow-form' action=''>");
54 CX("<div>Input pikchr code and tap SUBMIT to render it:</div>");
55 CX("<textarea name='content' rows='20' cols='80'>");
56 CX("%s", zContent/*safe-for-%s*/);
57 CX("</textarea>");
58 CX("<input type='submit'></input>");
59 CX("</form>");
60 CX("<div id='pikchrshow-output'>");
61
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -48,13 +48,19 @@
48 "#pikchrshow-output, #pikchrshow-form"
49 "{display: flex; flex-direction: column;}"
50 "#pikchrshow-form > * {margin: 0.25em 0;}"
51 "#pikchrshow-output {margin-top: 1em;}"
52 "</style>");
53 if( skin_detail_boolean("white-foreground") ){
54 /* Flip the colors to approximate a dark theme look */
55 CX("<style>#pikchrshow-output > svg {"
56 "filter: invert(1) hue-rotate(180deg);"
57 "}</style>");
58 }
59 CX("<form method='POST' id='pikchrshow-form' action=''>");
60 CX("<div>Input pikchr code and tap SUBMIT to render it:</div>");
61 CX("<textarea name='content' rows='15' cols='80'>");
62 CX("%s", zContent/*safe-for-%s*/);
63 CX("</textarea>");
64 CX("<input type='submit'></input>");
65 CX("</form>");
66 CX("<div id='pikchrshow-output'>");
67

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button