I see what the code is meant to do… it removes those from the style so it’s not on the element. And adds it to injectedStyles for the iframe to see. But that seems to actually do nothing.

For image generation, if you’re lucky you see it for a split second before the full-page grey element is shown. So at least there it is actually added by the iframe. Maybe the page background could be made grey by default and the injected style could override, and the grey element could just not have a background. At least then it would work. (Though as we can’t change the text colour, people could make an unreadable mess. On the other hand, that’s allowed by allowing any styling in the first place ;P)

The gallery doesn’t appear to add it at all, though.

Feature Request: CSS Injection

While we’re on the topic, I had a feature request… a property to inject full-on CSS. This would make things very flexible. Even allow us to prevent gallery saving by hiding that button, etc. Allow us to cater to dark mode in whatever way we wish also. And this background removing and injecting thing could just be commented out entirely because this new property would do the job… and actually do the job, too.

  • VioneTM
    link
    English
    31 month ago

    Without padding, you can’t really see the background on the generation iframe, but it applies nonetheless:

    • @wthit56OP
      link
      English
      31 month ago

      Oh weird… I don’t know why padding on an iframe would even do anything, but there you go… 😅 But still, makes the background a bit pointless if all you can do is make a little border-like thing around the outside.

      As for the gallery… no idea why that wasn’t working for me, but it’s working now. I was testing while I worked on adding the gallery to my text-to-image demo. Maybe the code wasn’t sorted properly yet, but it’s working now anyway. 👍