Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix regression with placeholder text color. #10288
Recently we increased the contrast of text color in placeholder text.
As part of this, we changed from using opacity, to using rgba, to provide not-fully-opaque placeholder text. This caused a regression in contexts that did not have a light background, because the RGBA obviously adds a color, it doesn't just change the opacity.
For example placeholder text in a Cover Image block was suddenly dark, and if you added a dark editor style, placeholder text was not legible.
This PR changes that back, with a few tweaks, so it relies on opacity again. The benefit to this is that any block or editor style that provides its own text color for elements can use the placeholder aspect without having to also worry about the placeholder text color in various background environments.
This PR ensures there is sufficient (4.7+ contrast ratios) for placeholder text in:
Looks good, if you could just tweak the comments then it's good to merge.
Thanks for the review @tofumatt. In 020b360, I pushed what's more or less a refactor inspired by your feedback. Essentially I realized that whether it's a caption that's underneath an image (gray text) or overlaid on a gallery item (white text on black scrim), the same .8 opacity is necessary. Not only that, but also embeds and other things have captions.
So I made a single generic rule for all caption placeholders, that seems to work. Can I get a sanity check/re-review? Thanks.