Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review icons for dark/light #22

Open
clach04 opened this issue Dec 10, 2023 · 0 comments
Open

Review icons for dark/light #22

clach04 opened this issue Dec 10, 2023 · 0 comments

Comments

@clach04
Copy link
Owner

clach04 commented Dec 10, 2023

See todotxt/todo.txt#87 where single SVG is used for both light and dark.

https://github.com/hapytex/todo.txt/tree/feature/make-image-theme-sensitive

extract (sans email address for privacy, see link above):

commit e4955184ecb0ce73ffcbe16d1c73eb3568aae955 (HEAD -> feature/make-image-theme-sensitive, origin/feature/make-image-theme-sensitive)
Date:   Tue Sep 5 23:17:11 2023 +0200

	flip colors when the user prefers a dark color scheme

diff --git a/description.svg b/description.svg
index 5e31a0d..3f6e3ce 100644
--- a/description.svg
+++ b/description.svg
@@ -3,8 +3,15 @@
		 .st0{font-family:Courier;font-size:12px;}
		 .st1{fill:none;stroke:#000000;stroke-miterlimit:10;}
		 .st2{font-family:Arial;font-size:10px;}
+        .bg{fill:#ffffff;}
+        @media (prefers-color-scheme: dark) {
+            .st0{fill:#ffffff;}
+            .st1{stroke:#ffffff;}
+            .st2{fill:#ffffff;}
+            .bg {fill:#000000;}
+        }
	 </style>
-    <rect width="100%" height="100%" fill="#FFF"/>
+    <rect width="100%" height="100%" class="bg"/>
	 <text class="st0" transform="translate(4.024 172.96)">
		 x (A) 2016-05-20 2016-04-30 measure space for +chapelShelving @chapel due:2016-05-30
	 </text>

NOTE #21 limitation with Chrome based browsers.

Full sample from change referenced above:

<svg xmlns="http://www.w3.org/2000/svg" id="svg2" viewBox="0 0 632.2 281">
    <style>
        .st0{font-family:Courier;font-size:12px;}
        .st1{fill:none;stroke:#000000;stroke-miterlimit:10;}
        .st2{font-family:Arial;font-size:10px;}
        .bg{fill:#ffffff;}
        @media (prefers-color-scheme: dark) {
            .st0{fill:#ffffff;}
            .st1{stroke:#ffffff;}
            .st2{fill:#ffffff;}
            .bg {fill:#000000;}
        }
    </style>
    <rect width="100%" height="100%" class="bg"/>
    <text class="st0" transform="translate(4.024 172.96)">
        x (A) 2016-05-20 2016-04-30 measure space for +chapelShelving @chapel due:2016-05-30
    </text>
    <path d="M15.2 159v-6H.5v6m36 0v-6H21.8v6m96.5 0v-6H47.5v6m149.3 0v-6H126v6m483.7.2V153H206v6.1m238.7 22.8v7.2H335V182m274.7-.1v7.2H509V182m-7.5-.1v7.2h-49.1V182" class="st1"/>
    <text class="st2" transform="rotate(-45 161.175 55.627)">
        Optional — Marks completion
    </text>
    <text class="st2" transform="rotate(-45 171.8 29.976)">
        Optional -- Marks priority
    </text>
    <text class="st2" transform="rotate(-45 198.684 -34.92)">
        Optional -- Completion Date
    </text>
    <text transform="rotate(-45 237.935 -129.68)">
        <tspan x="0" y="0" class="st2">Optional -- Creation Date</tspan>
        <tspan x="0" y="12" class="st2">(must be specified if completion date is)</tspan>
    </text>
    <text transform="rotate(-45 352.18 -405.478)">
        <tspan x="0" y="0" class="st2">Description; tags (optional)</tspan>
        <tspan x="0" y="12" class="st2">can be placed anywhere in here</tspan>
    </text>
    <text class="st2" transform="rotate(45 -60.77 576.533)">
        Project Tag
    </text>
    <text class="st2" transform="rotate(45 -17.238 681.627)">
        Context tag
    </text>
    <text class="st2" transform="rotate(45 23.978 781.127)">
        Special key/value tag
    </text>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant