XF 2.2 Where is the code for the style of the default file upload button "Choose File"?

CStrategies

Active member
The
Code:
<xf:upload>
button appears on the site as a drab early 2000's gray and white button.

XUF2DM1Ntd.webp

In the template code, it looks like:
Code:
<xf:macro name="custom_dependent" arg-id="">
    <xf:upload name="upload" accept=".gif,.jpeg,.jpg,.jpe,.png" id="{$id}" />
</xf:macro>

The button does not appear in the rendered HTML, so there is no way to select it via CSS. One assumes it is created via JS, but I have run a text-string search for "Choose File" in every js, xml, and php file in the XenForo installation with no luck. Not even a phrase that matches this button.

It is an ugly button. It looks wholly different from everything else on the site. Please tell me how to style/modify/hook/intercept or replace this mysterious ghost button.

Thank you in advance!
 
You can't style it, it's rendered by the browser/OS, the same as radio buttons and the list of options in select fields, and the text comes from your browser.

You need awkward hacks to create a new element on top that has your styling and then make the original one invisible, so clicking the new element actually clicks the upload button. This is what it does for the "Attach files button":

1741655113050.webp
1741655129902.webp
1741655146826.webp

It hides the default input and shifts it away and clicking the new button triggers a click on the default one.
 
Back
Top Bottom