How to style the select button of file inputs (#tilPost)

Today I came across a PR in the MDN web compatibility data GitHub repository. The open source project holds all the browser support information for MDN and partially caniuse.com. Watching the project is perfect for discovering new b…

Today I came across a PR in the MDN web compatibility data GitHub repository. The open source project holds all the browser support information for MDN and partially caniuse.com. Watching the project is perfect for discovering new browser features and browser support changes (that's how I find out about all this stuff).

The PR #9763 updates the support and compatibility information for the ::file-selector-button pseudo element.

I was not aware that this pseudo-element even exists! The element enables developers to style the "browse" button of file select input elements.

Let's have a look at the pseudo-element.

Visualisation explaining that you can style the "browse" button of file inputs.

Previously, the existence of this pseudo-element wasn't exciting because it was only supported in Firefox. But! Safari and Chromium support is in the making. Chromium-based browsers will support the pseudo-element starting with v89 and Safari is shipping it in their technology preview already. Here's what you can do with it. ?

These new tiny features enable developers to build UIs matching their website style and identity without reinventing and rebuilding native HTML elements! That's a huge win! ?

If you just learned about this pseudo-element and want to tell it to the world, I shared it on Twitter, too." ?


Reply to Stefan
Print Share Comment Cite Upload Translate
CITATION GOES HERE CITATION GOES HERE
Select a language: