Problem/Motivation
Steps to reproduce:
- Enable the "Form API Example" module of this project
- Navigate to the "Common input elements" page on the "examples/form-api-example/input-demo/" URL path
- At the end of the demonstrated input element listing an
<input type="image" ... >item should be seen. - Although the markup is being generated in the DOM, but there's nothing to appear visually, only a big white area between the other buttons around. This happens even if you temporarily place the "Main page content" block into a region which has some non-white background-color:

It's not an SVG-rendering issue of the client browser, because it happens both in Chrome and Firefox as well. Instead, the root cause of the issue is the referenced vector image file (see its code or as rendered image on Gitlab: images/100x30.svg) literally contains no visible elements.
Proposed resolution
We can still keep using vector graphic (as it gets widely supported), but need to use an other image file. This Examples project contains an other graphic file in its images/ folder: the logo of this project also being used for the Toolbar menu item. My suggestion is to use that for this purpose also.
However, that icon is colored fully white as needed for the Toolbar. To prevent similar misunderstandings in the future when user expects to see the image on white background, let's add a dark-colored version of this logo. Store them in separate sub-directories as Drupal core does. Also, the source code of the existing examples.svg file can be cleaned up with SVGO. If we go this way, then the old 100x30.svg file can be deleted.
After patch applied, these two areas needs to be tested:

Remaining tasks
Test, RTBC, commit.
User interface changes
Preventing confusion, improving overall visual appearance.
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Original report by [username]
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| 3055178-invisible-image-button-1.patch | 10.94 KB | baluertl | |
| 3055178-what-to-test.png | 12.93 KB | baluertl | |
| 3055178-appearance-on-colored-backgrounds.png | 23.29 KB | baluertl |
Issue fork examples-3055179
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
baluertlTests reports "Waiting for branch to pass", so I unassign from myself, waiting for RTBC...
Comment #3
avpadernoComment #4
avpadernoComment #6
avpadernoComment #8
avpadernoThank you for the patch!
I used two different filenames for the images. For the image button, I used a rectangular image, as using the project logo as button does not make much sense. (I should probably use a better image for the button.)