Skip to content

Contact

Mexico City, Mexico
Available for remote and on-site projects.

Professional networks

LinkedIn · GitHub · Email
Applied engineering, measurable results.

Transparent does not mean invisible: color-scheme and #121212

· 2 min read · Samuel Torres

The most uncomfortable moment of the day was when I was told the form looked horrible, that it looked black, that there was no transparency. I had just finished pasting the transparent CSS into the 30 forms. I had checked in the builder that the background was transparent. And yet, on the live site, the form was a flat, opaque black block. Around it, the page was dark navy blue with a blue gradient that got stronger toward the bottom, almost royal blue in the "Extra Comments" area. The form covered all of that with black. Whoever complained was right: it looked horrible.

The real cause arrived by email at 13:14, and it was not JotForm's CSS. The 30 forms already had the transparent background, checked in all 30. It was a site rule, in rh.css, from the frame of the Conqr Jotform widget. That rule told the iframe that the form was "light", with color-scheme light. It was from the time when the forms were white. Now the form is dark, and when the page and the iframe do not agree on light and dark, Chrome and Safari paint the iframe as an opaque block of color #121212, even if the form is transparent.

That is the part that took me a while to understand: transparent does not mean invisible. Transparency is an agreement between layers. The form can say "my background is transparent" all it wants, but if the iframe that contains it is declared light and the page is dark, the browser does not let the page background through: it paints the iframe black. The form's CSS was fine. The problem was the frame. And none of us had touched the frame all day, because nobody was looking there.

There was a second detail hidden in the same file. On the job posts, the frame had a white background. Removing the black left a white card with the form's white text, unreadable. So the white was removed too. The final fix, only in rh.css, was to declare the iframe as dark, with color-scheme dark, so it matched the form and let the page background show through. The frame ended up transparent, with no border or shadow. With a backup, in case we had to revert.

The #121212 lesson

#121212 is the color Chrome and Safari use when an iframe does not know if it is light or dark. It is not a color anyone chose: it is the default color of disagreement. When I saw the black block, my first instinct was to blame the CSS I had just pasted. But the CSS was fine. The black came from a rule written long before, in a file that had nothing to do with JotForm, from a time when the forms were white.

That is why "transparent" is a misleading word. You think that setting background: transparent solves the background, and in reality it only solves one layer. Transparency has to be declared in every layer along the way: the form, the iframe and the frame. If a single layer says the opposite, the browser paints black and does not warn you. The next time something looks black for no reason, I already know where to look first: at the iframe's color-scheme, not at the content's CSS. Get a quote on WhatsApp in 2 min

Samuel Torres Pichardo

Samuel Torres Pichardo
Software and cloud engineer in Mexico City, with about 3 years of professional experience.
About me · LinkedIn · GitHub · Contact

Got a project in mind?

Hire me: I'll help you build it.

Websites, online stores, custom systems and cloud. Tell me what you need and I'll tell you how I'd build it, what it costs and how long it takes.

  • Mexico City · remote

Menu

Español

[email protected]