uiua-lang / uiua

A stack-based array programming language
https://www.uiua.org
MIT License
1.51k stars 106 forks source link

Fix webkit combinator images #510

Closed bkDJ closed 2 months ago

bkDJ commented 2 months ago

Webkit doesn't seem to allow CSS into img elements. This means Safari and all iPhone browsers have (in dark mode) black-on-black letters with serifs in the combinator diagrams. Example:

image

I use object elements to solve this. And to ensure the relative sizes stay the same, I use view boxes in the SVGs. This PR is based on fiddling in my browser, not running the site locally, so consider this un-tested and more of a proposal.

kaikalii commented 2 months ago

In testing this (in Windows Firefox), I find that, because the <object> tag is used, right-clicking the images no longer gives image-related options. I can still merge without this, but is there a way to fix?

bkDJ commented 2 months ago

It's "possible" but would involve some ugly workarounds. If someone wants the SVGs, forcing them to "examine the element's HTML" or "look at the source code in this repo" are not great options, but still probably better than polluting CSS or JS for such a rare use case. :/

kaikalii commented 2 months ago

I can make clicking it open the svg

bkDJ commented 2 months ago

Awesome, thanks for merging this, now it looks correct on my tablet:

image
kaikalii commented 2 months ago

Ah, the font is still wrong though 😔