Re: [csswg-drafts] [css-forms-1] Define pseudo element for file input label (#11847)

> Also, what if a developer wants tO replace the ::file- selector -button with their
own custom element button?

How common is this?

Most customisations I've done in the past were essentially hiding the label entirely and then making the button an icon (like a paper clip) which I think the pseudo would allow provided I could set the content to an empty string (with an alt fallback value) and using background-image.

Alternatively we do have the showPicker() function so perhaps hiding this button and linking your own externally through that would allow the composition case? (if we added command="show-picker" you wouldn't even need JS). Obviously this kind of escape hatch shouldn't be the goal for common cases but the fact it exists is useful.

-- 
GitHub Notification of comment by lukewarlow
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11847#issuecomment-2711358657 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 10 March 2025 17:40:33 UTC