8000 [css-forms-1] Add `::file-selector-button` to selectors for buttons by lukewarlow · Pull Request #11876 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

Conversation

lukewarlow
Copy link
Member

Previously ::file-selector-button would be missing many of the styles associated with button-like UI.

@lukewarlow lukewarlow requested a review from nt1m March 9, 2025 13:40
@lukewarlow
Copy link
Member Author
lukewarlow commented Mar 9, 2025

Alternatively I guess we can get this behaviour by removing all references to this pseudo except for a single rule. That way it will automatically get all of these styles because it's a button?

::file-selector-button {
   appearance: base;
}

Though that will require reflecting the enabled state of the file input to its internal button because currently that doesn't happen.

@nt1m nt1m merged commit 34931f6 into w3c:main Mar 9, 2025
1 check passed
@lukewarlow lukewarlow deleted the file-selector-button-styles branch March 9, 2025 15:19
@tabatkins
Copy link
Member

That way it will automatically get all of these styles because it's a button?

For future reference: no, because it's a pseudo-element. The fact that it's element-backed by a button doesn't let it match button selectors, you do indeed still need to match it manually by pseudo-element name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0